This event occurs when the user clicks through to modify notification
interruptiveness. Also add test for logging.
Bug: 121380248
Test: atest SystemUITests and manual verification
Change-Id: I5d1876ce79188a457f264eb71f8bd5709944483b
Voice state as well as voice transcription can be provided by the
VoiceInteractionService. These get proxied to the AssistManager which
can update the system UI to reflect the state & transcription.
Test: TBD
Bug: 122740752
Bug: 123080754
Change-Id: I79cac1d89fe0123bf25a05d551cb4ef40ae1368e
To measure the CTR of smart suggestions in notifications we need to log
when smart suggestions become visible. With this CL we add a
notification location log tag to know where a notification is displayed.
In this way we know which smart suggestions are shown in a heads-up
notification vs. the notification shade.
Bug: 120767764
Test: atest SystemUITests
Test: manually ensure notification surface is logged when a heads-up or
a notification in the shade is shown (and expanded).
Change-Id: Ia738f17ee6c47147b44639657dd0c1c352b4f314
Bug: 119642987
Bug: 117330206
Bug: 77606903
Test: Ran the following sequence:
1. Add simulated port: dumpsys usb add-port "matrix" ufp
2. Set contaminant present to true:
dumpsys usb set-contaminant-status "matrix" true
Contaminant present notifcation shows up and dialog pops up upon
clicking the notification.
3. Set contaminant present to false:
dumpsys usb set-contaminant-status "matrix" false
Contaminant present notification is dismissed and the safe to use
notification shows up.
Change-Id: I33d22caafbedb2a21a0f61f663ebddf5c9e3f84b
The tile only controls the default data subscription (this is enforced
by using DataUsageController#setMobileDataEnabled). The secondary text
shows the carrier name when data is enabled.
Bug: 113343186
Test: manual with only one SIM and using DSDS
Change-Id: I1b8f0720618cd5b1679e1185e77d36b0227b663c
To represent the UI location of a Notification we add the class enum
NotificationVisibility.NotificationLocation.
Bug: 120767764
Test: atest SystemUITests
Change-Id: I572c1cb7e585158f29675afd5255898e7f78e820
This is a small follow up to my previous CL [1], which made
RemoteInputView call TextView#setTextOperationUser() so that the text
operation uesr ID can be determined by the notification user ID.
Since the relationship between NotificationEntry and RemoteInputView
is immutable, there is no need to call setTextOperationUser(null) to
reset the target user ID in RemoteInputView#reset(), which may have
some race conditions.
With this CL, RemoteInputView calls setTextOperationUser() only once
immediatelly after inflation.
[1]: Ibabe13e5b85e5bb91f9f8af6ec07c395c25c4393
7276946b92fbac928b1d34971b9c4ffd975d95e4
Bug: 120744418
Bug: 123043618
Test: atest SystemUITests
Test: Manually tested Bug 120744418 scenario as follows.
1. Build and flash an AOSP build
2. adb root
3. adb shell setprop persist.debug.per_profile_ime 1
4. adb reboot
5. Install Test DPC
6. Enable managed profile with Test DPC
7. make -j SoftKeyboard
8. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
9. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
10. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
11. make -j EditTextVariations
12. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
13. adb shell am start --user 0 \
-n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
14. Tap the menu icon on the EditTextVariations then click "Direct Reply"
15. adb shell am start --user 10 \
-n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
16. Tap the menu icon on the EditTextVariations then click "Direct Reply"
17. Open notification shade.
18. Tap reply icon on "Message from UserHandle{0}".
19. Make sure that SoftKeyboard Sample IME is shown.
20. Tap reply icon on "Message from UserHandle{10}".
21. Make sure that AOSP Keyboard is shown.
22. Tap reply icon on "Message from UserHandle{0}" again.
23. Make sure that SoftKeyboard Sample IME is shown again.
Test: Manually tested Bug 123043618 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.
Test: Manually tested multi-user scenario with per-profile mode as follows.
1. Build and flash an AOSP build
2. adb root
3. adb shell setprop persist.debug.per_profile_ime 1
4. adb reboot
5. Create a secondary user then switch to it.
6. make -j SoftKeyboard
7. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
8. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
9. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
10. make -j EditTextVariations
11. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
12. adb shell am start \
-n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
13. Tap the menu icon on the EditTextVariations then click "Direct Reply"
14. Tap reply icon on "Message from UserHandle{10}".
15. Make sure that SoftKeyboard Sample IME is shown.
16. Type "ggggg" then hit the space key.
17. Make sure that red underline is drawn under "ggggg"
18. Make sure that AndroidSpellCheckerService runs as user 10.
Change-Id: I975baa748c821538e5a733bb98a33ac609bf40a7
In order to support multi-display, some event handlers need to be
plural. Based on the characteristic of each event handler, only
the event handler that needs to deal with concurrent events from
different display needs multi-instance.
Test: a11y CTS & unit tests
Test: atest SystemUITests
Change-Id: I76379fb82aad09ee20609d81bd5b1dda15931905
Symptom:
Accidentally, home button was not shown on navigation bar after
unlocking keygaurd.
Root cause:
Home button's visibility is controlled by STATUS_BAR_DISABLE_HOME
flag. Keygaurd requests STATUS_BAR_DISABLE_HOME flag at locking
and removes it at unlocking.
When removing the flag and recreation of NavigationBarFragment
happen simultaneously, NavigationBarFragment fails to remove the
flag and it keeps hiding the home button.
Solution:
CommandQueue has a latest requested "disabled" flags. It's better to
reevaluate the flag and apply it to the recreated NavigationBarFragment.
Test: manual
Fixes: 122999473
Fixes: 113914868
Change-Id: Ic19029aab2e777aeb187963da3ef341291cca490
Pass an argument to the Permissions Hub telling it to show only
accesses in the last minute.
Test: Open this dialog, click the button, ensure last minute is
selected in the Permissions Hub.
Change-Id: I55a11248ba3f08723628cb38861c86254d8e9e11
Plugins might be initialized before the StatusBar service is ready.
This means that #setForcePluginOpen might be called before #add.
Test: atest StatusBarWindowControllerTest
Change-Id: I99a220521272a2348ecece4c4581e7c82fa79490
Fixes: 123051520
To know from what UI location a notification was expanded we here pass
the location of the notification through
onNotificationExpansionChanged().
Bug: 120767764
Test: atest SystemUITests
Test: atest NotificationManagerServiceTest
Change-Id: I20612f5a88cf987f434392ae7a004d3ee3098998
This is in preparation for adding more logic related to docked state.
Bug: 122301289
Test: Used adb to switch between custom clock faces.
Change-Id: I0a13ef4e5894df1280a04c5a9df8bbed8054557b
This change introduces an alternate method of laying out notification
rows in StackScrollAlgorithm based on identifying an "anchor" view and
its position relative to the top of the container, then laying out the
rest of the rows outwards from there. It also adds alternate logic to
everywhere NotificationStackScrollLayout reads or modifies the scroll
position to work with the anchor-based approach instead. A binary flag
is introduced to toggle between the approaches.
In this change we implement the basic scrolling functionality only.
TODOs are added where functionality is missing, including:
- flinging/animated scrolling
- forced scroll/scrolling to a specific view
- clamping to window insets
- a11y scroll actions/scrolling state
- edge cases related to expanding/collapsing views above the anchor or
at the bottom of the shade
Test: atest SystemUITests, manual
Change-Id: Idd0711a7947733bd81c10feccda871b736c0578a
ISessionController will be moved to mainline module.
Test: pass MediaSessionTest and MediaControllerTest
Change-Id: I45b4da502e2b262730255a6cda1ab932d154ecbd
In order to keep the same action to wake up device when docked, it
should enable double tap sensor even though the setting is off.
The miss-touch can be ignored when docked.
Bug: 123057133
Test: atest SystemUITests
Change-Id: I67dec8b3ae51f46c50570eaec0250c1aa1dc8bb9
Keep surface size large enough to draw the image.
When we shrink for small image, we still maintain its aspect ratio.
Fix: 123108383
Test: atest ImageWallpaperTest
Test: manual verify aspect ratio not changed after rotate.
Test: manual put a small image as wallpaper and see surface size won't
grow too much.
Change-Id: Icf3bc4a3129d9aecba2b57c620f378b9d9d7374b
For system (assistant) generated smart replies we want to ensure the
replies don't seem biased (see example [1]). Therefore we here add an
experiment flag that determines the minimum number of replies N to show
in a notification. If we can't fit N replies into the notification we
remove all replies from that notification (i.e. we show zero replies).
[1] Example of biased replies:
Message: "Hi, how are you?"
Replies: "Good", "Great!", "Bad"
using only one reply here ("Good") might be seen as biased.
Bug: 120779592
Test: atest SystemUITests
Test: call "adb shell settings put global
smart_replies_in_notifications_flags enabled=true,min_num_replies=X" for
different values of X and ensure the behaviour is correct.
Change-Id: I898850f7895d0fd43ec6788095162f3138cd62cb
Android implements many complex text-related operations as per-user
out-of-process services. Notable examples are:
* InputMethodServices
* SpellCheckerService
* TextClassifierService
* AutofillService
For service client processes to connect to the right user's services
often the system assumes that a process that runs as user X should
connect to services that run as user X. While this approach works for
most of cases, there is at least one exception, System UI, which
always runs as the primary user (unless the device enables special
mode e.g. UserManager.isSplitSystemUser()) no matter who is the
current foreground user.
In order to deal with this special case, we recently introduced an
@hide API TextView#setTextOperationUser() [1] to centralize cross-user
special logic inside TextView. With this CL, KeyguardPasswordView and
RemoteInputView actually start calling it.
Note that TextView#setTextOperationUser() already takes care of IMEs
and SpellCheckers hence those two operations start working as expected
with this CL. Once TextView#setTextOperationUser() start taking care
of other operations such as text classification and clipboard,
KeyguardPasswordView and RemoteInputView will be automatically taken
care of with no code change.
[1]: I6d11e4d6a84570bc2991a8552349e8b216b0d139
401e3d4c842ce86569de4477138137dc07a6aa6f
Fix: 120744418
Fix: 123043618
Test: atest SystemUITests
Test: Manually tested Bug 120744418 scenario as follows.
1. Build and flash an AOSP build
2. adb root
3. adb shell setprop persist.debug.per_profile_ime 1
4. adb reboot
5. Install Test DPC
6. Enable managed profile with Test DPC
7. make -j SoftKeyboard
8. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
9. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
10. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
11. make -j EditTextVariations
12. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
13. adb shell am start --user 0 \
-n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
14. Tap the menu icon on the EditTextVariations then click "Direct Reply"
15. adb shell am start --user 10 \
-n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
16. Tap the menu icon on the EditTextVariations then click "Direct Reply"
17. Open notification shade.
18. Tap reply icon on "Message from UserHandle{0}".
19. Make sure that SoftKeyboard Sample IME is shown.
20. Tap reply icon on "Message from UserHandle{10}".
21. Make sure that AOSP Keyboard is shown.
22. Tap reply icon on "Message from UserHandle{0}" again.
23. Make sure that SoftKeyboard Sample IME is shown again.
Test: Manually tested Bug 123043618 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.
Test: Manually tested multi-user scenario with per-profile mode as follows.
1. Build and flash an AOSP build
2. adb root
3. adb shell setprop persist.debug.per_profile_ime 1
4. adb reboot
5. Create a secondary user then switch to it.
6. make -j SoftKeyboard
7. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
8. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
9. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
10. make -j EditTextVariations
11. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
12. adb shell am start \
-n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
13. Tap the menu icon on the EditTextVariations then click "Direct Reply"
14. Tap reply icon on "Message from UserHandle{10}".
15. Make sure that SoftKeyboard Sample IME is shown.
16. Type "ggggg" then hit the space key.
17. Make sure that red underline is drawn under "ggggg"
18. Make sure that AndroidSpellCheckerService runs as user 10.
19. Set up a text screenlock.
20. Turn off the display.
21. Turn on the display.
22. Make sure that SoftKeyboard Sample IME is shown.
Change-Id: Ibabe13e5b85e5bb91f9f8af6ec07c395c25c4393