Commit Graph

1825 Commits

Author SHA1 Message Date
TreeHugger Robot
1931fa5033 Merge "Fixes an issue where users could be stuck with heads up notifications" 2019-01-30 00:21:20 +00:00
TreeHugger Robot
e2c6ce4b0b Merge "Log notification location and assistant-generated when smart reply sent" 2019-01-29 22:46:44 +00:00
TreeHugger Robot
3a0a5e9e9a Merge "Protect against null channel" 2019-01-29 21:48:51 +00:00
TreeHugger Robot
8a5c213cf7 Merge "Add experiment flag for maximum number of smart actions per notification" 2019-01-29 21:07:04 +00:00
Mady Mellor
c18ba96b3f Protect against null channel
Add a test with notif with no channel..

Test: atest BubbleControllerTest
Bug: 123540415
Change-Id: I7617d314bff340b58bab199c9e69e084591933c0
2019-01-29 11:42:47 -08:00
Selim Cinek
bd5590968f Fixes an issue where users could be stuck with heads up notifications
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
2019-01-29 11:31:12 -08:00
Gustav Sennton
4bf5ff5859 Add experiment flag for maximum number of smart actions per notification
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
2019-01-29 16:31:15 +00:00
Gustav Sennton
13edb4977d Log notification location and assistant-generated when smart reply sent
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
2019-01-29 15:23:49 +00:00
Eyal Posener
aea29ed39a [Blocking Helper logs] Modify blocking helper to category
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
2019-01-29 09:17:13 -05:00
Mady Mellor
9bad224fd0 Keep bubbles behind a flag
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
2019-01-28 14:08:15 -08:00
TreeHugger Robot
5887049c6f Merge "Fix expansion change is not reported if the notification is updated" 2019-01-28 18:02:04 +00:00
Fabian Kozynski
0d03da3723 Added tap behavior to rows in OngoingPrivacyDialog
The rows now direct to Permission Hub information for that app.

Test: manual
Test: previous Unit tests passing
Change-Id: I09e1205ee2340f5095c9c59414ddd9db440915b7
Fixes: 123415277
2019-01-28 10:48:26 -05:00
Tony Mak
96b3f1bde4 Fix expansion change is not reported if the notification is updated
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
2019-01-28 15:02:07 +00:00
Charles Chen
3dedec3272 Notify SystemUI when ActivityDisplay is ready
Bug: 120748674
Test: atest ActivityManagerMultiDisplayTests#testNavBarNotShowingOnDisplayWithoutDecor * 100
Test: atest ActivityManagerMultiDisplayTests#testNavBarShowingOnDisplayWithDecor * 100
Test: atest ActivityManagerMultiDisplayTests#testNavBarNotShowingOnPrivateDisplay * 100
Test: atest SystemUITests
Change-Id: I302a35b9b860ab881b60c6407edabb2da16b75f8
2019-01-28 14:39:34 +08:00
Joshua Tsuji
87ebd7460c Ignore two tests that sporadically fail due to DynamicAnimation quirks.
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
2019-01-25 16:02:06 -05:00
Josh Tsuji
3e6de26e7a Merge "Adds DynamicAnimation-based movement to the bubbles." 2019-01-25 16:04:51 +00:00
TreeHugger Robot
1d4c240ae6 Merge "Always show battery percentage on AOD" 2019-01-25 05:19:33 +00:00
Lucas Dupin
c97d88f90f Always show battery percentage on AOD
Fixes: 123362085
Test: visual
Change-Id: Ib94efbb9b84bad75ba0a485fff827acb397a8b5f
2019-01-24 19:06:47 -08:00
Joshua Tsuji
b1a796b155 Adds DynamicAnimation-based movement to the bubbles.
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
2019-01-24 19:23:17 -05:00
TreeHugger Robot
7e5d596e89 Merge "Convert PrivacyItemController to Dependency" 2019-01-24 23:47:33 +00:00
TreeHugger Robot
77bf8692e6 Merge "Fixes NotificationInfo for demoted notifications." 2019-01-24 21:26:44 +00:00
Fabian Kozynski
04f83eb5f0 Convert PrivacyItemController to Dependency
This makes sure that PIC is a Singleton and prevents memory leak.

Bug: 121388507
Test: atest PrivacyItemControllerTest

Change-Id: Ib5c2a8790157034e1937c8037650ac047478d005
2019-01-24 16:24:40 -05:00
Gus Prevas
caed15cd8b Fixes NotificationInfo for demoted notifications.
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
2019-01-24 14:18:30 -05:00
Christine Franks
79ea8c34a1 Merge "Move Night Display methods to ColorDisplayManager" 2019-01-24 17:05:39 +00:00
TreeHugger Robot
b4ef1f88ad Merge "Add notification information to logging for ACTION_NOTE_CONTROLS." 2019-01-24 08:08:31 +00:00
TreeHugger Robot
ee8e1ae2db Add notification information to logging for ACTION_NOTE_CONTROLS.
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
2019-01-23 16:50:24 -05:00
Christine Franks
83cc5410a8 Move Night Display methods to ColorDisplayManager
Bug: 111215474
Test: atest FrameworksServicesTest:ColorDisplayServiceTest
Change-Id: Idb16af8dfa1c65bb638b2537e4a162b624069430
2019-01-23 13:43:27 -08:00
Gustav Sennton
c7d0d32b62 Log smart suggestions becoming visible in HUNs.
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
2019-01-23 19:07:48 +00:00
TreeHugger Robot
1655f9896f Merge "Fix image wallpaper distortion after rotate." 2019-01-23 02:01:16 +00:00
TreeHugger Robot
f749198d19 Merge "Add exp flag for min number of sys gen smart replies in notifications" 2019-01-22 22:36:37 +00:00
TreeHugger Robot
073291142a Merge "Do not crash NearestTouchFrame when views are not attached to window" 2019-01-22 21:14:19 +00:00
Lucas Dupin
a47310fde0 Merge "Fix StatusBarWindowController initialization NPE" 2019-01-22 20:34:12 +00:00
TreeHugger Robot
cc249beb0d Merge "Add notification location to onNotificationExpansionChanged." 2019-01-22 19:15:01 +00:00
Mady Mellor
9c79041cc6 Merge "Fix layout crash & bubble anything with valid bubble metadata intent" 2019-01-22 18:44:38 +00:00
TreeHugger Robot
a0602f3eba Merge "Move plugin and settings logic out of KeyguardClockSwitch." 2019-01-22 18:21:01 +00:00
Lucas Dupin
42ebe5486f Fix StatusBarWindowController initialization NPE
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
2019-01-22 09:49:03 -08:00
Gustav Sennton
a8e38aa5d0 Add notification location to onNotificationExpansionChanged.
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
2019-01-22 17:12:22 +00:00
Lucas Dupin
a54251feab Merge "Do double tap detection to wake up device while docked." 2019-01-22 17:04:27 +00:00
Robert Snoeberger
15b4af1943 Move plugin and settings logic out of KeyguardClockSwitch.
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
2019-01-22 11:32:40 -05:00
lpeter
8a5f470c01 Do double tap detection to wake up device while docked.
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
2019-01-22 20:27:57 +08:00
wilsonshih
3b2683a668 Fix image wallpaper distortion after rotate.
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
2019-01-22 12:03:25 +08:00
Gustav Sennton
a31f6aede1 Add exp flag for min number of sys gen smart replies in notifications
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
2019-01-21 15:03:26 +00:00
TreeHugger Robot
96583d40d1 Merge "onNotificationExpansionChanged is called only when the expansion change... is visible to users." 2019-01-21 12:07:26 +00:00
Yohei Yukawa
7276946b92 Use setTextOperationUser() in KeyguardPasswordView and RemoteInputView
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
2019-01-20 09:28:08 -08:00
Tony Mak
202f25d62a onNotificationExpansionChanged is called only when the expansion change...
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
2019-01-20 09:39:01 +00:00
Mady Mellor
edd4ee1e82 Fix layout crash & bubble anything with valid bubble metadata intent
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
2019-01-18 14:48:40 -08:00
Lucas Dupin
00be88f1fd New pulsing notification layout
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
2019-01-18 13:57:04 -08:00
Lucas Dupin
3d36dd83a9 Light scrim on pulsing state
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
2019-01-18 12:30:06 -08:00
Matthew Ng
8181876d88 Do not crash NearestTouchFrame when views are not attached to window
Change-Id: I6f4d086dc6aabee1d519794e86dbe5c0df8b6bfc
Fixes: 121212324
Test: atest NearestTouchFrameTest
2019-01-18 12:07:58 -08:00
Will Brockman
e718d5891e Use full Notification LogMaker in NotificationStackScrollLayout
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
2019-01-17 16:38:38 -05:00