Skip to content

Commit 1ca5135

Browse files
committed
perf: improve private protect for draft
1 parent 482a3cd commit 1ca5135

File tree

1 file changed

+28
-17
lines changed
  • app/src/main/java/com/osfans/trime/ime/core

1 file changed

+28
-17
lines changed

app/src/main/java/com/osfans/trime/ime/core/Trime.java

+28-17
Original file line numberDiff line numberDiff line change
@@ -716,39 +716,50 @@ public void onStartInputView(EditorInfo attribute, boolean restarting) {
716716
case InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD:
717717
Timber.i(
718718
"EditorInfo: private;"
719-
+ " packageName"
719+
+ " packageName="
720720
+ attribute.packageName
721-
+ "; fieldName"
721+
+ "; fieldName="
722722
+ attribute.fieldName
723-
+ "; actionLabel"
723+
+ "; actionLabel="
724724
+ attribute.actionLabel
725-
+ "; inputType"
725+
+ "; inputType="
726726
+ attribute.inputType
727-
+ "; &v "
727+
+ "; VARIATION="
728728
+ (attribute.inputType & InputType.TYPE_MASK_VARIATION)
729-
+ "; &c "
730-
+ (attribute.inputType & InputType.TYPE_MASK_CLASS));
729+
+ "; CLASS="
730+
+ (attribute.inputType & InputType.TYPE_MASK_CLASS)
731+
+ "; ACTION="
732+
+ (attribute.imeOptions & EditorInfo.IME_MASK_ACTION));
731733
normalTextEditor = false;
732734
break;
733735

734736
default:
735737
Timber.i(
736738
"EditorInfo: normal;"
737-
+ " packageName"
739+
+ " packageName="
738740
+ attribute.packageName
739-
+ "; fieldName"
741+
+ "; fieldName="
740742
+ attribute.fieldName
741-
+ "; actionLabel"
743+
+ "; actionLabel="
742744
+ attribute.actionLabel
743-
+ "; inputType"
745+
+ "; inputType="
744746
+ attribute.inputType
745-
+ "; &v "
747+
+ "; VARIATION="
746748
+ (attribute.inputType & InputType.TYPE_MASK_VARIATION)
747-
+ "; &c "
748-
+ (attribute.inputType & InputType.TYPE_MASK_CLASS));
749-
normalTextEditor = true;
750-
activeEditorInstance.cacheDraft();
751-
addDraft();
749+
+ "; CLASS="
750+
+ (attribute.inputType & InputType.TYPE_MASK_CLASS)
751+
+ "; ACTION="
752+
+ (attribute.imeOptions & EditorInfo.IME_MASK_ACTION));
753+
754+
if ((attribute.imeOptions & EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING)
755+
== EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING) {
756+
// 应用程求以隐身模式打开键盘应用程序
757+
Timber.i("EditorInfo: normal -> private, IME_FLAG_NO_PERSONALIZED_LEARNING");
758+
} else {
759+
normalTextEditor = true;
760+
activeEditorInstance.cacheDraft();
761+
addDraft();
762+
}
752763
}
753764
}
754765

0 commit comments

Comments
 (0)