Commit Graph

32833 Commits

Author SHA1 Message Date
Matt Pietal
2663e8aa43 Merge "[DO NOT MERGE] Update window with FLAG_SECURE when bouncer is showing" into qt-dev 2022-09-27 19:25:13 +00:00
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
Matt Pietal
a30148b8a4 [DO NOT MERGE] Do not dismiss keyguard after SIM PUK unlock
After PUK unlock, multiple calls to
KeyguardSecurityContainerController#dismiss() were being called from
the KeyguardSimPukViewController, which begins the transition to the
next security screen, if any. At the same time, other parts of the
system, also listening to SIM events, recognize the PUK unlock and
call KeyguardSecurityContainer#showSecurityScreen, which updates which
security method comes next. After boot, this should be one of PIN,
Password, Pattern, assuming they have a security method. If one of the
first dismiss() calls comes AFTER the security method changes, this is
incorrectly recognized by the code as a successful
PIN/pattern/password unlock. This causes the keyguard to be marked as
done, causing screen flickers and incorrect system state.

The solution: every call to dismiss() should include a new parameter
for the security method used. If there is a difference between this
parameter and the current value in KeyguardSecurityContainerCallback,
ignore the request, as the system state has changed.

Bug: 218500036
Test: atest KeyguardSecurityContainerTest

Merged-In: I7c8714a177bc85fbce92f6e8fe911f74ca2ac243
Change-Id: I30226bc7b5eda9480d471b35fe81e106b0491ff8
2022-09-14 14:49:28 +00:00
Jeff DeCew
8ce3c53fcf Block FullScreenIntent while device is in use if notification has a silencing GroupAlertBehavior.
Bug: 231322873
Test: atest NotificationInterruptStateProviderImplTest
Merged-In: Id82d20c9f1f2001400871b5381f52b40fbdf81c5
Change-Id: Id82d20c9f1f2001400871b5381f52b40fbdf81c5
2022-07-20 01:13:11 +00:00
Jeff DeCew
4ac20f1255 Prevent a crash when constructing NSSL.
The dependent change was validated on qt-dev and rvc-dev, but not explicitly on qt-qpr1-dev.
 - In qt-dev, we didn't have this check that the footer view was initialized, but hasActiveClearableNotifications did not call into the mDynamicPrivacyController (it didn't exist), so there was no initialization-time NPE.
 - In rvc-dev this footer view check existed, so updateFooter never did any work until setFooterView was called, which is strictly after mDynamicPrivacyController is initialized, so there was no crash.
 - In qt-qpr1-dev, mDynamicPrivacyController was added and is checked within updateFooter, but updateFooter didn't have the view check to short circuit before doing that on initialization.

Bug: 193149550
Fixes: 206344625
Test: manually run qt-qpr1-dev with and without fix
Depends-On: I49e2b8bcec7b2ce0a9776ff30a64c07f24949da7
Change-Id: If6e99b5fbe3d2a9d9274223c35d23c30f5524229
2022-01-11 15:27:05 +00:00
Dave Mankoff
d7097b817b RESTRICT AUTOMERGE Remove line of code that was mistakently left in.
This line was removed in O, S, & P, but somehow survived in the Q and R branches.

Bug: 193444889
Merged-In: I56589865427b10e2eab68e1ed2e7c290572a9edc
Change-Id: I56589865427b10e2eab68e1ed2e7c290572a9edc
2021-11-17 19:21:07 +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
Sunny Goyal
7ff5163b2d [DO NOT MERGE] Fixing unsafe pending intent in notification
Bug: 173025705
Test: Manual
Change-Id: I37e807fffe9ad67caa93a91d5e350350514989ab
2021-08-31 10:51:20 -07:00
Dave Mankoff
55cd8952c0 Guard DISABLE_PLUGIN with PLUGIN permission.
Fixes a p0 security bug. We already have the plugin permission
defined in our manifest. Ensure that senders of the DISABLE_PLUGIN
broadcast have that permission.

Bug: 193444889
Test: manual
Change-Id: Iebaba435c17c5644c5357c0683858447f5ffb897
Merged-In: Iebaba435c17c5644c5357c0683858447f5ffb897
2021-07-22 13:06:57 +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
0e2acaf0a5 DO NOT MERGE: Fix interaction tracking logic
Tried to put a clever kotlin-ism there, but then the interaction tracker
was returning `true` for every notification because it only checked if
the key existed

Test: manual
Bug: 144324894
Bug: 119041698
Change-Id: Ie2f489acca973c0aebbd8e7d8fc7fbef2bac793f
2021-02-01 18:19:22 -05: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
Miranda Kephart
ed450d77ed [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable
Mutable pending intents are a security risk. This change adds the
IMMUTABLE flag to all PendingIntents created in GlobalScreenshot.

Bug: 162738636
Test: manual
Change-Id: I1044b6aaf2b1650ff91d9a72181684d2aaea9a62
2020-11-09 16:09:20 +00:00
Miranda Kephart
f4eefc55c4 [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable
Mutable pending intents are a security risk. This change adds the
IMMUTABLE flag to all PendingIntents created in GlobalScreenshot.

Bug: 162738636
Test: manual
Change-Id: I1044b6aaf2b1650ff91d9a72181684d2aaea9a62
2020-11-09 16:07:30 +00:00
Pinyao Ting
6d9794aa9f remove sensitive pii from safetynet logging
Bug: 159145361
Test: manual
Change-Id: I8f1be55971672c7e8f5aa8848f65b1b9d9f40fb5
Merged-In: I8f1be55971672c7e8f5aa8848f65b1b9d9f40fb5
(cherry picked from commit 3b6905bf6a)
2020-10-14 19:27:21 +00:00
Pinyao Ting
391c143418 remove sensitive pii from safetynet logging
Bug: 159145361
Test: manual
Change-Id: I8f1be55971672c7e8f5aa8848f65b1b9d9f40fb5
Merged-In: I8f1be55971672c7e8f5aa8848f65b1b9d9f40fb5
(cherry picked from commit 3b6905bf6a)
2020-10-14 19:26:54 +00:00
Pinyao Ting
4cab9c3876 Fix the issue provider can be wrong when requesting slice permission
SlicePermissionActivity reads provider_pkg from intent, which can be
modified at will. As a result user might see incorrect package name in
the dialog granting slice permission.

Bug: 159145361
Test: manual
Merged-In: I8b66c02786df4096dad74b7e76255d5ddd1d609d
Change-Id: I8b66c02786df4096dad74b7e76255d5ddd1d609d
(cherry picked from commit 0ad32a2d70)
2020-09-24 15:33:58 -07:00
Pinyao Ting
149bb7e038 Fix the issue provider can be wrong when requesting slice permission
SlicePermissionActivity reads provider_pkg from intent, which can be
modified at will. As a result user might see incorrect package name in
the dialog granting slice permission.

Bug: 159145361
Test: manual
Merged-In: I8b66c02786df4096dad74b7e76255d5ddd1d609d
Change-Id: I8b66c02786df4096dad74b7e76255d5ddd1d609d
(cherry picked from commit 0ad32a2d70)
2020-09-24 19:06:32 +00:00
Steve Elliott
db245b0310 Mark implicit PendingIntents as immutable
Bug: 156020795
Test: manual, atest
Change-Id: I72206c7a52b067b77d6542d170a6483713dfeee7
(cherry picked from commit 84e08280d3)
2020-08-04 20:24:45 +00:00
Steve Elliott
599c3e4b75 Mark implicit PendingIntents as immutable
Bug: 156020795
Test: manual, atest
Change-Id: I72206c7a52b067b77d6542d170a6483713dfeee7
(cherry picked from commit 84e08280d3)
2020-08-04 20:22:46 +00:00
Lucas Dupin
6dbda27f98 Require a more specific intent
Bug: 147606347
Fixes: 161150380
Test: run poc, device didn't reboot
Change-Id: I8f721ca659d58271880a7adbf386b270b331e55b
Merged-In: I8f721ca659d58271880a7adbf386b270b331e55b
(cherry picked from commit a9afc32ddc)
(cherry picked from commit d16e86f466)
2020-07-28 23:49:31 +00:00
Beth Thibodeau
64049fad82 Make view intent immutable
Bug: 156959408
Test: manual, atest
Change-Id: I80de1ea9c4535559f4ca2838a66da9e19eacf49d
(cherry picked from commit 4cecd359ab)
2020-06-16 21:03:09 +00:00
Ahan Wu
34c8ecdf28 DO NOT MERGE Prevent ImageWallpaper from crashing due to wide gamut
ImageWallpaper may fail at either uploading texture or computing the
histogram of the bitmap, we catch the unexpected exceptions to avoid
crashing the whole process. In addition, we also take wide gamut into
account while computing the histogram.

Bug: 156087409
Test: Set 1.jpg of #34 in the bug as wallpaper.
Test: The symptom should not happen.
Change-Id: I931912ece0f7cdfcb388efc8e61799f0087c5199
2020-06-03 10:57:00 +08:00
TreeHugger Robot
7974d15859 Merge "Make implicit intent immutable." into qt-dev 2020-06-02 04:40:43 +00:00
Julia Reynolds
f596432fde DO NOT MERGE Make intents immutable
Test: make
Fixes: 154719656
Change-Id: I212ca5f1a48174ed85311b551259da314718f082
Merged-In: I212ca5f1a48174ed85311b551259da314718f082
(cherry picked from commit 36b3352784)
2020-06-01 16:22:46 +00:00
Julia Reynolds
f4619d699f Make intents immutable
Test: make
Fixes: 154719656
Change-Id: I212ca5f1a48174ed85311b551259da314718f082
(cherry picked from commit 36b3352784)
2020-05-28 18:26:22 +00:00
Jeff DeCew
7aae8cce33 Make implicit intent immutable.
(cherry picked from commit e42611f83c)

Test: make
Fix: 154627439
Change-Id: Ifee830595bb145aede4dad1d9e42a20e54b6be66
Merged-In: Ifee830595bb145aede4dad1d9e42a20e54b6be66
2020-05-15 19:23:33 +00:00
Lucas Dupin
d16e86f466 Require a more specific intent
Fixes: 147606347
Test: run poc, device didn't reboot
Change-Id: I8f721ca659d58271880a7adbf386b270b331e55b
Merged-In: I8f721ca659d58271880a7adbf386b270b331e55b
(cherry picked from commit a9afc32ddc)
2020-03-26 00:37:00 +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
TreeHugger Robot
da2466a36d Merge "DO NOT MERGE back porting for fixing sysui direct reply" into pi-dev 2019-12-12 02:38:28 +00:00
Abodunrinwa Toki
4828033816 Merge "RESTRICT AUTOMERGE Disable TextClassifier for RemoteInputView." into pi-dev 2019-12-11 21:58:38 +00:00
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
TreeHugger Robot
319f57f0d7 Merge "DO NOT MERGE: Disable SpellChecker in secondary user's direct reply" into pi-dev 2019-12-11 21:10:46 +00:00
Yohei Yukawa
08391b3da7 DO NOT MERGE back porting for fixing sysui direct reply
Root cause: systemui run as user 0 service to handle all of users'
notifications. And, the users can user the copy/cut/paste
functionality.

Solution: To crate @hide API in TextView let SystemUI to mark the
TextView instance should check if the power of
INTERACT_ACROSS_USER_FULL is needed to be restricted.
e.x. Keyguard password textview/Notificaiton entries

Bug: 123232892
Test: manual test
Reference: I6d11e4d6a84570bc2991a8552349e8b216b0d139
Reference: Ibabe13e5b85e5bb91f9f8af6ec07c395c25c4393
Reference: I975baa748c821538e5a733bb98a33ac609bf40a7

Change-Id: I6d11e4d6a84570bc2991a8552349e8b216b0d139
Merged-In: Ie3daecd1e8fc2f7fdf37baeb5979da9f2e0b3937
2019-11-05 15:43:12 +08: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
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
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
Beth Thibodeau
628f975c22 Merge "Revert "Stop timer when notification isn't visible"" into qt-dev 2019-07-31 20:31:53 +00:00