Skip to content

Commit b10b5ac

Browse files
Merge "Add required flag to receivers in LatinIME" into udc-dev am: 7b0c5a9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/inputmethods/LatinIME/+/21941666 Change-Id: I0feec251e3d9896f260527ec2c57835b7571dc18 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2 parents 808b042 + 7b0c5a9 commit b10b5ac

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

java/src/com/android/inputmethod/latin/LatinIME.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,16 +628,31 @@ public void onCreate() {
628628

629629
final IntentFilter newDictFilter = new IntentFilter();
630630
newDictFilter.addAction(DictionaryPackConstants.NEW_DICTIONARY_INTENT_ACTION);
631-
registerReceiver(mDictionaryPackInstallReceiver, newDictFilter);
631+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
632+
registerReceiver(mDictionaryPackInstallReceiver, newDictFilter,
633+
Context.RECEIVER_NOT_EXPORTED);
634+
} else {
635+
registerReceiver(mDictionaryPackInstallReceiver, newDictFilter);
636+
}
632637

633638
final IntentFilter dictDumpFilter = new IntentFilter();
634639
dictDumpFilter.addAction(DictionaryDumpBroadcastReceiver.DICTIONARY_DUMP_INTENT_ACTION);
635-
registerReceiver(mDictionaryDumpBroadcastReceiver, dictDumpFilter);
640+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
641+
registerReceiver(mDictionaryDumpBroadcastReceiver, dictDumpFilter,
642+
Context.RECEIVER_NOT_EXPORTED);
643+
} else {
644+
registerReceiver(mDictionaryDumpBroadcastReceiver, dictDumpFilter);
645+
}
636646

637647
final IntentFilter hideSoftInputFilter = new IntentFilter();
638648
hideSoftInputFilter.addAction(ACTION_HIDE_SOFT_INPUT);
639-
registerReceiver(mHideSoftInputReceiver, hideSoftInputFilter, PERMISSION_HIDE_SOFT_INPUT,
640-
null /* scheduler */);
649+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
650+
registerReceiver(mHideSoftInputReceiver, hideSoftInputFilter,
651+
PERMISSION_HIDE_SOFT_INPUT, null /* scheduler */, Context.RECEIVER_EXPORTED);
652+
} else {
653+
registerReceiver(mHideSoftInputReceiver, hideSoftInputFilter,
654+
PERMISSION_HIDE_SOFT_INPUT, null /* scheduler */);
655+
}
641656

642657
StatsUtils.onCreate(mSettings.getCurrent(), mRichImm);
643658
}

0 commit comments

Comments
 (0)