Previously, privileged processes (w/ INTERACT_ACROSS_USERS_FULL) that
run as user X are automatically allowed to connect to the current IME
even when it runs as a different user Y.
However, as explained in my previous CL [1], there are many text
operations that are already fully multiuser-aware hence need to be
connected to the right user's services.
If EditorInfo#targetInputMethodUser [2] is not correctly set when it
should have been, it's highly likely that the IME client would need to
call TextView#setTextOperationUser() [3] as I did for System UI [1].
To detect such problems as early as possible, with this CL
IMMS#startInputOrWindowGainedFocus() no longer resolves null
EditorInfo#targetInputMethodUser as the current IME user for
privileged processes that have INTERACT_ACROSS_USERS_FULL permission.
If this CL broke some IME use case, most likely the IME client app
would need to be fixed.
[1]: Ibabe13e5b85e5bb91f9f8af6ec07c395c25c4393
7276946b92
[2]: Ia7ea944438d69669ccdf9111b34ba400e786a602
0f5eade4a4
[3]: I6d11e4d6a84570bc2991a8552349e8b216b0d139
401e3d4c84
Bug: 34886274
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: per-profile mode still works.
Test: Manually tested multi-user scenario as follows
1. Build and flash an AOSP build
2. Create a secondary user then switch to it.
3. make -j SoftKeyboard
4. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
5. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
6. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
7. make -j EditTextVariations
8. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
9. adb shell am start \
-n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
10. Tap the menu icon on the EditTextVariations then click "Direct Reply"
11. Tap reply icon on "Message from UserHandle{10}".
12. Make sure that SoftKeyboard Sample IME is shown.
13. Type "ggggg" then hit the space key.
14. Make sure that red underline is drawn under "ggggg"
15. Make sure that AndroidSpellCheckerService runs as user 10.
16. Set up a text screenlock.
17. Turn off the display.
18. Turn on the display.
19. Make sure that SoftKeyboard Sample IME is shown.
Change-Id: Ieb94ed14698ee2669adc5fb2ea0e93c7d0e09e8b
Normal applications do not have permissions to use this method.
Test: m
Bug: 112869080
Merged-In: I693b3bf56f3be71f0790776e3aad5694717786ef
Change-Id: Ibe91c1bc4c94883a313e799cb0a37db7696fc62e
Test: atest com.android.server.pm.LauncherAppsServiceTest
Test: Able to boot in marlin, sailfish, walleye
Bug: 120904599
Change-Id: Ibfa58d1d8de3b182451da3edebf3e8e4e552899d
This CL deprecates SuggestionSpan#ACTION_SUGGESTION_PICKED and related
constants [1].
There are multiple security concerns, open questions about
compatibility, and maintainance challanges in this protocol.
IME developers can implement their own suggestion picker UI on top of
CursorAnchorInfo API to achieve safer, should give more flexible UI
options, better security, and better compatibility.
[1]: Ia539de0acf66053e0349daec459d75e36805f6bf
f9f0100862
Fix: 123160396
Test: make -j checkbuild
Change-Id: I6d39e838ae47488055162cd44b5f553f68869b17
As Java reference writes are atomic, the previous code should not have
issues, but since mConnector is marked @GuardedBy it could trigger
static analysis.
Test: m
Change-Id: I5a6174a4f32c349e593d0a16d58293d608a487c7
SQLiteQueryBuilder.appendWhere and appendWhereEscapeString
has @NonNull in master and aosp-master however not in staging.
This breaks the build in staging now the tool that generates
current.txt includes annotations in the signatures.
Test: lunch aosp_taimen-userdebug && make -j
Change-Id: Iea1728a13f2ed651533328b09517dfb6ad381130
NetworkMonitor lives in the NetworkStack which must only use system
APIs. This includes constants used by NetworkMonitor and captive portal
login.
Bug: 112869080
Test: m
Merged-In: I8b5f0bb61c3ef0d2f33af7dd67b72ac6c5a1d1b5
Change-Id: I4879568d3fbf9435767c8d4d0ab5198d421a2f4f