Commit Graph

4995 Commits

Author SHA1 Message Date
Miranda Kephart
c07f0a910f Move screenshot receivers and add tests
Moves the various broadcast receivers out of GlobalScreenshot and
adds unit tests for them, along with some other changes to make
them more easily testable:
    - ScreenshotSmartActions is now a stateless injectable class,
      instead of a collection of static methods
    - DeleteImageInBackgroundTask removed, in favor of just calling
      a background executor directly
    - remove the TargetChosenReceiver (used to remove notifications
      after a share target is chosen) since we're not using
      notifications anymore

Bug: 160325487
Test: atest SystemUITests, plus manually checked that screenshots
continue to function as expected

Change-Id: I1c054dddd76404f385e59f7ab7317beaafde1106
2020-07-21 16:48:12 -04:00
Lucas Dupin
c8b62b40b6 Merge "Don't turn on prox when wirelessly charging." into rvc-d1-dev am: 7e387342d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12193436

Change-Id: I618fa0be7b4534616b58ea1f79f10c281318018f
2020-07-21 00:48:06 +00:00
Dave Mankoff
6331de5051 Don't turn on prox when wirelessly charging.
Bug: 155373595
Fixes: 161699456
Test: atest SystemUITests && manual
Change-Id: If50ded7ca2836f49b40e71c5fb95c05b87e44213
2020-07-20 20:09:34 -04:00
Kevin Chyn
09ba528a9d Merge changes I9ded8efd,Ic26e47c1 into rvc-qpr-dev
* changes:
  Update authentication when encrypted or lockout
  Check foreground and appOps for BiometricPrompt#authenticate
2020-07-16 18:47:22 +00:00
Kevin Chyn
d24084e95a Update authentication when encrypted or lockout
Fingerprint authentication should not expose accept/reject/lockout
when the user is encrypted or locked out. This is possible with
IBiometricsFingerprint@2.1 since lockout is controlled by the framework.

IBiometricsFace@1.0 does not support this since lockout is controlled
in the HAL (or lower).

Bug: 79776455

Test: On fingerprint device, during encrypted or lockdown, any finger
      works, lockout never occurs
Test: BiometricPromptDemo, normal path is run (e.g. incorrect fingers
      are rejected)
Test: Test no effect on face device
Test: atest KeyguardUpdateMonitorTest

Change-Id: I9ded8efd80d4f8b92ce054262e721853703c6437
Merged-In: I6c9717d1f8ed3e844b3d92727396e2ce2e7fd94f
2020-07-15 21:59:10 -07:00
Hongwei Wang
925a102e10 Animate when removing PiP
Fade out the PiP window when PipTaskOrganizer#removePip is called, which
covers the following scenarios:
- Tap on the close button
- Drag the PiP window to close area
- Disable PiP via settings

Note that when dragging to remove, we spring also the window off screen
and therefore, the fade out animation does not really appealing in that
case.

Video is taken with 10x normal duration.

Video: http://rcll/aaaaaabFQoRHlzixHdtY/gZfSf7SaGKepwiqvXA15dx
Bug: 159805747
Test: see video
Change-Id: Icc26c81711bae69bd00a2812661c00fd93055a92
2020-07-14 16:21:56 -07:00
Ben Murdoch
1622dee606 Merge "Fix crashes in UserDetailViewAdapterTest." into rvc-dev am: 73a4bfc9f8 am: 1086de18d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108112

Change-Id: Icef1e4a4bb5a2e37f76d3c5cc0857432a85ec2b0
2020-07-10 16:34:52 +00:00
Ben Murdoch
1086de18d6 Merge "Fix crashes in UserDetailViewAdapterTest." into rvc-dev am: 73a4bfc9f8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108112

Change-Id: Ifd33521e4a693b491f95d2f4c5b31fb7dccbbc88
2020-07-10 16:25:31 +00:00
Ben Murdoch
8b0ac8fc8e Fix crashes in UserDetailViewAdapterTest.
ag/12048551 exposed some issues running these tests with mocks.

1. Once UserDetailItemView was created from the mocked convertView, it
   returned null from getResources. Fix by calling getResources through
   Context instead.
2. CircleFramedDrawable needs a real bitmap to work. Using a mock ended
   up in a native crash somewhere in libhwui.

Bug: 160794744
Test: atest UserDetailViewAdapterTest
Change-Id: I85a84dbd454ebb1627e4ded21e6708c7fedac11c
2020-07-09 21:02:53 +01:00
Robert Snoeberger
03ed4040ee Migrate from old key when combining device and media data
Fixes: 160256461
Test: manual - Play Spotify. Dismiss app in overview. Open app in
launcher and select a cast device. Start playing again and check media
player in QS. Verify that a cast icon appears in upper right corner.

Change-Id: If830239f8753d35f3c4d9f3a234d00ee4d89a054
2020-07-09 14:56:59 -04:00
Robert Snoeberger
34d53ddf7f Merge "Disable MediaNotificationProcessor" into rvc-qpr-dev 2020-07-08 20:03:49 +00:00
Selim Cinek
af41f0ac48 Merge "Deduplicate resumption controls when notif removed" into rvc-dev am: 997a3c73a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12089063

Change-Id: I5cdf3c8784db9f5a84a40dc67ba41a4b2d734191
2020-07-08 00:51:15 +00:00
Selim Cinek
997a3c73a7 Merge "Deduplicate resumption controls when notif removed" into rvc-dev 2020-07-08 00:36:58 +00:00
Riddle Hsu
7cab6acae9 Merge "Fix boot timeout and reduce boot time" into rvc-dev am: 2d695313c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12085171

Change-Id: If8bc707a1a70dbbea14b36d25f0dc781f3b26a3f
2020-07-07 07:58:38 +00:00
Riddle Hsu
2d695313c9 Merge "Fix boot timeout and reduce boot time" into rvc-dev 2020-07-07 07:26:18 +00:00
Ben Lin
a9914ea6df Merge "Run HOVER_EXIT event only if there's no BUTTON_PRESS event after." into rvc-dev am: e01198edec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12049437

Change-Id: Ia1cf052b7b1b508e3037c781a285cb16f75e2036
2020-07-06 21:39:54 +00:00
Ben Lin
e01198edec Merge "Run HOVER_EXIT event only if there's no BUTTON_PRESS event after." into rvc-dev 2020-07-06 20:45:58 +00:00
Robert Snoeberger
5b13c3108d Deduplicate resumption controls when notif removed
Bug: 160245891
Bug: 160036959
Test: manual - cast from Simple Radio a few times and verify there is
not more than 2 media objects in QS.

Change-Id: Ic2efab1774a79afca84188e42db9db4d44d35403
2020-07-06 20:21:58 +00:00
Antoan Angelov
837bc8abfc Merge "Add support for PO on corp owned device for QS disclosure dialog" into rvc-dev am: 5c201b0360
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12034935

Change-Id: Idc343d7d907025ad9ed710aabb36688e9ca0ee89
2020-07-06 16:28:31 +00:00
Riddle Hsu
29bfa72754 Fix boot timeout and reduce boot time
Since the notification shade has been separated from status bar
to another window where the keyguard resides. It won't be visible
until KeyguardViewMediator receives system ready.

By making the visibility of notification shade consistent with the
initial state of keyguard when attaching the window, window manager
won't miss to wait for it. That avoids dismissing boot animation
too early. The windows of notification shade and wallpaper can also
be drawn earlier, that reduces the total waiting time of drawn
windows by about 50~100ms on a mid-end device.

The logic of wait-for-visible-not-drawn-window is restored to be
the same as Q. The isVisible considers the independent visibility
of wallpaper and visibility of the insets client. The isDrawnLw
accepts READY_TO_SHOW so even keyguard decides not to use wallpaper,
the procedure won't wait until timeout.

Bug: 160271169
Bug: 158144185
Bug: 157746100
Bug: 157281833
Test: atest DisplayContentTests# \
      testShouldWaitForSystemDecorWindowsOnBoot_OnDefaultDisplay
      NotificationShadeWindowControllerTest#attach_visibleWithWallpaper
Test: Boot with enable/disable keyguard/wallpaper, there is no timeout
      and black screen or flickering.

Change-Id: I2f979055e89ae5e40af05e469741bb89e2e24ce6
Merged-In: I2f979055e89ae5e40af05e469741bb89e2e24ce6
2020-07-06 22:11:46 +08:00
arangelov
0dd3aa2738 Add support for PO on corp owned device for QS disclosure dialog
Fixes: 160145930
Test: manual
Test: atest QSSecurityFooterTest
Change-Id: I28fa9a150de16075a2705e5996bcdc2d40dbb555
2020-07-03 17:11:49 +01:00
Ben Lin
b088dbba9e Run HOVER_EXIT event only if there's no BUTTON_PRESS event after.
When a mouse click happens, a HOVER_EXIT prceeds a BUTTON_PRESS
MotionEvent. This ends up causing the menu to fade away. We will check
for whether there's a BUTTON_PRESS event immediately afterward, and only
run hideMenu() after a certain timeout.

Bug: 160245414
Test: Clicking on items on the PIP menu works again
Change-Id: If06e9b51d2fa47735472f48314a9d5b4b146157b
2020-07-01 14:56:38 -07:00
Robert Snoeberger
857bc685c9 Disable MediaNotificationProcessor
Disabling MediaNotificationProcessor when the new media experience is
enabled. The notification views that are inflated won't be shown anyway
so it is just a waste of time and memory.

Fixes: 157732475
Test: manual - heap_profile systemui while SoundCloud is playing. Verify
that flame graph doesn't show a hotspot for MediaNotificationProcessor.processNotification

Change-Id: I252697255ce2b30c99d244acd4e30cd56eb0416d
2020-07-01 15:22:19 -04:00
Beth Thibodeau
0bf4463e8b Merge "Add device info for filtered players" into rvc-dev am: 3c336c4b64
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12052991

Change-Id: Ib48fa3824a96ec96fca80e0f2d0edc47f373438e
2020-07-01 18:29:19 +00:00
Beth Thibodeau
3c336c4b64 Merge "Add device info for filtered players" into rvc-dev 2020-07-01 18:21:47 +00:00
Mady Mellor
8c7fa9de80 Merge "Make sure PendingIntent cancel listener is unregistered" into rvc-dev am: 0e3d9d31a2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12037679

Change-Id: I8252074649fbdbe1f7cb1ac0b611b82807a87b01
2020-07-01 16:36:19 +00:00
Mady Mellor
0e3d9d31a2 Merge "Make sure PendingIntent cancel listener is unregistered" into rvc-dev 2020-07-01 16:09:29 +00:00
Beth Thibodeau
b421a49c01 Add device info for filtered players
Following up on ag/12037671 - MediaDataFilter uses getData when the user
changes, to get a list of all their previous media controls, so we need to put
the device data back too

Test: atest MediaDataCombineLatestTest
Test: manual, switch users and see output chip has device info
Bug: 12037671
Change-Id: I28e2d15919978e84e3205d2ddccb5024e4010247
2020-07-01 11:50:08 -04:00
Beth Thibodeau
b2f71ffe1a Merge "Filter media controls by user" into rvc-dev am: c781b2e4b0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12037671

Change-Id: Ieb29b4fb3b89f62e07c30c7a9e6bf981f424b9b4
2020-07-01 04:18:08 +00:00
Beth Thibodeau
c781b2e4b0 Merge "Filter media controls by user" into rvc-dev 2020-07-01 04:05:38 +00:00
Lucas Dupin
40f1fc932c Merge "Avoid reentrant callback when setting up listeners" into rvc-dev am: 118966e45c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12039762

Change-Id: I1c8a46fab70d6d91f7a8cd398be39fa2ae375dbb
2020-07-01 01:18:09 +00:00
Lucas Dupin
118966e45c Merge "Avoid reentrant callback when setting up listeners" into rvc-dev 2020-07-01 01:02:14 +00:00
Beth Thibodeau
f285b1483d Filter media controls by user
Adds a new step MediaDataFilter in the pipeline, after MediaDataCombineLatest,
which will only pass on media control loaded / removed events if they are for
the current user

If the user is switched, removes all existing controls for the old user and
then adds back any old controls for the new user

Fixes: 159958740
Test: atest com.android.systemui.media
Test: manual, switch users and observe controls updated correctly
Change-Id: Ia07180432df1ce031c42a6225d52160f83ef677e
2020-06-30 19:21:06 -04:00
Mady Mellor
266afba3a9 Make sure PendingIntent cancel listener is unregistered
Test: manual
Fixes: 160177818
Fixes: 149918957
Change-Id: I429fc3bcd409cf57276617bd8c9aab26194d3af9
2020-06-30 16:11:38 -07:00
Lucas Dupin
fb4c7ebaa9 Avoid reentrant callback when setting up listeners
When registering new media players for timeouts, we should schedule
their timeouts but not trigger the listeners yet. Otherwise we would
end up on states where listeners would be ask to update players that
were not initialized yet.

One exception is when a playing is migrating from "resumable" to active.
We'll then delay the state to the next Looper loop.

Test: atest MediaTimeoutListenerTest
Test: manually expire players
Bug: 160036959
Change-Id: I9302dee6190e08c0e845b6f28dfcc249b636d90d
2020-06-30 15:40:28 -07:00
Winson Chung
4ea00b38bf Merge "Revert "Revert "Restore support for source hint rect""" into rvc-dev am: e5e4c105c2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11819193

Change-Id: I31fd2ca02dcb733220670ea9392e2d6bf70469e8
2020-06-30 07:43:23 +00:00
Winson Chung
e5e4c105c2 Merge "Revert "Revert "Restore support for source hint rect""" into rvc-dev 2020-06-30 07:28:56 +00:00
Winson Chung
3b4d856cf7 Revert "Revert "Restore support for source hint rect""
This reverts commit d7302549d6.

Reason for revert: Adding separate workaround for this change

Bug: 156669445
Change-Id: I3ccc857bf6ecf5509e5594ff913d3c575fcb5ad7
2020-06-30 03:36:56 +00:00
TreeHugger Robot
d0f09fc39f Merge "Ignore nonsensical clears from NoMan" into rvc-dev am: 191d081ba8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12004855

Change-Id: If504bf7fdfadb14493e8a1dd60442e839540da1f
2020-06-29 17:14:30 +00:00
TreeHugger Robot
191d081ba8 Merge "Ignore nonsensical clears from NoMan" into rvc-dev 2020-06-29 17:00:53 +00:00
Ned Burns
fea3693771 Ignore nonsensical clears from NoMan
It appears that NoMan sometimes fails to send onNotificationPosted
events for some notifications (possibly due to the notification limit?).
It's possible to still receive onNotificationRemoved events for those
notifications, so we ignore those events for now (long-term we should
figure out if this is indeed a problem in NoMan).

Bug: 159652654
Test: atest
Change-Id: Ib15320f537e31a675d2766ba458b7bd019764c73
2020-06-27 03:52:24 -04:00
TreeHugger Robot
20a8e80cca Merge "Update visibility when attached" into rvc-dev am: 1262dc842f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12010097

Change-Id: I147e61cc57e99b4627240dc3f2501899fa8339df
2020-06-27 05:48:25 +00:00
TreeHugger Robot
1262dc842f Merge "Update visibility when attached" into rvc-dev 2020-06-27 05:32:23 +00:00
TreeHugger Robot
15dce34600 Merge "Don't call setKeyguardGoingAway on background thread" into rvc-dev am: 0bea141717
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12013463

Change-Id: I665f1ba3659430eaf738db7779b238792f9e605e
2020-06-27 01:54:43 +00:00
TreeHugger Robot
0bea141717 Merge "Don't call setKeyguardGoingAway on background thread" into rvc-dev 2020-06-27 01:36:35 +00:00
Beth Thibodeau
f54131ffeb Update visibility when attached
updateVisibility would normally be called during init, but a display or
font size change will have the same visibility before and after, so it
was being skipped. Instead let's just call it explicitly when the view
is attached

Fixes: 159646762
Test: atest KeyguardMediaControllerTest
Test: manual, change font size and observe no gap
Change-Id: Idad51d804c3e08ff673bea61924214a7ff6c0ccd
2020-06-26 19:12:57 -04:00
TreeHugger Robot
4c139797af Merge "Fix component in ControlsRequestDialog" into rvc-dev am: 12927d9214
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12004851

Change-Id: I4887644083800af055db95ce9bd93f2975e89d5d
2020-06-26 22:21:33 +00:00
TreeHugger Robot
12927d9214 Merge "Fix component in ControlsRequestDialog" into rvc-dev 2020-06-26 22:07:14 +00:00
Curtis Belmonte
beee863366 Don't call setKeyguardGoingAway on background thread
Ensures that KeyguardUpdateMonitor#setKeyguardGoingAway(boolean) is
never called on a background thread by dispatching a message to be
handled by KeyguardUpdateMonitor on the main thread.

Test: Manually on Pixel 4 XL
Test: atest com.android.systemui.keyguard

Fixes: 159778563
Change-Id: I48512c0dffba6082f62e70d169f1374c36eead8b
2020-06-26 14:46:57 -07:00
Fabian Kozynski
98c17a6c13 Merge "Initialize values from sticy ACTION_BATTERY_CHANGED" into rvc-dev am: 8debfa8357
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12001036

Change-Id: I30f90293821f6cac71a82b523d1ef41068bcbf6e
2020-06-26 20:06:03 +00:00