Commit Graph

2315 Commits

Author SHA1 Message Date
Matt Pietal
c561831af7 [DO NOT MERGE] Update window with FLAG_SECURE when bouncer is showing
This will prevent bouncer interactions from showing up in
screenrecords or screenshots.

Fixes: 215005011
Test: atest StatusBarWindowControllerTest && take screenshot
with bouncer up

Merged-In: I3f59df865dc2dd13d4b9ac54bb2dacb7b23f0aa1
Change-Id: I8df2258863b8cede5ba112331e0446f534267ba2
2022-09-15 17:52:28 +00:00
TreeHugger Robot
7efe303e96 Merge "Allow forcing status bar state changes and do so when the screen turns off." into qt-dev 2021-11-04 02:51:52 +00:00
Jeff DeCew
921d955822 Allow forcing status bar state changes and do so when the screen turns off.
This adds a force flag, which we will use when turning the screen off to make sure that all UI components are reset to the SHADE state regardless.

Bug: 189575031
Test: make a call; lock screen; pull down shade
Merged-In: I79baeb71ac5d1ed45602ac55cdca996b3bed0ac3
Change-Id: I79baeb71ac5d1ed45602ac55cdca996b3bed0ac3
2021-10-21 19:48:19 +00:00
Jeff DeCew
e7f992a133 Do not show the notification footer until the user is set up.
Bug: 193149550
Test: follow repro steps
Merged-In: I49e2b8bcec7b2ce0a9776ff30a64c07f24949da7
Change-Id: I49e2b8bcec7b2ce0a9776ff30a64c07f24949da7
2021-09-22 16:04:05 +00:00
Beth Thibodeau
92106a58df Increase maximum allowed size for status bar icons
The previous size was causing some apps to crash which otherwise worked
fine. This more closely matches the hard limit in RecordingCanvas
(which we need to stay below to prevent SystemUI from crashing).

Fixes: 182891864
Fixes: 182232777
Bug: 169255797
Test: atest StatusBarIconViewTest
Test: manual - posting notifications with different drawable sizes
Change-Id: I8deacc651e05a202ec980eeb8bcdf4f92daea8eb
(cherry picked from commit 5cd7976f7d)
2021-04-01 18:16:47 +00:00
Beth Thibodeau
04043de40c Merge "Limit maximum allowed size for a status bar icon" into pi-dev am: ed7118d8bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13430565

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4dd07763f8c0c767c82a8e354f20e980e06a9373
2021-03-03 19:32:05 +00:00
Evan Laird
98d6853f1a DO NOT MERGE: Allow interrupting notifications to bypass lifetime extension
Notifications which have interruped the UI (usually a HUN) can safely
bypass FGS lifetime extension because the system has done the best it
can to show the user this notification.

This valve is important in particular for things like a dialer which
might want to interrupt a user but need to do so again on the same
channel, for instance when getting multiple phone calls quickly in
succession.

Bug: 155594347
Bug: 119041698
Test: atest ForegroundServiceNotificationListenerTest
Change-Id: Id80fba3191cc133d1e73ca04015f9cbed62fc086
2021-01-29 10:47:58 -05:00
Evan Laird
cec677aca4 DO NOT MERGE: Create a shim for StatusBarManager click methods
`StatusBarManager#onNotificationClick` and
`StatusBarManager#onNotificationActionClick` are signals we send to
system server about notification clicks. This CL adds a shim so that we
can have an in-process callback about the exact same events.

This CL also adds NotificationInteractionTracker, which basically just
merges the NotificationClickNotifier callbacks with the notification
collection and will be able to answer the question "has the user
interacted with this notification"

Lastly, this modifies the logic in ForegroundServiceLifetimeExtender
which now checks the interaction flag for notifications. So if a user
tapped on a notification action (for instance) which _then_ triggers a
notification cancel, it will succeed. It _does not_ as of yet release
the notification from lifetime extension upon interaction. So if a
notification is canceled and then interacted with, it will still live
the full amount of time.

Test: atest SystemUITests
Bug: 144324894
Bug: 119041698
Change-Id: I42201d6e7b7ffe9ad4f19c774b638a36a51750ef
(cherry picked from commit 9b2a480ceb)
2021-01-29 10:47:13 -05:00
Beth Thibodeau
c508aed10f Limit maximum allowed size for a status bar icon
Bug: 169255797
Test: atest StatusBarIconViewTest
Test: verified that app crashes instead of SysUI following repro steps
Change-Id: I66e3bb873841b5babfd522c82cea7bed361fc14c
(cherry picked from commit 4394595deb)
2021-01-28 22:00:46 +00:00
Lucas Dupin
44d1c652ce Update redaction upon profile changes
We can't rely on status bar state changes to update the notification
list. The current user might not be set yet, causing wrong notifications
to become visible.

Fixes: 145135488
Test: manual
Test: atest NotificationStackScrollLayoutTest
Change-Id: I34d1d5f9a751c1d7680a5a5941c39b9fe33a473b
Merged-In: I34d1d5f9a751c1d7680a5a5941c39b9fe33a473b
2020-02-03 16:25:36 +00:00
Fabian Kozynski
1a45963839 Prevent sending early termination of appop use
If a package starts a particular appop both as active and noted, once
one of them is finished (usually noted after 5s), a message will be sent
to callbacks indicating the end of the use. However, the app op may
still be active. This could result in the removal of indicators
prematurely from notifications.

This change prevents that from happening by checking if the app op is
still in use by that combination uid/package (either active or noted)
and not notifying listeners if that's the case.

Test: atest AppOpsControllerTest
Test: use app from bug report. Observe that notification does not lose
the microphone indicator
Bug: 144092031
Merged-In: I180e7c257e6171e7686ba7eda9bf02249358ed0

Change-Id: I94473c3ccf1318dac29f067dade91e540e20285e
2020-01-14 14:36:26 -05:00
Abodunrinwa Toki
4828033816 Merge "RESTRICT AUTOMERGE Disable TextClassifier for RemoteInputView." into pi-dev 2019-12-11 21:58:38 +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
Evan Laird
3b8c4743f6 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 ForegroundServiceLifetimeExtenderTest
Change-Id: I0680034ed9315aa2c05282524d48faaed066ebd0
Merged-In: I0680034ed9315aa2c05282524d48faaed066ebd0
2019-10-04 16:54:50 -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
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
Abodunrinwa Toki
579abbd2d8 RESTRICT AUTOMERGE Disable TextClassifier for RemoteInputView.
Sys UI runs in the primary user. This means that TextView components
such as RemoteInputView and KeyguardPasswordView running in it could
leak data across users.

This CL disables the TextClassifier for RemoteInputView.
It also logs when fixed issue is "potentially" exercised.
There is no need to explicitly disable the TextClassifier for
KeyguardPasswordView. It is a password field
(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD) and the
TextClassifier does not run for such fields.

Test: manually attempt to excercise the bug.
      See the bug in 123232892 for more information.

Bug: 136483597
Bug: 123232892
Change-Id: Ia1e4843d1505e204f2e78d2459da198c9988f7f2
2019-08-06 04:42:08 +01: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
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
b332588e60 Enable the BrightLineFalsingManager by default on Q.
Bug: 71762354
Change-Id: Icfc6e21d50e08c34168f504ec64bf654ba6cb6a4
Test: atest SystemUITests
2019-07-19 11:26:58 -04: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
Ned Burns
b3b4bd390a Delay possible re-entrant call to updateNotificationViews()
NVHM.onDynamicPrivacyChanged() both calls updateNotificationViews() and
could be called by updateNotificationViews(), resulting in very-bad,
no-good re-entrant behavior. It's too late to try to rearchitect the
entire shade to avoid this relationship, so instead we delay a frame
before applying the update.

Bug: 135018709
Test: atest, manual
Change-Id: I0b17d5ba16e272015b10be182a07cae6b29270e6
2019-06-27 19:50:02 -04:00
Lucas Dupin
924010df2d Avoid stuck wake-locks
By having a maximum timeout.

Test: atest WakeLockTest
Fixes: 136001054
Fixes: 135881494
Change-Id: Ie189809191890213ea79f15e76bc1461a3445641
2019-06-27 05:22:26 +00:00
TreeHugger Robot
c5ab1e8f8a Merge changes from topic "b135715570-test-memory-leaks" into qt-dev
* changes:
  Refactor BrightLineClassifier tests to use significantly less memory.
  Turn off BrightLineClassifier tests until memory leaks can be identified.
2019-06-26 14:08:01 +00:00
Dave Mankoff
f5d210ebd0 Refactor BrightLineClassifier tests to use significantly less memory.
Stop relying so heavily on mockito when it's not necessary. This also
makes tests run significantly faster. Memory usage is now basically flat.

Bug: 135715570
Test: atest SystemUITests
Change-Id: Ifd71e092b19068817600631b5b98a4a8e80a0126
2019-06-25 12:25:41 -04:00
Dave Mankoff
cc28d7b6c0 Turn off BrightLineClassifier tests until memory leaks can be identified.
Bug: 135715570
Test: atest SystemUITests
Change-Id: I334ffe87dc7c28367e4f238a9f7928839b7d831c
2019-06-24 14:15:21 -04:00
Lucas Dupin
ba914792ad Unregister listeners and reset wake lock
The ContentProvider might be recreated by the system, so we it's
not necessarily a singleton. We need to cleanup listener registration
and alarms before reattributing the static variable.

Change-Id: I07aec96e77c67d96d31c7e38c85f5ce6f5ef2216
Merged-In: I9bc993f372a8c05258f1778eb3d415af04544714
Fixes: 135344397
Fixes: 135582651
Test: bind and unbind slice various times
Test: atest KeyguardSliceProviderTest
2019-06-24 09:03:12 -07:00
Chiayu Pei
a5be28971c Merge "Revert "Unregister listeners and reset wake lock"" into qt-dev 2019-06-24 04:19:13 +00:00
Chiayu Pei
6a8c935767 Revert "Unregister listeners and reset wake lock"
This reverts commit fe107a1621.

Reason for revert: <INSERT REASONING HERE>

Change-Id: Id092c473a8300e014ccd4d941afa4afcdbbf48bc
2019-06-24 01:46:28 +00:00
Lucas Dupin
9b47581ea4 Merge "Unregister listeners and reset wake lock" into qt-dev 2019-06-22 20:12:26 +00:00
Lucas Dupin
fe107a1621 Unregister listeners and reset wake lock
The ContentProvider might be recreated by the system, so we it's
not necessarily a singleton. We need to cleanup listener registration
and alarms before reattributing the static variable.

Change-Id: I227842d7272d1edeaa67d776950f369aedb01a91
Merged-In: I227842d7272d1edeaa67d776950f369aedb01a91
Fixes: 135344397
Fixes: 135582651
Test: bind and unbind slice various times
Test: atest KeyguardSliceProviderTest
2019-06-22 19:01:20 +00:00
Dave Mankoff
6c9547a9a5 Merge "DO NOT MERGE Allow the new BrightLineFalsingManager to be enabled via PhenoType." into qt-dev 2019-06-22 15:41:14 +00:00
Dave Mankoff
e0321d5809 DO NOT MERGE Allow the new BrightLineFalsingManager to be enabled via PhenoType.
Test: atest SystemUITests
Bug: 111394067
Change-Id: I0ab9a72d66bf56a56df2de2ad2d247f299d1b748
Merged-In: I0ab9a72d66bf56a56df2de2ad2d247f299d1b748
2019-06-22 14:19:01 +00:00
TreeHugger Robot
14e6d18ec9 Merge "Fade away wallpapers when long pulse" into qt-dev 2019-06-22 11:59:49 +00:00
TreeHugger Robot
c65d4b728c Merge "DO NOT MERGE: Fixed an issue about notification icons on AOD" into qt-dev 2019-06-21 18:57:25 +00:00
Dave Mankoff
a90fe0a8c3 Free up memory in the ZigZagClassifierTest.
Test: atest SystemUITests
Bug: 135715570
Change-Id: Iddfcf8cc107254c397769b2b3c5251270ec0a3bd
2019-06-21 12:00:59 -04:00
Selim Cinek
d34e9d889a DO NOT MERGE: Fixed an issue about notification icons on AOD
Previously low priority notifications were hidden
on AOD unconditionally which is wrong.

Bug: 135627468
Test: atest SystemUITests
Merged-in: Ia64238f30620d9906aa50c2469121c2653875e8d
Change-Id: Ia64238f30620d9906aa50c2469121c2653875e8d
2019-06-20 23:19:21 +00:00
TreeHugger Robot
4d39c4a7d7 Merge "Add main thread and reentrant asserts to chase down crashes" into qt-dev 2019-06-20 23:11:33 +00:00
TreeHugger Robot
60aabc40a2 Merge "Safeguard against no tiles in QS" into qt-dev 2019-06-20 21:42:23 +00:00
Fabian Kozynski
6ff5c18cb0 Safeguard against no tiles in QS
In PagedTileLayout:
* Make sure that each page displays at least 1 tile (never 0).
* Make sure that there's at least one page (even if it's empty)

In QSTileHost:
* If the new value of sysui_qs_tiles produces no tiles (but it's not set
to empty), set the tile set to the empty default
@string/quick_settings_tiles

Test: adb shell settings put secure sysui_qs_tiles not-a-valid-tile-spec
Test: atest QSTileHostTest
Fixes: 135023694
Fixes: 135677464
Change-Id: I1e5cf4d2688370001ecae87fc0272acecd48af73
2019-06-20 15:54:45 -04:00
Ned Burns
d4a69f7007 Add main thread and reentrant asserts to chase down crashes
We're seeing crashes due to view hierarchy violations that shouldn't be
possible. Adding some guards to make sure we aren't running into
off-thread hierarchy manipulation or re-entrant calls to the update
code.

Test: manual
Bug: 135018709
Change-Id: I4b1f2bd7e3a6f80384486d59b9f56fc3713537cf
2019-06-20 15:40:55 -04:00
Dave Mankoff
acd240fbb3 Merge changes from topic "b111394067-new-falsing-manager" into qt-dev
* changes:
  Add ZigZagClassifier to the BrightLineFalsingManager.
  Add ProximityClassifier to the BrightLineFalsingManager
  Add DistanceClassifier to the BrightLineFalsingManager
  Add DiagonalClassifier to the BrightLineFalsingManager.
  Add TypeClassifier to the BrightLineFalsingManager.
  Add PointerCountClassifier to the BrightLineFalsingManager.
  Add base class for new falsing manager and classifiers.
2019-06-20 18:05:19 +00:00
Dave Mankoff
89ad24688b Add ZigZagClassifier to the BrightLineFalsingManager.
This rejects swipes that wiggle around too much. Swipes
should be mostly straight.

Bug: 111394067
Test: atest SystemUITests
Change-Id: I43aa1cc62abb47ce43423c3c7c8e58c14dc0db03
2019-06-19 13:50:01 -04:00
Dave Mankoff
8bfbe3348e Add ProximityClassifier to the BrightLineFalsingManager
This requires swipes to travel a minimum distance and/or
fling a minimum distance.

Bug: 111394067
Test: atest SystemUITests
Change-Id: Id7586011a30fdcd9dfef7c937f22c33564829307
2019-06-19 13:50:01 -04:00
Dave Mankoff
65b5769c07 Add DistanceClassifier to the BrightLineFalsingManager
This requires swipes to travel a minimum distance and/or
fling a minimum distance.

Bug: 111394067
Test: atest SystemUITests
Change-Id: Iec90bb73b4108ce803f9247ebc30046e8c1a6a2d
2019-06-19 13:49:55 -04:00
Dave Mankoff
d8efd0d4ed Add DiagonalClassifier to the BrightLineFalsingManager.
This rejects swipes that are too close to 45 degrees.

Bug: 111394067
Test: atest SystemUITests
Change-Id: I45913918e89b965678628e3a6a0431a3db4b085a
2019-06-19 13:45:31 -04:00
Dave Mankoff
fd42bdbb86 Add TypeClassifier to the BrightLineFalsingManager.
This matches an existing falsing classifier that ensure
the general direction of a swipe matches the intended action
(i.e. dismissing a notification should be side to side.)

Bug: 111394067
Test: atest SystemUITests
Change-Id: I861ff0443df6051561991808a760250a68b588fd
2019-06-19 12:48:02 -04:00
Dave Mankoff
7abe135f9e Add PointerCountClassifier to the BrightLineFalsingManager.
False on the lock screen if more than one pointer is detected.

Bug: 111394067
Test: atest SystemUITests
Change-Id: Ibffc78d024644adfcfa2713083b03795a11cecb6
2019-06-19 12:48:02 -04:00
Dave Mankoff
07fb7b7353 Add base class for new falsing manager and classifiers.
This adds no functional changes. It merely adds the framework
for a new FalsingManager.

Change-Id: I7f0e3b1363c847fa1eefa54bf7793508fefd1926
Test: manual.
Bug: 111394067
2019-06-19 12:47:56 -04:00
Ned Burns
2c74c2a980 Reinflate silent notif header on config change
Necessary in order to support locale changes.

Test: manual
Fixes: 135170814
Change-Id: Ic5fd09b539860a1119f1a5f1316c4a1f6c46e111
2019-06-17 17:48:48 -04:00