Commit Graph

1417 Commits

Author SHA1 Message Date
TreeHugger Robot
500420ce55 Merge "Fixes tapping home button on right edge with quickstep layout" 2018-09-18 23:49:32 +00:00
TreeHugger Robot
4648bd2527 Merge "Fix broken NSSL tests" 2018-09-18 22:44:27 +00:00
Matthew Ng
a099cc8bb1 Fixes tapping home button on right edge with quickstep layout
Reverted ag/4731597 since it was causing issue and instead hides the
menu container when none of its children are visible.

Change-Id: Ie48ef32f8a66392796cb0330faed6dff499bc1b1
Fixes: 114099654
Test: tap around the right edge
2018-09-18 14:54:07 -07:00
Evan Laird
fec7766594 Fix broken NSSL tests
I don't see a reason why we would constrain mBarState.addListener to
happen only once, because the whole point is that other classes listen
to those changes as well, and will subscribe unless we mock literally
everything.

Change-Id: Id6aed68c48fbc4f94f78fcd38b9fe0ec83d49c7e
Fixes: 115742174
Test: `atest NotificationStackScrollLayoutTest`
2018-09-18 17:28:08 -04:00
Lucas Dupin
fdbfc545d4 Defer theme flags when view isn't attached
Change-Id: Ie042da18b8c84d9067bb4d951f9dd35fe4ea9d19
Fixes: 113530582
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java
2018-09-17 16:06:16 -07:00
Lucas Dupin
7c6ca76793 Allow protected broadcasts in tests
SysUI must send protected broadcasts to avoid system impersonation.
Our tests should also allow these types of broadcasts, otherwise
they will be dropped/skipped on -user builds and functionality
will be broken.

This CL also protects the flashlight broadcast.

Fixes: 110825884
Test: atest com.android.systemui.qs.external.TileServicesTest
Change-Id: I5a3dfc569c1695366e5f0e48cda8a7a32e287e7d
2018-09-14 17:18:54 +00:00
Kevin Han
d4092c1897 Merge "Add NotificationGroupManagerTest" 2018-09-14 01:16:36 +00:00
Kevin
96eed64a09 Add NotificationGroupManagerTest
Add some unit tests for NotificationGroupManager testing some basic
functionality and also some of the complex heads up logic.

Bug: 79705024
Test: runtest systemui

Change-Id: I73f01827063d2704a4e1b1d18d479d4e9375447e
2018-09-11 15:49:27 -07:00
Ying Zheng
4fd6b783e3 Migrate sysUI and carSysUI to the separated car user lib.
Bug: 113868873
Test: build
Change-Id: I48fb69aab7092d256c6839377c905340f9059165
2018-09-11 13:51:49 -07:00
Kevin
e9e938c945 Rename setShouldExtendLifetime in LifetimeExtender
Rename NotificationLifetimeExtender.setShouldExtendLifetime to
setShouldManageLifetime.  This is more clear in what the logic actually
is and reads better.

Test: runtest systemui
Change-Id: Ic5792322ef0a557812d58f07285acee32cce0c1a
2018-09-06 13:52:39 -07:00
Lucas Dupin
90a38dd7f7 Removed shade drawing optimization
Why?
- This optimization has caused many glitches, it easy to break and
  we've done so a few times (technical debt.)
- It's unclear if not calling glClear() is still an optimization.
  Most graphics cards actually expect a glClear and are optimized
  to discard old frame buffers when the method is invoked

Change-Id: If1bb9b8bf4c907ca907dc1205ad05dabfefeba1b
Fixes: 113286511
Test: manual
Test: shalac@ is keeping an eye on the performance dashboard
2018-09-05 09:37:37 -07:00
Amin Shaikh
32d786fb73 Do not animate QS state changes when not in view.
Skip QS state change animations when the target view is not fully
visible on screen.

Some tiles require extra time before the status is fully changed and
therefore will be animated later.

Change-Id: I08e76e0fdeab2b260cb7a41a117a6ff484ca3329
Fixes: 111680760
Test: visual and runtest systemui
2018-09-04 21:48:10 -04:00
TreeHugger Robot
efc032f61e Merge "Refactor managers that defer notification removal" 2018-09-04 23:46:58 +00:00
Kevin
a5ff1fafb3 Refactor managers that defer notification removal
This CL introduces NotificationLifetimeExtender, an interface for the
various notification managers to implement to say that a notification
should stay around even after being removed.  This provides greater
consistency/standardization as opposed to having the same
implementation done differently and scattered throughout different
classes.

Also implements small refactors to try to reduce coupling where possible
(in particular reduce references to NotificationEntryManager) and move
logic to more appropriate locations (in particular move a lot of remote
input logic from NotificationEntryManager to
NotificationRemoteInputManager.)

Test: manual (see below); runtest systemui
* heads up + cancel
* guts active + cancel
* ambient pulse + cancel (UI here is janky even on master)
* have a remote input active + cancel
* have remote history, send, see that the notification stays
Change-Id: I24d345a1f2d8751827e367d1432918b3db7fa5f3
2018-08-31 15:17:28 -07:00
Valentin Iftime
6239e53794 Resize image wallpaper surface to match bitmap size in order to optimize memory
(on AndroidTV there is no need for wallpaper and RAM is wasted)

Bug: 74517029
Test: Push a low resolution wallpaper to the device (adb push new_wallpaper /data/system/users/0/wallpaper),
reboot and check the buffer size for com.android.systemui.ImageWallpaper (adb shell dumpsys SurfaceFlinger)

Change-Id: I992175997ed09360e8fc9c2cabf354fb4fabd1f9
2018-08-31 14:36:33 +02:00
Jason Monk
ae7ced2f95 First kotlin
Convert one class to kotlin and provide a slight amount of guidance.

Test: existing tests
Change-Id: Ie8659765b674ac7b2d82ed3d343f387195c07d83
2018-08-23 12:49:08 -04:00
Jason Monk
e59dc4040a Remove stack scroller references from StatusBar
Try to move as much logic up over into stack scroller as possible.

Things that can't move, funnel through NotificationPanel to make the
interface between StatusBar and NotificationPanel more explicit.

Test: Existing tests

Change-Id: I5fa36a9d5d0a8c7f76b9d1843c0733a5758b5838
2018-08-22 20:42:53 -04:00
Jason Monk
1fd3fc3e64 Refactor StatusBarState out of StatusBar
Test: tests gonna test
Change-Id: Id8d8eb5124e542eac9f3b785a7011a22e758e20b
2018-08-22 12:32:30 -04:00
Jorim Jaggi
af7a8f48b2 Merge "ScreenDecorations: Update corner radius when configuration changes" into pi-dev am: 2c9fd5fbbb
am: 1f90c98891

Change-Id: I5304f627f5fe4577ee4b68317bb94b2b1ac645a4
2018-08-21 18:42:13 -07:00
Lucas Dupin
c892e59dcd Merge changes Ib6e4bbd4,I22f9b929
* changes:
  Hide system overlays on AOD
  Rename StatusBarWindowManager to  StatusBarWindowController
2018-08-21 22:52:52 +00:00
Lucas Dupin
a3e3627375 Hide system overlays on AOD
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java
Change-Id: Ib6e4bbd4652f8c01460884602def97eb65ad4e98
Fixes: 110990354
2018-08-21 13:22:33 -07:00
Lucas Dupin
1a8588d19f Rename StatusBarWindowManager to StatusBarWindowController
For consistency with the rest of the system since StatusBarWindowManager
isn't neither a system service or part of Window Manager.

Test: sysuitests
Change-Id: I22f9b929cb3e2fb0c68e1960267855f5e56b2a01
2018-08-21 13:20:30 -07:00
Adrian Roos
64c9d90a63 ScreenDecorations: Update corner radius when configuration changes
Bug: 112876936
Test: atest ScreenDecorationsTest
Change-Id: I4359b3da4a47dcf434f018fe3e62e18354d1be47
2018-08-21 16:13:15 -04:00
Fabian Kozynski
aacde1473e Added Lock for mCallbacks and test for Concurrency
mCallbacks in CastControllerImpl is now
thread-locked by a guard of the same name.

The test implemented in CastControllerImplTest fails
in previous builds (bug 79419738) and passes now.
In order to properly test,
CastControllerImpl::fireOnCastDevicesChanged is
now VisibleForTesting.

Change-Id: I4160938b2da1749a4370d902e314deaf445cda1a
Fixes: 79419738
Test: CastControllerImplTest::testConcurrencyOnMCallback
2018-08-21 13:41:56 -04:00
Jovana Knezevic
b13b17d8fb Merge "Modifying test to exclude automotive specific classes if running in non-automotive build." 2018-08-21 00:07:06 +00:00
jovanak
f40566e36e Modifying test to exclude automotive specific classes if running in
non-automotive build.

Without this, test will fail to find car-related dependencies on non-car build
and throw.

Bug: 80150596
Test: Ran the test on phone (non-automotive) and mojave (automotive). Both passed successfully.
Change-Id: I3d3d2639ebebc0474b28d5c9303b83c95820eac4
2018-08-20 14:50:14 -07:00
Fabian Kozynski
86fb5b41af Unit test for CastControllerImp
Added basic Unit test for CastControllerImp testing adding and removing
callbacks and that the system recognizes that there were changes.

Change-Id: I992935bdc2a822d00ac66700c6a0da133036fcc1
Test: systemui test passes
2018-08-20 11:04:07 -04:00
Julia Reynolds
35765d89f3 Hide noti info icon is device isn't provisioned
Change-Id: I7b57a9df517e51e2a106bfd1f501731fd4f00ed7
Fixes: 112063127
Test: atest SystemUITests
2018-08-17 15:43:00 +00:00
Adrian Roos
8045746448 Merge "ScreenDecorations: Fix stuck / delayed rotations (second try)" 2018-08-17 14:29:02 +00:00
Jason Monk
a2f2d82f26 Convert sysui to bp
Test: tests gonna test, builds gonna build
Change-Id: I7f1ef2e82ce2c74253c57de8d73079dcfe2d2264
2018-08-16 19:40:39 -04:00
TreeHugger Robot
7cf5013e3d Merge "Add process-lifecycle-owner-initializer to tests." 2018-08-14 19:52:34 +00:00
Alison Cichowlas
5f5ad2e627 Add process-lifecycle-owner-initializer to tests.
Bug: 112587252
Test: This is to fix the tests.
Change-Id: I083db4e2eb4efd8d4a914f33ac259aa317e568de
2018-08-14 14:23:49 -04:00
TreeHugger Robot
ab91392a60 Merge "Split auto dismissing functionality from heads up" 2018-08-14 18:07:43 +00:00
TreeHugger Robot
81d43788b2 Merge "Allow nearesttouchframe to hit the recents button in 3 button layout" 2018-08-13 18:37:34 +00:00
Kevin
d4f66a486c Split auto dismissing functionality from heads up
Refactor HeadsUpManager so that the auto dismissing alert functionality
is separate and reusable for future use with ambient pulses.  Add tests
for this new class and also a few for HeadsUpMananger specific logic

First in two-part CL to split ambient pulse logic from heads up logic.
Second CL will add an ambient pulse manager which uses the alert logic
introduced here and involve more of the actual split.

Test: runtest systemui, manual
Change-Id: I08069562e7bea4c8e25674aa35237e1bb8cf4475
2018-08-13 11:17:12 -07:00
TreeHugger Robot
6579a71475 Merge "Revert "ScreenDecorations: Fix stuck / delayed rotations"" 2018-08-13 17:40:21 +00:00
Andrew Lehmer
d42decc7af Merge "Double tap and lift should take to lock screen" 2018-08-13 15:54:27 +00:00
Matthew Ng
7e77da4309 Allow nearesttouchframe to hit the recents button in 3 button layout
Menu Ime for 3 button layout cannot be hit because nearesttouchframe is
trying to hit the framelayout of menu_ime that contains nothing inside.
Making it check for non-focused buttons will allow it to hit the recents
button.

Change-Id: Id464e9931345911ffba374a1349536cbf270abdf
Fixes: 112432937
Test: atest NearestTouchFrameTest
2018-08-10 15:43:58 -07:00
Lucas Dupin
4359b559f2 Double tap and lift should take to lock screen
The current ambient display design doesn't make sense when the
display is not 'always on', let's wake-up directly to the lock
screen instead.

Change-Id: I217720dcf01a507f43e9da6e1970b2246fb75211
Test: double tap from AOD or screen off
Test: lift from AOD or screen off
Test: receive pulsing notification, long press
Fixes: 73148491
Fixes: 111881300
Bug: 111414690
2018-08-10 14:05:02 -07:00
Lucas Dupin
60e224519c Merge changes from topic "clock_plugin"
* changes:
  Add clock plugin function
  Add clock plugin interface
2018-08-10 02:18:57 +00:00
Jason Monk
1045e0befe Follow slice API finalization
Test: build
Change-Id: I28d7c23fa23817d1b974f36b74be5512f12ce59c
2018-08-09 16:34:24 -07:00
Adrian Roos
73ab97c449 ScreenDecorations: Fix stuck / delayed rotations
Fixes the issue of stuck or delayed decor overlay rotations. The current logic
cannot handle the case where the overlay has not finished rotating when we start
another rotation.

To work around that, we make sure that the rotation finishes fast enough for that
not to happen, by decoupling it from the rest of SystemUI's traversals on a dedicated
thread.

Also fixes an issue in ScreenDecorations where we restarted drawing even though that
was not needed, which further delayed finishing the rotation of the overlay.

Also fixes an issue in ScreenDecorations where a spurious traversal after rotation
started but before SysUI was notified could draw in the wrong orientation. To prevent
that, we validate that our rotation matches the display rotation and restart the draw
otherwise.

In the future, we should investigate whether we can make this more robust by allowing
stacked rotations, or forbidding rotations while the overlay is not done yet. We should
also make the synchronization between WM and SysUI on what rotation is being drawn more
explict and thus more robust.

Change-Id: I5303a6a8e6392d309c0fe672ff6d1386ae18f235
Merged-In: Id8fe1c7f6b38de8cd3ce5f4170ea37adf8cb9f3d
Bug: 111761727
Test: Ensure you have a lot of notifications, and enable cutout emulation, open camera, quickly rotate phone between landscape and portrait repeatedly, ensure there are no artifacts on screen.
Test: atest ScreenDecorationsTest
2018-08-09 17:55:23 +02:00
Adrian Roos
faa102f723 ScreenDecorations: Fix stuck / delayed rotations (second try)
Fixes the issue of stuck or delayed decor overlay rotations. The current logic
cannot handle the case where the overlay has not finished rotating when we start
another rotation.

To work around that, we make sure that the rotation finishes fast enough for that
not to happen, by decoupling it from the rest of SystemUI's traversals on a dedicated
thread.

Also fixes an issue in ScreenDecorations where we restarted drawing even though that
was not needed, which further delayed finishing the rotation of the overlay.

Also fixes an issue in ScreenDecorations where a spurious traversal after rotation
started but before SysUI was notified could draw in the wrong orientation. To prevent
that, we validate that our rotation matches the display rotation and restart the draw
otherwise.

In the future, we should investigate whether we can make this more robust by allowing
stacked rotations, or forbidding rotations while the overlay is not done yet. We should
also make the synchronization between WM and SysUI on what rotation is being drawn more
explict and thus more robust.

Previously-Merged-As: I5303a6a8e6392d309c0fe672ff6d1386ae18f235
Bug: 111761727
Test: Ensure you have a lot of notifications, and enable cutout emulation, open camera, quickly rotate phone between landscape and portrait repeatedly, ensure there are no artifacts on screen.
Test: atest ScreenDecorationsTest
Change-Id: Id8fe1c7f6b38de8cd3ce5f4170ea37adf8cb9f3d
2018-08-09 17:53:32 +02:00
Adrian Roos
7294064ffa Revert "ScreenDecorations: Fix stuck / delayed rotations"
This reverts commit 61f557adc7
(I5303a6a8e6392d309c0fe672ff6d1386ae18f235)

Reason for revert: Boot time regression
Bug: 111761727
Fixes: 112315721

Change-Id: I6fe577187040ccffdf5644e47eec4a1a97528f09
2018-08-09 15:23:56 +00:00
Kunhung Li
29007e6d69 Add clock plugin function
Use clock plugin interface to replace current TextClock in keyguard

Bug: 111971817
Test: atest SystemUITests
Change-Id: Ib6920844700445d9cd3ffa4159cd7f630eaa853b
2018-08-09 18:12:17 +08:00
Salvador Martinez
c25604ba59 Update severe (5%/1 hour) warning to send through battery saver
Now that battery saver is sticky this notification never shows
and we are getting reports from people that the notification
they were expecting never showed up. It turns out that a lot
of these were due to people not realizing battery saver was on.
To remedy the worst case situation (your phone is about to die
soon but no 15%/3 hour notification came up) we should always
show the severe warning even if battery saver is on. This only
affects the hybrid warning, not the legacy percentage based
version.

Test: unit tests
Bug: 111596093
Change-Id: I92453b68b6ee8aad8f862147c877f4e789afc55c
2018-08-08 16:57:32 +00:00
Bill Lin
ef81cbdec4 Device show "No SIM card" and then showing carrier name during boot
Keyguard default show NO SIM earlier than Telephony/Subscription callback
Refactor CarrierText & KeyguardUpdateMonitor
 - Replace setup flag by resource attr(showMissingSim/showAirplaneMode)
 - Remove setDiplayFlags API, and add mTelephonyCapable flag
 - Implement MSG_TELEPHONY_CAPABLE in KeyguardUpdateMonitor
 - Default do not show AirplaneMode & NO_SIM label unless define in xml

Bug: 109731429
Test: atest SystemUITests
      atest frameworks/base/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
      Manual:
         1) Insert SIM and reboot device, only show "No Service"->"Operator"
	 2) Remove SIM and reboot device, only show "No SIM"
	 3) Enable AirplaneMode reboot, only show "Airplane mode"
	 4) Insert SIM and trigger sysui crash, state same as 1)
	 5) Remove SIM and trigger sysui crash, state same as 2)
	 6) Enable APM trigger sysui crash, state same as 3)
	 7) Enable APM & WFC, turn on wifi in keyguard showing
	    -> "Airplane mode" -> "" -> "WiFi Calling"
	 8) Enable APM & WFC, turn off wifi in keyguard showing
	    -> "Wifi Calling" -> "Airplane mode"

Change-Id: I4459997420484431751a4c088aa3856724affe6a
2018-08-07 00:15:40 +00:00
Winson Chung
ee15105934 Merge "Expose DockedStackListener for logging purposes in Launcher" 2018-08-06 20:52:16 +00:00
Adrian Roos
61f557adc7 ScreenDecorations: Fix stuck / delayed rotations
Fixes the issue of stuck or delayed decor overlay rotations. The current logic
cannot handle the case where the overlay has not finished rotating when we start
another rotation.

To work around that, we make sure that the rotation finishes fast enough for that
not to happen, by decoupling it from the rest of SystemUI's traversals on a dedicated
thread.

Also fixes an issue in ScreenDecorations where we restarted drawing even though that
was not needed, which further delayed finishing the rotation of the overlay.

Also fixes an issue in ScreenDecorations where a spurious traversal after rotation
started but before SysUI was notified could draw in the wrong orientation. To prevent
that, we validate that our rotation matches the display rotation and restart the draw
otherwise.

In the future, we should investigate whether we can make this more robust by allowing
stacked rotations, or forbidding rotations while the overlay is not done yet. We should
also make the synchronization between WM and SysUI on what rotation is being drawn more
explict and thus more robust.

Change-Id: I5303a6a8e6392d309c0fe672ff6d1386ae18f235
Merged-In: I5303a6a8e6392d309c0fe672ff6d1386ae18f235
Bug: 111761727
Test: Ensure you have a lot of notifications, and enable cutout emulation, open camera, quickly rotate phone between landscape and portrait repeatedly, ensure there are no artifacts on screen.
Test: atest ScreenDecorationsTest
2018-08-06 18:00:32 +00:00
Winson Chung
6b0f1a3d77 Expose DockedStackListener for logging purposes in Launcher
Bug: 111077107
Test: Implement listener in Launcher and verify the callbacks are made

Change-Id: I4017c8e139242c2b0875f8222c99396d55b1be04
Signed-off-by: Winson Chung <winsonc@google.com>
2018-08-03 15:19:36 -07:00