1800 Commits

Author SHA1 Message Date
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
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
      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
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
Ned Burns
50d11bf08b Merge "Create NotificationListController" 2019-01-17 16:12:25 +00:00
Lucas Dupin
d43bf70c58 Add support to SLPI tap gestures
This CL introduces a new configurable sensor type: config_dozeTapSensorType

Test: atest SystemUITests
Test: set config_dozeTapSensorType to double tap gesture on overlay
Bug: 121198822
Bug: 111414690
Change-Id: I54f3c20473a6d97c860ee02f324edbcf89ba85d1
2019-01-16 11:45:40 -08:00
TreeHugger Robot
b1c41456a5 Merge "Add custom stretch clock face." 2019-01-16 15:33:32 +00:00
Robert Snoeberger
496916b12f Add custom stretch clock face.
Bug: 122301289
Test: Used adb to set secure setting for this clock.
Change-Id: I6a55e991dca47be302de43e5da74671843925427
2019-01-16 09:09:56 -05:00
Xiangyu/Malcolm Chen
d706a9df5e Merge "Don't show signal bar of hidden Cellular subscription." 2019-01-16 01:42:10 +00:00
Dave Mankoff
785d3d27f4 Merge "Fix the library paths of plugins to allow loading native libraries." 2019-01-15 23:06:05 +00:00
Mady Mellor
7c73162d40 Merge "Create BubbleMetadata use it instead of app overlay intent" 2019-01-15 22:24:45 +00:00
TreeHugger Robot
a9f50e954d Merge "Add custom bubble clock face." 2019-01-15 21:51:35 +00:00
Malcolm Chen
d2d400cb4c Don't show signal bar of hidden Cellular subscription.
Bug: 121396526
Test: manual
Change-Id: I646278c9ab4dd2f37083658a25ad38ad4f65d42f
2019-01-15 13:25:42 -08:00
Mady Mellor
c39b4aedb0 Create BubbleMetadata use it instead of app overlay intent
* BubbleMetadata encapsulates necessary info to display a bubble
* Replaces app overlay intent usages with BubbleMetadata
* Renames existing bubble APIs to use 'bubble' rather than 'app overlay'

Bug: 111236845
Test: existing tests pass
Change-Id: I6a85d3c41dda47139fb8d960cadf1c8e109cf29b
2019-01-15 10:28:31 -08:00
Robert Snoeberger
046ee9ceca Add custom bubble clock face.
Bug: 122301289
Test: Using adb to set the settings value switches to bubble clock.
Change-Id: I9b5ab62796204cfdce7b9beb147f34f80b0db167
2019-01-15 13:03:26 -05:00
Dave Mankoff
b938def5e9 Fix the library paths of plugins to allow loading native libraries.
Test: atest
Bug: 111394067
Change-Id: I05db6db5e735f7532f772a59ff57b8ad0595c1a2
2019-01-15 10:45:37 -05:00
Mady Mellor
344731a8aa Merge "Closer to notification model & updates on bubbles" 2019-01-14 17:28:31 +00:00
Mady Mellor
c8238f4ccf Merge "Enable 'real bubbles' and fix our tests" 2019-01-14 17:28:11 +00:00
TreeHugger Robot
cf136dd1ff Merge "Add experiment flag for smart suggestions in heads-up notifications." 2019-01-14 11:42:49 +00:00
Eyal Posener
a9cf9c723f Add blocking helper logging
The added logging events are: blocking helper view displayed or
dismissed, any button click within the view, undo clicks and
system suggests of blocking helper.

* Move some of the getLogMaker logic of server's NotificationRecord
  class to the common StatusBarNotification class.
* Use the StatusBarNotification.getLogMaker to produce blocking helper
  logging.
* Add logging in the NotificationInfo for interaction and display of
  the blocking helper view.
* Add logging in the NotificationBlockingHelperManager for system
  suggests of blocking helper.

Bug: 112482290
Test: unittests and manual - viewed produced logs.
Change-Id: I3a5267d55faba21f6668d35ff8aa12deb0dc5921
2019-01-14 10:58:29 +02:00
Lucas Dupin
7fc9dc16c2 AOD notification icons placement
Whenever there's a custom clock, notification icons should be on the top
left. The default clock will just show the dark shelf.

Test: atest NotificationStackScrollLayoutTest
Test: atest CollapsedStatusBarFragmentTest
Test: visual - with and w/o clock plugin
Test: visual - with and w/o RTL layout
Bug: 122301289
Bug: 111405682
Fixes: 120563185
Change-Id: I4c513d347f656262ee6f91bd208ab9f219e4419c
2019-01-12 04:57:20 +00:00
TreeHugger Robot
f36aa2d7df Merge "Added assistant as an action for possible gestures" 2019-01-12 02:35:16 +00:00
Matthew Ng
0548fbc287 Added assistant as an action for possible gestures
Also matched launcher with the stabilization flag only used for the new
quick step swiped right to left and vice versa.

Bug: 112934365
Test: atest QuickStepControllerTest
Change-Id: Ia6801f96e60c8764448bca6667b93846ef637318
2019-01-11 16:44:49 -08:00
Ned Burns
f36c625574 Create NotificationListController
Move a few things from NotificationEntryManager into it.

This class will (hopefully) eventually replace *NotificationPresenter
as the main "controller" class for the notification shade. This will
allow us to centralize all of our universal controller code into one
place. The controller defer certain method calls to platform-specific
objects (what remains of the NotificationPresenters).

Test: atest
Change-Id: Ic729014f1bef825b635ced86ffb825b5734ad562
2019-01-11 17:06:10 -05:00
Mady Mellor
3f2efdbf5d Closer to notification model & updates on bubbles
* Introduces BadgedImageView / BadgeRenderer for icon & badging
  -> These are both semi-temporary until I move things over to using
     icon library

* Introduces "shouldShowInShade" bit on NotificationData, this is used
  to indicate whether a bubble's notification should display in the
  shade or not
* BubbleController uses NotificationEntryListener to annotate notifs
  bubble state & add / update / remove bubbles
* Cleans up expansion / dismissing / visibility in BubbleController

General notif / dot / bubble behaviour:
* When a bubble is posted, the notification is also in the shade and
  the bubble displays a 'dot' a la notification dots on the launcher
* When the bubble is opened the dot goes away and the notif goes away
* When the notif is dismissed the dot will also go away
* If the bubble is dismissed with unseen notif, we keep the notif in shade

go/bubbles-notifs-manual has more detailed behavior / my manual tests

Bug: 111236845
Test: manual (go/bubbles-notifs-manual) and atest BubbleControllerTests
Change-Id: Ie30f1666f2fc1d094772b0dc352b798279ea72de
2019-01-11 12:53:32 -08:00
Mady Mellor
b4991e60db Enable 'real bubbles' and fix our tests
Previously the test was marking entries as 'isBubble' automatically which
isn't quite correct.

This CL fixes that and has the side effect that enables bubbles for real.
This doesn't auto-bubble any notification, however, if the notification
is on an appropriately noisy channel & has an app overlay intent we will
bubble it.

Bug: 111236845
Test: atest BubbleControllerTest
Change-Id: I26c67ce002eec808591d7864b2366bb4140be386
2019-01-11 12:53:26 -08:00
TreeHugger Robot
529938db4f Merge "remove status bar icon logs" 2019-01-11 19:19:26 +00:00
TreeHugger Robot
791158382b Merge "Initialize dark amount when a new plugin is connected." 2019-01-11 16:26:13 +00:00
Chris Wren
1acdb5e6bb remove status bar icon logs
partial revert of Ife5ce988

Bug: 122451213
Test: runtest systemui
Change-Id: I026217ea8e95ba0805b05e62a5d527c8c3a1d9ce
2019-01-11 10:53:51 -05:00