Skip to content

Commit 176fd72

Browse files
committed
Merge Android U (ab/10368041)
Bug: 291102124 Merged-In: I7efbfd50628298c436cb86d5d84af6cbfa7918da Change-Id: Ic95053849a83d3c13510c05d5fd03cc6863f3b65
2 parents d847619 + 64ce942 commit 176fd72

4 files changed

Lines changed: 42 additions & 39 deletions

File tree

java/AndroidManifest.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@
5454
<permission android:name="com.android.inputmethod.latin.HIDE_SOFT_INPUT"
5555
android:protectionLevel="signature"/>
5656

57+
<!-- To query enabled input methods. -->
58+
<queries>
59+
<intent>
60+
<action android:name="android.view.InputMethod" />
61+
</intent>
62+
</queries>
63+
5764
<application android:label="@string/english_ime_name"
5865
android:icon="@drawable/ic_launcher_keyboard"
5966
android:supportsRtl="true"
@@ -65,7 +72,8 @@
6572
<service android:name="LatinIME"
6673
android:label="@string/english_ime_name"
6774
android:permission="android.permission.BIND_INPUT_METHOD"
68-
android:exported="true">
75+
android:exported="true"
76+
android:visibleToInstantApps="true">
6977
<intent-filter>
7078
<action android:name="android.view.InputMethod"/>
7179
</intent-filter>
@@ -149,7 +157,7 @@
149157
<activity android:name="com.android.inputmethod.dictionarypack.DownloadOverMeteredDialog"
150158
android:theme="@style/platformActivityTheme"
151159
android:label="@string/dictionary_install_over_metered_network_prompt"
152-
android:exported="true">
160+
android:exported="false">
153161
<intent-filter>
154162
<action android:name="android.intent.action.MAIN"/>
155163
</intent-filter>

java/lint-baseline.xml

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,56 +26,36 @@
2626
<issue
2727
id="NewApi"
2828
message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`"
29-
errorLine1=" final WindowManager wm = getSystemService(WindowManager.class);"
30-
errorLine2=" ~~~~~~~~~~~~~~~~">
29+
errorLine1=" final UserManager userManager = context.getSystemService(UserManager.class);"
30+
errorLine2=" ~~~~~~~~~~~~~~~~">
3131
<location
32-
file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/LatinIME.java"
33-
line="606"
34-
column="34"/>
32+
file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/compat/UserManagerCompatUtils.java"
33+
line="69"
34+
column="49"/>
3535
</issue>
3636

3737
<issue
3838
id="NewApi"
39-
message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`"
40-
errorLine1=" final WindowManager wm = getSystemService(WindowManager.class);"
41-
errorLine2=" ~~~~~~~~~~~~~~~~">
39+
message="Call requires API level 23 (current min is 21): `android.app.ActivityOptions#makeBasic`">
4240
<location
4341
file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/LatinIME.java"
44-
line="804"
45-
column="34"/>
42+
line="1842"/>
4643
</issue>
4744

4845
<issue
4946
id="NewApi"
50-
message="Call requires API level 23 (current min is 21): `android.app.ActivityOptions#makeBasic`"
51-
errorLine1=" ActivityOptions.makeBasic().setLaunchDisplayId(currentDisplayId).toBundle());"
52-
errorLine2=" ~~~~~~~~~">
47+
message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`">
5348
<location
5449
file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/LatinIME.java"
55-
line="1823"
56-
column="33"/>
50+
line="605"/>
5751
</issue>
5852

5953
<issue
6054
id="NewApi"
61-
message="Call requires API level 26 (current min is 21): `android.app.ActivityOptions#setLaunchDisplayId`"
62-
errorLine1=" ActivityOptions.makeBasic().setLaunchDisplayId(currentDisplayId).toBundle());"
63-
errorLine2=" ~~~~~~~~~~~~~~~~~~">
55+
message="Call requires API level 26 (current min is 21): `android.app.ActivityOptions#setLaunchDisplayId`">
6456
<location
6557
file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/LatinIME.java"
66-
line="1823"
67-
column="45"/>
68-
</issue>
69-
70-
<issue
71-
id="NewApi"
72-
message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`"
73-
errorLine1=" final UserManager userManager = context.getSystemService(UserManager.class);"
74-
errorLine2=" ~~~~~~~~~~~~~~~~">
75-
<location
76-
file="packages/inputmethods/LatinIME/java/src/com/android/inputmethod/compat/UserManagerCompatUtils.java"
77-
line="69"
78-
column="49"/>
58+
line="1842"/>
7959
</issue>
8060

81-
</issues>
61+
</issues>

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
}

tests/AndroidTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
hence we cannot rely on "test-file-name" to install LatinIME.apk
2727
-->
2828

29-
<target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
29+
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
3030
<option name="cleanup-apks" value="true" />
3131
<option name="test-file-name" value="LatinIMETests.apk" />
3232
</target_preparer>

0 commit comments

Comments
 (0)