diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/AndroidManifest.xml | 12 | ||||
-rw-r--r-- | java/lint-baseline.xml | 44 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 23 |
3 files changed, 41 insertions, 38 deletions
diff --git a/java/AndroidManifest.xml b/java/AndroidManifest.xml index ac84c3388..633c68be3 100644 --- a/java/AndroidManifest.xml +++ b/java/AndroidManifest.xml @@ -54,6 +54,13 @@ <permission android:name="com.android.inputmethod.latin.HIDE_SOFT_INPUT" android:protectionLevel="signature"/> + <!-- To query enabled input methods. --> + <queries> + <intent> + <action android:name="android.view.InputMethod" /> + </intent> + </queries> + <application android:label="@string/english_ime_name" android:icon="@drawable/ic_launcher_keyboard" android:supportsRtl="true" @@ -65,7 +72,8 @@ <service android:name="LatinIME" android:label="@string/english_ime_name" android:permission="android.permission.BIND_INPUT_METHOD" - android:exported="true"> + android:exported="true" + android:visibleToInstantApps="true"> <intent-filter> <action android:name="android.view.InputMethod"/> </intent-filter> @@ -149,7 +157,7 @@ <activity android:name="com.android.inputmethod.dictionarypack.DownloadOverMeteredDialog" android:theme="@style/platformActivityTheme" android:label="@string/dictionary_install_over_metered_network_prompt" - android:exported="true"> + android:exported="false"> <intent-filter> <action android:name="android.intent.action.MAIN"/> </intent-filter> diff --git a/java/lint-baseline.xml b/java/lint-baseline.xml index 02f41f4e4..dbb81ca76 100644 --- a/java/lint-baseline.xml +++ b/java/lint-baseline.xml @@ -26,56 +26,36 @@ <issue id="NewApi" message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`" - errorLine1=" final WindowManager wm = getSystemService(WindowManager.class);" - errorLine2=" ~~~~~~~~~~~~~~~~"> + errorLine1=" final UserManager userManager = context.getSystemService(UserManager.class);" + errorLine2=" ~~~~~~~~~~~~~~~~"> <location - file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/LatinIME.java" - line="606" - column="34"/> + file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/compat/UserManagerCompatUtils.java" + line="69" + column="49"/> </issue> <issue id="NewApi" - message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`" - errorLine1=" final WindowManager wm = getSystemService(WindowManager.class);" - errorLine2=" ~~~~~~~~~~~~~~~~"> + message="Call requires API level 23 (current min is 21): `android.app.ActivityOptions#makeBasic`"> <location file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/LatinIME.java" - line="804" - column="34"/> + line="1842"/> </issue> <issue id="NewApi" - message="Call requires API level 23 (current min is 21): `android.app.ActivityOptions#makeBasic`" - errorLine1=" ActivityOptions.makeBasic().setLaunchDisplayId(currentDisplayId).toBundle());" - errorLine2=" ~~~~~~~~~"> + message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`"> <location file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/LatinIME.java" - line="1823" - column="33"/> + line="605"/> </issue> <issue id="NewApi" - message="Call requires API level 26 (current min is 21): `android.app.ActivityOptions#setLaunchDisplayId`" - errorLine1=" ActivityOptions.makeBasic().setLaunchDisplayId(currentDisplayId).toBundle());" - errorLine2=" ~~~~~~~~~~~~~~~~~~"> + message="Call requires API level 26 (current min is 21): `android.app.ActivityOptions#setLaunchDisplayId`"> <location file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/LatinIME.java" - line="1823" - column="45"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`" - errorLine1=" final UserManager userManager = context.getSystemService(UserManager.class);" - errorLine2=" ~~~~~~~~~~~~~~~~"> - <location - file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/compat/UserManagerCompatUtils.java" - line="69" - column="49"/> + line="1842"/> </issue> -</issues> +</issues>
\ No newline at end of file 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); } |