diff options
author | 2023-10-06 05:38:51 +0000 | |
---|---|---|
committer | 2023-10-06 05:38:51 +0000 | |
commit | 0bba80779a8e499391a12a4f94fffbcaf9322d3f (patch) | |
tree | 5e936bd778cbd4e7f9027628dc8f7b09aadeccb1 | |
parent | d847619a2b48945465f840b8d81644fa455cc115 (diff) | |
parent | 2f0ac318043a47fa1a4250425d1f317639d89216 (diff) | |
download | latinime-0bba80779a8e499391a12a4f94fffbcaf9322d3f.tar.gz latinime-0bba80779a8e499391a12a4f94fffbcaf9322d3f.tar.xz latinime-0bba80779a8e499391a12a4f94fffbcaf9322d3f.zip |
Merge "Merge Android 14" into main
-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 | ||||
-rw-r--r-- | tests/AndroidTest.xml | 2 |
4 files changed, 42 insertions, 39 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); } diff --git a/tests/AndroidTest.xml b/tests/AndroidTest.xml index 41334d5a8..60e9a01e9 100644 --- a/tests/AndroidTest.xml +++ b/tests/AndroidTest.xml @@ -26,7 +26,7 @@ hence we cannot rely on "test-file-name" to install LatinIME.apk --> - <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup"> + <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> <option name="cleanup-apks" value="true" /> <option name="test-file-name" value="LatinIMETests.apk" /> </target_preparer> |