Commit Graph

1293 Commits

Author SHA1 Message Date
felkachang
252efd708a Fix the icon overlay after density change
After showing the heads up for the fullscreen notification, to
change the density by user will have the status bar icons
not show normally. It will the only one icon overlay on the
clock but actually there are more than one icons. And, it can't
back to normal after expandable notification and collapse the
notification panel.

The root cause is that all of instances of PhoneStatusBarView,
Clock, HeadsUpStatusBarView, and HeadsUpAppearanceController are
recreated by FragmentManager after configuration density and
font changing. The new HeadsUpAppearanceController status is
neither consistent with HeadsUpManager's status nor the state of
the previous instances.

The solution is that to apply the onSaveInstanceState and
onRestoreInstanceState in PhoneStatusBarView, Clock, PanelBar, and
HeadsUpStatusBarView. To make sure that the values of the fields
in the new instance, which are set by other source, have the
consistence with the state of the old instances.

HeadsUpAppearanceController's Constructor.
To hook onLayoutChangedListener to sync the status with
HeadsUpManager's status to HeadsUpStatusBarView if there is a
pinnded heads up notification.

In original, PanelBar.mState is the only one state to save. Instead
of only saving one, to save the view tree state in
CollapsedStatusBarFragment.onSaveInstanceState and restore the view
state in CollapsedStatusBarFragment.onViewCreated.
CollapsedStatusBarFragment.mDisabled1 doesn't need to save and
restore because CommandQueue.recomputeDisableFlags will give it
the correct value.

After density changed, RemoteViews will reinflate the instances of
NotificationHeaderView and the wrapper instances of
NoticationContentView will also recreated in
NotificationContentView.setAmbientChild. The recreated instance
should synchronized with the ExpandableNotificationRow intance.

Bug: 80224819
Fixes: 111996469
Fixes: 117818441
Test: atest SystemUITests
Change-Id: Ia3f8a0f138f403c8e0c74c00d56bd93baf604d3a
Merged-In: Ia3f8a0f138f403c8e0c74c00d56bd93baf604d3a
2018-11-08 04:19:36 +00:00
Bill Lin
2f97046a4e Merge "Device show "No SIM card" and then showing carrier name during boot" into pi-dev 2018-10-24 09:35:33 +00:00
Bill Lin
6c7ccabd1d 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: 111732320
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
Merged-In: I4459997420484431751a4c088aa3856724affe6a
2018-10-17 19:29:12 +00:00
Gus Prevas
f4f0b069a3 Checks keyguard earlier when blocking notifications.
This change modifies NotificationInfo to call the provided keyguard
callback when the "Stop notifications" button is tapped, rather than
when trying to save the new importance value after the undo timeout.

Test: updated test cases in NotificationInfoTest.
Bug: 111416533
Change-Id: I89b4715d0d41be4587753f554862e51c4e1d43c3
Merged-In: I89b4715d0d41be4587753f554862e51c4e1d43c3
(cherry picked from commit 533836ac72)
2018-10-17 14:22:03 +00:00
TreeHugger Robot
3d91fa44b7 Merge "Update severe (5%/1 hour) warning to send through battery saver" into pi-dev 2018-08-22 14:52:42 +00:00
Salvador Martinez
c50a9bd24d 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
Merged-In: I92453b68b6ee8aad8f862147c877f4e789afc55c
2018-08-22 14:00:24 +00: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
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
Salvador Martinez
926f071688 Only query for estimate on battery level change
SysUI is querying for an estimate too much, this change gates
it on being the first estimate or the battery level having
changed so that we don't waste system resources.

Test: atest PowerUITest
Bug: 110259498
Change-Id: I6fb5c08d6388e463d6216de41b3fd49bbc489b81
2018-07-10 16:35:18 -07:00
Lucas Dupin
f8463ee043 Fade to black without showing system wallpaper
When on the lock screen, and going to AOD animated, user would
temporarily see the system wallpaper. That's not what we want,
we want to fade from semi-transparent black to black, on top
of the backdrop - lock screen wallpaper or media art.

Test: press power on the lock screen when playing media
Test: press power on the lock screen after dismissing media
Test: unlock from AOD
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
Fixes: 80575770
Change-Id: I6796e844add889ff86be0cd2052db7c5d5073039
2018-06-18 09:24:38 -07:00
Lucas Dupin
b784e6f7bc Merge "Config to enable/disable AOD via overlay" into pi-dev 2018-06-14 01:16:44 +00:00
Lucas Dupin
1e02f340e0 Config to enable/disable AOD via overlay
Bug: 109894567
Test: mp droid; fastboot -w
Change-Id: I3fda0bf486ae0c4b795ce34ba6823d8dc36a3796
2018-06-13 15:36:04 -07:00
Lucas Dupin
f1381bbe13 Avoid showing bouncer when in a launch transition
The panel will collapse but the bouncer should not become visible,
otherwise the IME might be requested.

Test: go/sysui-bouncer-tests
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
Change-Id: I0405cf1b956aa239b0684ac357a38cf4b2357cb2
Fixes: 109879604
2018-06-12 21:58:23 +00:00
TreeHugger Robot
cc4efe08de Merge "Update scrims when keyguard gets occluded" into pi-dev 2018-06-07 16:50:34 +00:00
Lucas Dupin
63d72170da Update scrims when keyguard gets occluded
We were assuming that a show_when_locked window would always be on
the lock screen when the device sleeps, but its possible that,
when charging, a window may come visible after the device enters
doze.

Ideally this should be handled in window manager but not feasible
in P.

Change-Id: I8a1b5e638a8e84bbea3a91fc4ac94feb6195390e
Fixes: 80647623
Test: manual with app from play store
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
2018-06-06 11:42:55 -07:00
Dieter Hsu
36e1ebca09 Update notifications on density or font size change for current user
For created notifications, entry manager is not going to update entries
after changing the font scale and/or display density when shade is
disabled or other reasons.
To reinflate notifications for current user even filtered.

Fixes: 77728867
Test: manually restore backup with lots of apps and change font scale and/or display density
Test: atest SystemUITests:NotificationDataTest
Change-Id: I37fa38e73af1ebb672abd06282d10d7d928cc3a9
2018-06-06 17:57:38 +00:00
TreeHugger Robot
842ec5085b Merge "Blank screen when coming from pulse" into pi-dev 2018-06-04 19:45:18 +00:00
Lucas Dupin
eb840eacf6 Blank screen when coming from pulse
We need to fade from black to the app to achieve a nice transition.

Test: visual
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
Change-Id: I13edd9c5f7a1bf9378851ac50c513d36ab821c43
Fixes: 87939048
2018-06-01 18:32:48 +00:00
Lucas Dupin
71dd484427 Do not request focus during wake and unlock
Focus was being required because the expansion of the panel
would trigger onFullyShown. Bouncer shouldn't need any
translation during WAKE_AND_UNLOCK.

Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
Test: go/sysui-bouncer-tests
Change-Id: I6d5c17ba89e14384859cf7fc91ca5cc2815dbfd9
Fixes: 80345339
2018-05-29 15:41:03 -07:00
Lucas Dupin
3116918bf0 Merge "Only animate when the slice is actually animating" into pi-dev 2018-05-23 20:15:19 +00:00
TreeHugger Robot
4524e93577 Merge "On orientation change, update rounded corners" into pi-dev 2018-05-23 14:35:29 +00:00
Beverly
e91f0d05da On orientation change, update rounded corners
When rotating landscape/seascape/upsidedown, the 'top' and 'bottom'
corners are in the correct place

Change-Id: I19858ca42939d81911c5f45bd80d163d0c22eee9
Fixes: 79163187
Test: manual, ScreenDecorationsTest
2018-05-23 09:37:09 -04:00
Sanry Huang
89d55288d9 Merge "Fix User unable to view the keyboard input" into pi-dev 2018-05-23 07:39:27 +00:00
sanryhuang
63787860c2 Fix User unable to view the keyboard input
revert extracted mode solution and using commandQueue to implement
setRemoteInputActive

Test: manual test
Test: atest
Change-Id: I82c63843dd38c19c1f88af15abcc137be4f72c83
Fixes:73275201
2018-05-23 07:37:58 +00:00
Lucas Dupin
3978e6e6ee Only animate when the slice is actually animating
It's not correct to always animate if there is a layout transition.
The transition might not be triggered when the view is invisible
for example. It's necessary to check if we have pending/running
animations.

Change-Id: I75dbc9f8a152a162a3c77c9b316f653e665b8842
Fixes: 79773596
Test: manual
Test: atest packages/SystemUI/tests/src/com/android/keyguard/KeyguardSliceViewTest.java
2018-05-22 19:13:51 -07:00
TreeHugger Robot
fe1b1f19fe Merge "[Notif] Don't show bouncer on dismiss" into pi-dev 2018-05-22 20:36:51 +00:00
Rohan Shah
593e8f18cd [Notif] Don't show bouncer on dismiss
For blocking helper, when user dismisses by interacting with elements
outside the current notification, we should not show the bouncer.

Changed the logic to only show bouncer/use the checksaverunnable when
the user hits 'stop notifications'

Test: Added test cases, ran via atest, verified manually too
Bug: 80132806
Change-Id: Ic204e1794360684cd6359ff93e77e184e39ad57e
2018-05-22 10:37:11 -07:00
TreeHugger Robot
553fc8b8e0 Merge "Bouncer shouldn't be translated when occluded" into pi-dev 2018-05-22 00:59:29 +00:00
Lucas Dupin
aece5028fc Bouncer shouldn't be translated when occluded
Only checking if the bouncer should be scrimmed isn't enough
since it might have been initialized for performance reasons,
but is hidden at the bottom of the keyguard.

Change-Id: If92083e2c385d51febe0ec3a5e5d3484476caf81
Fixes: 80101176
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
Test: manual
2018-05-21 16:44:28 -07:00
Lucas Dupin
30c7547149 Pulse state should always show ambient wallpaper
Otherwise wallpaper wouldn't be set to AOD when the device pulses
and always on is off.

Bug: 78606979
Test: manual
Test: atest packages/SystemUI/tests/src/com/android/systemui/doze/DozeWallpaperStateTest.java
Change-Id: Ic40c18252cd6cb06ff6fd0d79ec3f1de16a1add5
2018-05-21 14:14:42 -07:00
Lucas Dupin
402e2a2b6f Merge "Keep scrim black when "always on" is off" into pi-dev 2018-05-21 18:23:59 +00:00
Lucas Dupin
69bda6014f Keep scrim black when "always on" is off
The first frame when waking up is expensive and we
need a black scrim hiding what was left behind.

Bug: 78022321
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
Change-Id: I99e2b7960daf2cbe51bec6aee4b15c74d532078c
2018-05-21 10:14:23 -07:00
Chris Wren
2e89e8d893 clone the visibility objects for the handler thread
The main thread was recycling the objects before the hander could
pack up the binder call.

Change-Id: I4289bdcc5b940a0a8209fdd5d3df47972de0fa4b
Fixes: 72953296
Test: atest com.android.notification.functional.NotificationInteractionTests#testNotificationShadeMetrics
2018-05-18 15:32:21 -04:00
Selim Cinek
f75019b810 Merge "Keep notification when sending smart reply." into pi-dev 2018-05-18 16:20:40 +00:00
TreeHugger Robot
0a72c6b08d Merge "Do not allow bouncer translation when scrimmed" into pi-dev 2018-05-18 00:55:35 +00:00
Lucas Dupin
f9ca35eb09 Do not allow bouncer translation when scrimmed
We had special cases when the bouncer shouldn't be translated but that
doesn't really scale. It's much simpler to just check if it's being
scrimmed - because otherwse it mus be translated.

Change-Id: Ide0af6718f1792ef1a1e16fa39512a2b3a0ba8be
Bug: 78222122
Fixes: 78205990
Fixes: 78140990
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
Test: go/sysui-bouncer-tests
2018-05-17 16:40:50 -07:00
Selim Cinek
866b4de28f Merge "Fix that the empty shade view would be visible sometimes" into pi-dev 2018-05-17 21:02:01 +00:00
Selim Cinek
d60ef9ec87 Fix that the empty shade view would be visible sometimes
Refactored the state to be more clear and make sure the end runnable is always called.

Fixes: 78861878
Test: have no notification, hide view by scrolling up, get notification, observe
Change-Id: I51b00696f4b2dba565a0213c24a5a67a3c4099e0
2018-05-17 12:52:09 -07:00
Kenny Guy
8cc15d2ebf Keep notification when sending smart reply.
If an app cancels a notification while we are
sending a smart reply then don't dismiss the
notification.

Bug: 79120026
Test: atest NotificationEntryManagerTest
Test: atest SmartReplyControllerTest
Test: atest statusbar.NotificationListenerTest
Test: atest NotificationRemoteInputManagerTest

Change-Id: Ibbc0014ae0aeb12b58be13c041d720903251490f
2018-05-17 20:16:25 +01:00
TreeHugger Robot
5be1956952 Merge "Reduce usages of main looper in sysui tests" into pi-dev 2018-05-17 15:28:30 +00:00
Jason Monk
6dceace0ed Reduce usages of main looper in sysui tests
Push over to a standard testable looper, and a testable looper +
setAsMain when needed.

Also make tests more synchronous and single threaded as possible.
This will make them more deterministic and speeds them up noticeably.

Test: runtest systemui
Bug: 79550837
Change-Id: Iab0eb794329d7b1de95aef904ec08ecae7dadc98
2018-05-17 10:32:31 -04:00
TreeHugger Robot
ceeba4f6d6 Merge "Change status bar icons upon capability changes in the default network." into pi-dev 2018-05-17 06:46:39 +00:00
Anarghya Mitra
678722f9d0 Change status bar icons upon capability changes in the default network.
SysUI status bar updates currently happen upon receiving either the
CONNECTIVITY_ACTION broadcast (which is deprecated) and
INET_CONDITION_ACTION broadcast (which is sent upon validation state
change of networks only).

This leads to status bar showing stale connectivity state. The correct
fix for this is to listen to changes in network state by registering
NetworkCallbacks (see more details in http://b/79286300#comment9).

In the P timeframe, not listening to the broadcasts completely is out of
scope. So this CL just listens for changing network capabilities of the
default data network, which should fix all the cases where the
broadcasts are not getting sent.

Later, when we stop relying on the broadcasts, we will also have to
override onAvailable and onLost (and perhaps the other callbacks too).

Test: runtest --path frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/
Bug: 71904788
Change-Id: I2e58b9cfceb9937a0b54874dee116ead5339b37b
2018-05-16 22:23:56 -07:00
Lucas Dupin
7ff82b0a92 Fix KeyguardUpdateMonitor test
KeyguardUpdateMonitor's Handler runs on the main looper by design,
we need to ensure that whenever we're processing messages, that
they will also be received on the main looper.

Also unregistered a broadcast listener to avoid a possible race
condition

Test: atest packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
Bug: 79550837
Change-Id: I14a319da5c6bc46fd32675ae205e14a6228efaa4
2018-05-16 12:40:30 -07:00
TreeHugger Robot
cb20eb3a07 Merge "Pass Uri in SliceBroadcastRelay" into pi-dev 2018-05-11 22:05:36 +00:00
Lucas Dupin
29e796d26a Do not hide keyguard message when fp
Test: atest packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinBasedInputViewTest.java
Change-Id: I5d76b688b0eb7c1df6a36c1cb910f2b0ec98bc46
Fixes: 78235570
2018-05-11 09:22:39 -07:00
TreeHugger Robot
895ed11d03 Merge "Fix issue with compressed smart replies." into pi-dev 2018-05-11 14:19:40 +00:00
TreeHugger Robot
d87ad2d97c Merge "Cannot add null callbacks to ZenController" into pi-dev 2018-05-11 02:03:55 +00:00
Beverly
80313ca38f Cannot add null callbacks to ZenController
- In StatusBar: remove callback on destroy

Bug: 79418729
Test: atest ZenModeControllerImplTest
Change-Id: I92729b0c0414d0ed8f844371cbf357b613ced0b5
2018-05-10 17:13:42 -04:00
TreeHugger Robot
aba96e5556 Merge "Fix notificationinfo test breakage" into pi-dev 2018-05-10 21:04:41 +00:00