In a previous refactor, the notification would not be removed as soon
as possible anymore when its lifetime was extended, leading to issues
where a notification would never time out and therefore never be removed.
Additionally would we also extend the lifetime while the panel is
expanded, which is wrong.
Change-Id: If51ae9ab77ad4eb10166c71db3b902c6ac32fd06
Fixes: 122885133
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/AlertingNotificationManagerTest.java
We here add an experiment flag to limit the number of smart actions
shown per notification (including turning all small actions off) from
the System UI.
Bug: 122506860
Test: atest SystemUITests
Test: call "adb shell settings put global
smart_replies_in_notifications_flags enabled=true,max_num_actions=X" for
different values of X and ensure the behaviour is correct.
Change-Id: I2759f4bc297386d20f3a6d1cb2975165e5c87c38
When logging that a smart reply was sent, now also log where the
notification (containing the reply) is shown, and whether the smart
reply was generated by the assistant (or provided by the application
itself).
Bug: 120767764
Test: click smart reply from notification shade and from heads-up to
ensure correct location is logged.
Test: click smart reply with system-generated replies vs. app-generated
replies to ensure we log generatedByAsssistant correctly.
Change-Id: I43e1f5a07732d578d7890a6f059432c6d6e5038c
Remove MetricsEvent.NOTIFICATION_ITEM from log category,
and use the NOTIFICATION_BLOCKING_HELPER constant as the log
category.
Bug: 112482290
Test: atest SystemUITests and manual testing.
Change-Id: I8a119f625c81df2bbdd30fc9f3e4d3a2ad478ac2
Alter tests to ignore the flags so they don't fail.
Test: manual - make sure no bubbles show up
atest BubbleControllerTest
Bug: 111236845
Change-Id: Ieed38165a3699415686ef299cd54da69d7a37cea
The rows now direct to Permission Hub information for that app.
Test: manual
Test: previous Unit tests passing
Change-Id: I09e1205ee2340f5095c9c59414ddd9db440915b7
Fixes: 123415277
When the notification is updated(reinflated), we should report the
expansion is visibly expanded again even it the notification of
the same key was already reported.
Test: atest ExpansionStateLoggerTest.java
Test: Manual. Send a message to myself. Observe
onNotificationExpansionChange is called. Send another message to update
the notification and go to see the notification. Observe that
onNotificationExpansionChange is called again.
Change-Id: Ie1f245c3954eafade0d81794b4722de6dfbec9dc
Will test locally to try to reproduce the issue and fix the tests, but in the meantime I don't want to be blocking presubmit.
Test: Just adding @Ignore
Change-Id: Ic00e9b8f47be5ff5cc4d20c92bc415ee5adafba2
See go/bubble-stack-design for a high level overview of these changes. This is a large CL, but required in order to allow continued development and team testing without breaking functionality over the course of multiple CL submissions.
To integrate the new animations, the following changes have been made to existing code:
* (BubbleStackView) The bubble container (and thus, the stack view) are MATCH_PARENT to allow the bubbles to independently translate anywhere on the screen.
* (BubbleStackView) Start position is set by the stack controller, not BubbleStackView.
* (BubbleStackView) Expand positon is set by the expansion controller, not BubbleStackView.
* (BubbleStackView/BubbleTouchHandler) Added the methods onDragStart/onDragged/onDragFinish, and onBubbleDragStart/onBubbleDragged/onBubbleDragFinish, for cleaner dispatch of touch events to the appropriate animation controller.
* (BubbleStackView/BubbleController) The stack view's getBoundsOnScreen returns the first bubble's bounds, if the stack is not expanded.
* (BubbleStackView) applyCurrentState no longer manages translation of bubbles, or the expanded view, these are controlled by animation.
* (BubbleMovementHelper) Deleted, no longer needed.
* (Everywhere) Changed uses of Point to PointF, since translation values are floats anyway.
Known issues to be fixed in subsequent, far smaller CLs:
* (b/123022862) Bubble dragging out/dismissing is not animated, and the bubbles can be deposited anywhere. Tap outside the stack to collapse them back to normal.
* (b/123023502) New bubbles added while the stack is expanded are not positioned properly.
* (b/123022982) Expanded view arrow is sometimes in the wrong position.
* (b/123023410) If the stack is expanded while animating, it collapses to its original position even if not along the edge of the screen.
* (b/123023904) The expanded view doesn't animate out, it disappears instantly.
* (b/123026584) Bounds in landscape are a bit wonky.
Bug: 111236845
Test: atest SystemUITests
Test: physics-animation-testing.md
Change-Id: Icaca09e5db89c635c9bb7ca82d7d2714362e344e
This makes sure that PIC is a Singleton and prevents memory leak.
Bug: 121388507
Test: atest PrivacyItemControllerTest
Change-Id: Ib5c2a8790157034e1937c8037650ac047478d005
This change modifies NotificationInfo such that the choice to display
"alert" vs. "keep alerting" and "silence" vs. "stay silent" buttons is
based on the same criteria used to determine whether the notification is
in the "high priority" or "low priority" section of the shade. In
particular this affects notifications whose channel is marked as high
priority but which are displayed as low priority due to demotion by an
assistant service adjustment. NotificationMenuRow is also modified to
use the same logic for which icon to use for the button that launches
the NotificationInfo UI.
Change-Id: Id7534ca5133e51d636e41baba9404108ee216467
Fixes: 121334699
Test: atest SystemUITests, manual
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
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
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
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
401e3d4c84
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
is visible to users.
For example, if the notification is expanded in the background,
onNotificationExpansionChanged will be called only when the expanded
notification is visible to users.
Reason: we should only care about expansion change that is visible
to users, and at the moment that it is shown to user.
This also allows us to determine "has been visually expanded"
easily. With this change, our NotificationAssistantService can know
whether a notification has been visually expanded and calculate the CTR
of smart actions accordingly.
This should not break existing stuff in NMS.onNotificationExpansionChanged
because codes there checked isUserAction == True anyway,
which means the change must be also visible to users.
BUG: 120803809
Test: atest ExtServicesUnitTest
Test: atest ExpansionStateLoggerTest
Test: Manual test, try to expand and collapse notification.
Change-Id: Ibc6f939b2560b845de6a8a35b4557423b8a074f7
I meant to bubble anything with valid bubble metadata intent but in
ag/6004126 however I missed a spot.
Crash was just wrong layout casting; the code is a little awkward
but I'm planning on refactoring it in future CL so it'll be better
just want to not crash sooner :)
Test: atest BubbleControllerTest
Bug: 123077807
Change-Id: I6d85d24cd7fc54db062a71404d64b719f2f35009
Test: wake up with power
Test: look at shelf on lock screen
Test: lock device w/ notifications from home screen
Test: receive notification on AOD
Test: atest KeyguardClockPositionAlgorithmTest
Test: atest NotificationRoundnessManagerTest
Test: atest ScrimControllerTest
Test: atest NotificationContentViewTest
Bug: 111405682
Change-Id: I9b4f2febd56a62256124567bffebc9f5f8255847
New scrim opacity - 20% - and also keeping the pulse state bright,
so it's more similar to lock screen.
Bug: 111405682
Test: visual
Test: atest ScrimControllerTest
Change-Id: Iecf86f5eeb5fcab9ada198e97f7da2f4e362e22f
OnMenuEventListener logs, so that we get the information on which
notification the user interacted with.
Bug: 121380248
Test: atest SystemUITests:com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutTest and manual testing
Change-Id: I914557250bed517d2e84fdc5ea3262ab0b062d5d