summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Groover <mpgroover@google.com>2023-03-14 02:54:46 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-03-14 02:54:46 +0000
commit997414c6df3916bf32a1bf4f596259e3e0a3a147 (patch)
treec75bd93ffd0b4ad2b0239d9c8b03d0fb770b92b0
parent08061bc938b3cde3acce786109c804425a5dc2c9 (diff)
parentb10b5ac7a3225f699a7233ca44ecc0826b8e4d43 (diff)
downloadLatinIME-997414c6df3916bf32a1bf4f596259e3e0a3a147.tar.gz
Merge "Add required flag to receivers in LatinIME" into udc-dev am: 7b0c5a98c1 am: b10b5ac7a3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/inputmethods/LatinIME/+/21941666 Change-Id: Ie81829a6f5094fd8dbfe6709180812bd357ef887 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 8ed3a59bf..e68b43b39 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -628,16 +628,31 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final IntentFilter newDictFilter = new IntentFilter();
newDictFilter.addAction(DictionaryPackConstants.NEW_DICTIONARY_INTENT_ACTION);
- registerReceiver(mDictionaryPackInstallReceiver, newDictFilter);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ registerReceiver(mDictionaryPackInstallReceiver, newDictFilter,
+ Context.RECEIVER_NOT_EXPORTED);
+ } else {
+ registerReceiver(mDictionaryPackInstallReceiver, newDictFilter);
+ }
final IntentFilter dictDumpFilter = new IntentFilter();
dictDumpFilter.addAction(DictionaryDumpBroadcastReceiver.DICTIONARY_DUMP_INTENT_ACTION);
- registerReceiver(mDictionaryDumpBroadcastReceiver, dictDumpFilter);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ registerReceiver(mDictionaryDumpBroadcastReceiver, dictDumpFilter,
+ Context.RECEIVER_NOT_EXPORTED);
+ } else {
+ registerReceiver(mDictionaryDumpBroadcastReceiver, dictDumpFilter);
+ }
final IntentFilter hideSoftInputFilter = new IntentFilter();
hideSoftInputFilter.addAction(ACTION_HIDE_SOFT_INPUT);
- registerReceiver(mHideSoftInputReceiver, hideSoftInputFilter, PERMISSION_HIDE_SOFT_INPUT,
- null /* scheduler */);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ registerReceiver(mHideSoftInputReceiver, hideSoftInputFilter,
+ PERMISSION_HIDE_SOFT_INPUT, null /* scheduler */, Context.RECEIVER_EXPORTED);
+ } else {
+ registerReceiver(mHideSoftInputReceiver, hideSoftInputFilter,
+ PERMISSION_HIDE_SOFT_INPUT, null /* scheduler */);
+ }
StatsUtils.onCreate(mSettings.getCurrent(), mRichImm);
}