Commit Graph

32788 Commits

Author SHA1 Message Date
Evan Laird
323ce62057 DO NOT MERGE: Don't let NotificationEntryManager keep around old RankingMaps
When a notification becomes lifetime-extended, NotificationEntryManager
was holding onto the RankingMap that was passed at the time of removal
of _that_ notification, and using it again in the
NotificationSafeToRemoveCallback. The problem here is that when
onSafeToRemove gets called, it was passing that same stale ranking map
to removeNotification, which caused any notification that arrived in the
intervening time to get improperly ranked.

This fixes an issue where any notification that arrives while another is
lifetime-extended can get the wrong ranking applied to it, causing
trouble later in time such as mis-ranking and mis-sorting until the next
update from system server.

Bug: 146046016
Bug: 119041698
Test: atest SystemUITests
Test: manual - Post a FGS notification and immediately cancel, then post
a regular notification and wait for the FGS notification to dismiss.
Note that the regular notification keeps showing in the status bar.

Change-Id: I3df1279f13c424fcedd878bae2095fadc75d61b4
2019-12-11 21:17:07 +00:00
Evan Laird
5136eefeb3 Force FGS notifications to show for a minimum time
It's possible for a service to do a start/stop foreground and cause a
couple of things to happen:

NotificationManagerService will enqueue a EnqueueNotificationRunnable,
post a PostNotificationRunnable (for the startForeground), and then also
enqueue a CancelNotificationRunnable. There is some racy behavior here
in that the cancel runnable can get triggered in between enqueue and
post runnables. If the cancel happens first, then
NotificationListenerServices will never get the message.

This behavior is technically allowed, however for foreground services we
want to ensure that there is a minmum amount of time that notification
listeners are aware of the foreground service so that (for instance) the
FGS notification can be shown.

This CL does two things to mitigate this problem:

1. Introduce checking in the CancelNotificationRunnable such that it
will not cancel until after PostNotificationRunnable has finished
executing.

2. Introduce a NotificationLifetimeExtender method that will allow a
lifetime extender to manage the lifetime of a notification that has been
enqueued but not inflated yet.

Bug: 119041698
Test: atest NotificationManagerServiceTest
Test: atest ForegroundServiceNotificationListenerTest
Change-Id: I0680034ed9315aa2c05282524d48faaed066ebd0
Merged-In: I0680034ed9315aa2c05282524d48faaed066ebd0
2019-10-07 14:11:44 -04:00
Fabian Kozynski
d2eb34b689 Use UnlockMethodCache#canSkipBouncer in user switcher
KeyguardMonitor#canSkipBouncer was not updated properly when the phone
was unlocked using fingerprint.

This CL removes that method and changes UserSwitcherController to query
UnlockMethodCache directly, as it was KeyguardMonitor's only client for
that method.

Test: manual unlocking with FP and with pattern
Test: no automated test yet
Bug: 140486529
Merged-In: Idbff4fbabca962c632ff5d78b25418c0502db9a7
Change-Id: Idbff4fbabca962c632ff5d78b25418c0502db9a7
2019-09-04 22:55:12 +00:00
Selim Cinek
cceea08cc7 Merge "DO NOT MERGE: Fixed an issue where the notification icons wouldn't show while docked" into qt-dev 2019-08-20 23:39:13 +00:00
Selim Cinek
bdf71a0420 DO NOT MERGE: Fixed an issue where the notification icons wouldn't show while docked
Since we're using the pulsing state for docking, the icons would now
become clipped while pulsing.

Fixes: 139096431
Test: dock, observe notification icons showing
Change-Id: If251e6b18c03b2824b4d3ea4dab82d4a403565f1
Merged-In: I8f7bd7a6a0562942ed3e12f28705043722d177e8
2019-08-20 13:00:03 -07:00
Ned Burns
68f3bb1305 Merge "Ensure isTopBucket() gets set when there is just one notification" into qt-dev 2019-08-09 22:21:45 +00:00
Ned Burns
6c34506dd8 Ensure isTopBucket() gets set when there is just one notification
My descendants will vilify this CL for generations to come. We'll
clean it up for R, but this is our last, best hope for fixing things
in Q.

Bug: 138775282

Test: manual
Change-Id: I615b2f7fddca30dae67dbaab0e5d54a824a4c441
Merged-In: I615b2f7fddca30dae67dbaab0e5d54a824a4c441
(cherry picked from commit 2d35980e72)
2019-08-09 17:28:27 +00:00
Bill Yi
1715bf4a65 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: If8df5134da53280a8a52b21df9d4769d31230d0a
2019-08-08 18:58:21 -07:00
Beth Thibodeau
628f975c22 Merge "Revert "Stop timer when notification isn't visible"" into qt-dev 2019-07-31 20:31:53 +00:00
Beth Thibodeau
4c9726e041 Revert "Stop timer when notification isn't visible"
This reverts commit 3c4a8e48d4.

Reason for revert: NPE errors
Fixes: b/138697134

Change-Id: Ic89eb58cd68485dcc5e7c5a3ef48d7ed79c303ca
2019-07-31 20:26:19 +00:00
Selim Cinek
8ba52400f5 Merge "Fixed an issue where the notification wouldn't collapse" into qt-dev 2019-07-29 20:35:36 +00:00
TreeHugger Robot
bb94263ca2 Merge "Showing the notification icon properly now when the pulse is suppressed" into qt-dev 2019-07-29 20:33:42 +00:00
TreeHugger Robot
7256c379df Merge "Stop timer when notification isn't visible" into qt-dev 2019-07-29 20:30:46 +00:00
bsears
10a9fde8b5 Merge "Only supports ambient mode when necessary." into qt-dev 2019-07-28 17:29:03 +00:00
Selim Cinek
7c236e9ca7 Fixed an issue where the notification wouldn't collapse
When clicking on a notification with an activity that
wouldn't start an opening animation, the panel could
remain open. We're now closing it in that case.

Fixes: 138468703
Test: follow test on bug and observe normal closing
Change-Id: I0b867302d616c017d82f944ee983d4ba4356701a
2019-07-26 21:47:19 -07:00
Dave Mankoff
bbc11cafee Do not allow the FalsingManager sesion to start when AOD is showing.
Bug: 138220274
Test: manual

Change-Id: I6d14db66d53a668b7cf8dd15ebb489fb3ebf4c7c
Merged-In: I6d14db66d53a668b7cf8dd15ebb489fb3ebf4c7c
2019-07-27 01:48:32 +00:00
Selim Cinek
15803b51e3 Showing the notification icon properly now when the pulse is suppressed
Previously the notification would be hidden so if the user would pull
out the phone from the pocket, they might not see what notification
actually alerted.

Bug: 138336424
Test: add notification while on AOD, block prox sensor, see icon
Change-Id: I101640c9d0226948e44a4bf36a7ca91dd135fe66
Merged-In: I8f7bd7a6a0562942ed3e12f28705043722d177e8
2019-07-27 00:36:11 +00:00
Beth Thibodeau
3c4a8e48d4 Stop timer when notification isn't visible
Fixes: 138261464
Test: manual, atest com.android.systemui.statusbar.notification.row.wrapper.NotificationMediaTemplateViewWrapperTest
Change-Id: Id7b1b586f3ab258fad8670070240ef951080c969
2019-07-26 11:33:18 -04:00
Ahan Wu
0e17480b1f Only supports ambient mode when necessary.
We only need support ambient mode on specified devices but we currently
enable this attribute on all devices, that means we need redraw every
time when ambient mode changes. However, we can just show / hide
wallpaper window on the devices which not support ambient transition.

In addition, always use portrait dimension as scissor area since we only
do transition in portrait.

Bug: 138021396
Bug: 137962047
Test: Manually test on F2, C1, B4, S4 and walleye.
Test: Set an image wallpaper, switch between home, aod and lockscreen.
Test: Also use finger print to unlock from aod to home directly.
Test: Rotate to landscape, set a new image wallpaper.
Test: Switch between home, aod and lockscreen.
Change-Id: I36dd49363e81df5a260b10695d90aa9d8c70a45a
2019-07-26 14:56:32 +08:00
TreeHugger Robot
b340cce330 Merge "Prevent the BrightLineFalsingManager from duping its session." into qt-dev 2019-07-25 00:47:21 +00:00
Dave Mankoff
0ae8f2e36a Prevent the BrightLineFalsingManager from duping its session.
The BrightLineFalsingManager should not be able to start a session
when it's already in a session. Primarily, this caused the
FalsingManager to hang onto extra registrations to the Proximity
Sensor, per the bug.

Bug: 138220274
Test: atest SystemUITests and manual.
Change-Id: Id10d2697a96524e98c87aaa87702209d1752fe68
2019-07-24 22:12:40 +00:00
Ned Burns
91e425d793 Fix issue with media notifs being misbucketed
Previous code assumed that "isHighPriority" == "is in top section",
which is not always true. Media notifs and some other notifs can appear
in the top section even if they're not high priority. Because we detect
section boundaries by iterating through the list until we find the first
notif where isHighPriority == false, we were sometimes drawing the
section boundary way too high. This change creates a new propery,
isInTopSection() that accurately tracks this state.

Setting this value in the proper location would require some seriously
destabilizing refactors, so instead we set it in the list comparator,
which is awful but here are.

Test: manual
Bug: 138320173
Change-Id: I19223720bac534ab92219a2962169097819e8efb
Merged-In: I19223720bac534ab92219a2962169097819e8efb
(cherry picked from commit 8c1b763dcf)
2019-07-24 21:23:59 +00:00
Dave Mankoff
8d56bbf2e3 Merge "Allow BrightLineFalsingManager settings to be experimented with via Phenotype." into qt-dev 2019-07-24 19:09:02 +00:00
Dave Mankoff
e38da07841 Allow BrightLineFalsingManager settings to be experimented with via Phenotype.
This is a CP of http://ag/8687829

Bug: 138308096
Test: atest SystemUITests
Change-Id: I9e2b22b157c45da1606466acdfff3c5de7f182e1
Merged-In: I9fa4d1344bb184dea00f92f8d265667f0be11466
2019-07-24 18:37:11 +00:00
bsears
486503c74e Merge "Don't animate clock when turning screen off." into qt-dev 2019-07-24 01:22:21 +00:00
Robert Snoeberger
c51bb548dc Don't animate clock when turning screen off.
This change stops the animation because there isn't a
transition from the no-header state to the music header
state when turning the screen off (to AOD). Since there
isn't a transition, there isn't an animation.

This assumes that there isn't a transition from unlocked to
lock screen. If there is, then there would be an animation
of the music going away while arriving at the lock screen.

Fixes: 137383007
Test: Checked repro steps in bug, clock doesn't animate.
Test: Also checked repro steps when audio is paused, clock doesn't
animate.
Test: atest KeyguardSliceProviderTest.java

Change-Id: If39777340b72bc623d6690bc4f784c7f5c26ea8d
Merged-In: If39777340b72bc623d6690bc4f784c7f5c26ea8d
2019-07-23 18:13:13 +00:00
Dave Mankoff
f0fb6e1b29 Merge "Add cleanup method to FalsingManager to prevent memory leaks." into qt-dev 2019-07-23 17:10:26 +00:00
TreeHugger Robot
5958b7c77b Merge "Fixed a bug with the animation of the notification background" into qt-dev 2019-07-23 00:57:58 +00:00
Bill Yi
09da14be40 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I8688211f4bb949f51359257a442b81d62e7057bf
2019-07-22 11:01:57 -07:00
Dave Mankoff
73d48ab970 Add cleanup method to FalsingManager to prevent memory leaks.
When the FalsingManager gets reloaded (due to plugins) it can
leak its listeners and callbacks. This change fixes that.

This is a CP of http://ag/8668802.

Bug: 136351609
Test: manual
Change-Id: I7ea8384678b60e78ed384e19bbd7932722fe2b9c
Merged-In: I2b52d018d478dbcad4ecb7d8a5b361638d5c5877
2019-07-22 10:50:22 -04:00
Bill Yi
82f1099361 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I9041213adcd88452a12b56e110017a314f7a8139
2019-07-20 21:30:49 -07:00
Selim Cinek
893a9dfa10 Fixed a bug with the animation of the notification background
The position of the background could be 0 and therefore the
background could fly over the whole screen.
We're now positioning the top section at the start
of the first visible section.

Fixes: 137885070
Test: atest SystemUiTests
Change-Id: I6720b570f5cd209249b90681cdf6c6a56cf0194e
2019-07-19 17:33:22 -07:00
TreeHugger Robot
fcd42e9249 Merge "Fixed a crash with the headsUpManager" into qt-dev 2019-07-19 23:55:30 +00:00
TreeHugger Robot
cdc566dfd6 Merge "Use binned brightness sensor instead of prox" into qt-dev 2019-07-19 22:33:20 +00:00
Lucas Dupin
f61c1044fb Use binned brightness sensor instead of prox
Prox can be noisy and should only be used as a fallback when a more
robust sensor implementation is not available.

Test: manually cover prox sensor
Test: breakpoint
Test: dumpsys
Fixes: 137451005
Change-Id: If0fca42aca36546942930ce76be1353129fc91fc
2019-07-19 12:16:25 -07:00
Selim Cinek
41e7e6edc7 Fixed a crash with the headsUpManager
Since the headsUpManager is calling out in various places to
its listeners, the callbacks may query the headsupmanager
in an internally inconsistent state, such that the pinned mode is
true but there is no topEntry. Let's add a null-check for
safety here.

Bug: 137804505
Test: atest SystemUITests
Change-Id: Ibae76b555ca51ccf676228b034a614d59a8b4e8e
2019-07-19 11:47:58 -07:00
Dave Mankoff
b332588e60 Enable the BrightLineFalsingManager by default on Q.
Bug: 71762354
Change-Id: Icfc6e21d50e08c34168f504ec64bf654ba6cb6a4
Test: atest SystemUITests
2019-07-19 11:26:58 -04:00
TreeHugger Robot
465f347c2a Merge "Import translations. DO NOT MERGE" into qt-dev 2019-07-18 21:26:43 +00:00
Bill Yi
a67f9d5d97 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: Ib95137b7ade70cbb7184e3d0a7f004fc759bc064
2019-07-18 11:31:21 -07:00
Lucas Dupin
29e30faa4e Do not animate wallpaper when wakeAndUnlock
Fixes: 137536016
Test: press power to go to lock scree <-> aod
Test: unlock with fingerprint
Test: trigger AOD2 pulse (look at wallpaper animation)
Test: atest DozeWallpaperStateTest
Change-Id: I46574609a00712bdde5a4652ab5c9b0c04cbeeec
Merged-In: I46574609a00712bdde5a4652ab5c9b0c04cbeeec
2019-07-18 02:07:24 +00:00
Bill Yi
c040a9f941 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: Ib19f01fa0ff2376e7db5168cc45d5da4321b28d8
2019-07-14 10:13:06 -07:00
TreeHugger Robot
1feb0dfde8 Merge "Import translations. DO NOT MERGE" into qt-dev 2019-07-12 20:55:41 +00:00
Bill Yi
b6708dad40 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I22c679764a454425947c3e0bd3949b18fa6678d4
2019-07-11 19:34:56 -07:00
TreeHugger Robot
6c22dff644 Merge "Use a Region when calculating TouchableRegion for cutouts" into qt-dev 2019-07-11 06:33:20 +00:00
Evan Laird
e1822fd8d4 Use a Region when calculating TouchableRegion for cutouts
HeadsUpManagerPhone handles adding extra touchable region for the
display cutout. When this changed to use Rects, the extra touch region
was applied to the entire phone width because Rect#union() will cause
the resulting Rect to grow in every dimension. The fix is to use a
Region instead so we can properly union only the space under the notch

Fixes: 135487528
Test: manual
Change-Id: I1d39785087cc3378fc42363df170b81b84420a8e
2019-07-10 22:57:21 +00:00
TreeHugger Robot
71682ae9c7 Merge "Fix wallpaper flicker issue while transiting from home to aod." into qt-dev 2019-07-10 12:57:14 +00:00
Bill Yi
ea64a78dd9 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I75c667821566cceb965581d51a0a2e59418faf1f
2019-07-09 10:40:53 -07:00
Ahan Wu
b378059f11 Fix wallpaper flicker issue while transiting from home to aod.
There is a race condition between window visibility and wallpaper
transition, so wallpaper window might become visible before background
thread has done its rendering work and a flicker happens.

This solution just lets main thread wait for background thread to
synchronize window visibility and wallpaper transition.

Bug: 136643341
Test: atest SystemUITests
Test: Screen off  Launcher/APP -> AOD : No extra transition by design,
      The duration between press Power Key and AOD show should be same.
Test: Screen on AOD -> Launcher : Face unlock work without flickr
Test: Screen off Keyguard -> AOD : Either Panel or background transition without flickr
Test: Screen on AOD -> Keyguard : Either Panel or background transition without flickr
Test: Reach in AOD -> Keyguard : Either Panel or background transition without flickr
Test: Reach out Keyguard -> AOD : Either Panel or background transition without flickr
Test: Manually operate and observe log.
Change-Id: Iebfdac18972569864c047bc2c4a33d7791940896
2019-07-09 21:48:49 +08:00
TreeHugger Robot
5540281a6d Merge "Change NVHM protection from crash to Log.wtf" into qt-dev 2019-07-04 01:28:08 +00:00
Bill Yi
063586411d Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: Id195d54ad8e39a06ee00a25ce3330ba42f8b0412
2019-07-02 22:17:00 -07:00