Commit Graph

54489 Commits

Author SHA1 Message Date
shubang
05d7f90c41 TIF: fix issue of using caller-aware methods after clearCallingIdentity() am: 05363ef193 am: e55bc91578
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15752564

Change-Id: Ifde0bb94cabf013af3fd1d0a63e3b514b12558fe
2021-09-08 00:47:48 +00:00
shubang
e55bc91578 TIF: fix issue of using caller-aware methods after clearCallingIdentity() am: 05363ef193
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15752564

Change-Id: Iaa3b040cc8e47a3a36496b1de033b341a0e9e2e3
2021-09-08 00:37:10 +00:00
shubang
05363ef193 TIF: fix issue of using caller-aware methods after clearCallingIdentity()
Bug: 189824175
Test: atest android.media.tv.cts.TvInputManagerTest
Change-Id: Iced6c2245c0099bc4bcdaceb51f8cce4dbc0a392
(cherry picked from commit a2ab2772d7)
2021-09-07 19:15:05 +00:00
Aseem Kumar
662fcc58ef Prevent apps from spamming addAccountExplicitly. am: 551d70e1c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15624525

Change-Id: If96923b691c90b4d2f6e247db3474aba99183383
2021-09-03 22:19:18 +00:00
Aseem Kumar
551d70e1c8 Prevent apps from spamming addAccountExplicitly.
See comment here for the discussion on solution
https://b.corp.google.com/issues/169762606#comment14

Change-Id: If212df3a3b7be1de0fb26b8e88b2fcbb8077c253

Bug: 169762606
(cherry picked from commit 11053c17b3)

Change-Id: I424e098dd70ae31bbbc7cb2f3eccd1ccc287064b
Merged-In: If212df3a3b7be1de0fb26b8e88b2fcbb8077c253
2021-09-03 19:08:23 +00:00
TreeHugger Robot
7c35716464 Merge "Prevent apps from spamming addAccountExplicitly. See comment here for the discussion on solution https://b.corp.google.com/issues/169762606#comment14" into pi-dev am: a0226b4d47 am: b65ac540d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15405290

Change-Id: Ib461e405d5bd65840fb4f1e962cdd5d1061a882f
2021-09-01 00:49:59 +00:00
TreeHugger Robot
b65ac540d2 Merge "Prevent apps from spamming addAccountExplicitly. See comment here for the discussion on solution https://b.corp.google.com/issues/169762606#comment14" into pi-dev am: a0226b4d47
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15405290

Change-Id: I0073721ed49e40043625eae71f37e7e95b987340
2021-09-01 00:34:01 +00:00
TreeHugger Robot
a0226b4d47 Merge "Prevent apps from spamming addAccountExplicitly. See comment here for the discussion on solution https://b.corp.google.com/issues/169762606#comment14" into pi-dev 2021-09-01 00:11:36 +00:00
Aseem Kumar
5beff34b57 Prevent apps from spamming addAccountExplicitly.
See comment here for the discussion on solution
https://b.corp.google.com/issues/169762606#comment14

Change-Id: If212df3a3b7be1de0fb26b8e88b2fcbb8077c253

Bug: 169762606
(cherry picked from commit 11053c17b3)

Change-Id: I6494366a5695daedc3f4f0046da9e130a5363f5f
Merged-In: If212df3a3b7be1de0fb26b8e88b2fcbb8077c253
2021-08-19 09:52:26 +00:00
Sudheer Shanka
b95ca39e29 Merge "Add SafetyNet logging if a certain broadcast is received by apps." into qt-dev am: e8426090a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15301703

Change-Id: I56e45bdc455fe62f0f26a4e49b35deaab56206b0
2021-08-11 02:56:07 +00:00
Sudheer Shanka
98adfca8a6 Merge "Add SafetyNet logging if a certain broadcast is received by apps." into pi-dev 2021-08-11 02:55:31 +00:00
Sudheer Shanka
e8426090a6 Merge "Add SafetyNet logging if a certain broadcast is received by apps." into qt-dev 2021-08-11 02:51:07 +00:00
Sudheer Shanka
8252fb118c Merge "Send targeted broadcasts to prevent other apps from receiving them." into qt-dev am: 0925f07c25
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15053176

Change-Id: I09a0140925f7c851ff64a131c5ad233161b91625
2021-08-11 02:39:23 +00:00
Sudheer Shanka
df8ca125d6 Merge "Send targeted broadcasts to prevent other apps from receiving them." into pi-dev 2021-08-11 02:29:11 +00:00
Sudheer Shanka
0925f07c25 Merge "Send targeted broadcasts to prevent other apps from receiving them." into qt-dev 2021-08-11 02:27:05 +00:00
Sudheer Shanka
ad79043436 Add SafetyNet logging if a certain broadcast is received by apps.
In case the broadcast intents "com.android.server.net.action.SNOOZE_WARNING"
or "com.android.server.net.action.SNOOZE_RAPID" are dispatched to apps,
then add a SafetyNet log.

Bug: 177931370
Test: manual
Change-Id: I65b2e96ff1230b2051dd1e5bd9c21e5ba3e1146a
Merged-In: I65b2e96ff1230b2051dd1e5bd9c21e5ba3e1146a
(cherry picked from commit a22e341ac2)
2021-07-15 18:04:32 +00:00
Sudheer Shanka
452a5aeec5 Add SafetyNet logging if a certain broadcast is received by apps.
In case the broadcast intents "com.android.server.net.action.SNOOZE_WARNING"
or "com.android.server.net.action.SNOOZE_RAPID" are dispatched to apps,
then add a SafetyNet log.

Bug: 177931370
Test: manual
Change-Id: I65b2e96ff1230b2051dd1e5bd9c21e5ba3e1146a
Merged-In: I65b2e96ff1230b2051dd1e5bd9c21e5ba3e1146a
(cherry picked from commit a22e341ac2)
2021-07-15 18:04:10 +00:00
Bernardo Rufino
57af3050d2 Merge "Fix background bypass via notifications" into qt-dev am: 22500563c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14937196

Change-Id: I193bfe3aa08c2f397d037c2d5c71cfe854cd343d
2021-06-30 15:30:23 +00:00
Dmitry Dementyev
44c434d747 Merge "Change ownership of the account request notification." into oc-mr1-dev am: aaccd1b152 am: c9fdb5f38e am: 1d8503c538
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15016192

Change-Id: I93156cc3c12743f000ca5f1d0b2d8349216bf577
2021-06-30 15:29:38 +00:00
Bernardo Rufino
22500563c1 Merge "Fix background bypass via notifications" into qt-dev 2021-06-30 07:18:28 +00:00
Dmitry Dementyev
1d8503c538 Merge "Change ownership of the account request notification." into oc-mr1-dev am: aaccd1b152 am: c9fdb5f38e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15016192

Change-Id: I9958960adcd72f402c545763ff89b67fb0af66a1
2021-06-29 20:04:26 +00:00
Dmitry Dementyev
c9fdb5f38e Merge "Change ownership of the account request notification." into oc-mr1-dev am: aaccd1b152
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15016192

Change-Id: I6aca96a54021efb9d212dbb18490482b11f60f5e
2021-06-29 19:50:37 +00:00
Dmitry Dementyev
aaccd1b152 Merge "Change ownership of the account request notification." into oc-mr1-dev 2021-06-29 19:35:04 +00:00
TreeHugger Robot
976266733d Merge "Don't attach private Notification to A11yEvent when user locked" into qt-dev 2021-06-28 20:25:15 +00:00
TreeHugger Robot
075e4bbbb2 Merge "Don't attach private Notification to A11yEvent when user locked" into oc-mr1-dev 2021-06-28 18:50:57 +00:00
TreeHugger Robot
fa06b865c9 Merge "Don't attach private Notification to A11yEvent when user locked" into pi-dev 2021-06-28 18:39:50 +00:00
Dmitry Dementyev
26de0c231f Change ownership of the account request notification.
Add "Permission requested by Application..." string.
Test: manual
Bug: 179338675

Change-Id: Ib66ccc1b39bd1f3f8fa3b1efc38a9d413b72a321
2021-06-25 19:27:26 -07:00
Hai Zhang
bd70751b40 DO NOT MERGE Add cross-user check for getDefaultSmsPackage(). am: 0abccabffe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14987346

Change-Id: I1a74f3b531bc1fadec79e05042094772d7d770eb
2021-06-26 00:45:22 +00:00
TreeHugger Robot
71ee31239e Merge "DO NOT MERGE Add cross-user check for getDefaultSmsPackage()." into qt-dev 2021-06-26 00:32:23 +00:00
Christopher Tate
cb8e4e8db6 Fix side effects of trace-ipc and dumpheap commands am: 4c0b9a5fbd am: 5518a714f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14982641

Change-Id: I2cd91b0de1757c122625b2535a10b5092d57d42a
2021-06-25 18:12:21 +00:00
Christopher Tate
5518a714f3 Fix side effects of trace-ipc and dumpheap commands am: 4c0b9a5fbd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14982641

Change-Id: I10aa11a0945092a01a1d27c8b4cbba0b91ac37ca
2021-06-25 17:47:35 +00:00
Bernardo Rufino
14c1c7b4a7 Fix background bypass via notifications
This is a CP of ag/14736230 to qt-dev.

Apps were able to bypass BAL and BG-FGS restrictions by retrieving their
own notifications and firing their PI since those were allowlisted for
those operations.

Now we strip the token that granted them that ability
from notifications returned via NM.getActiveNotifications(), which
returns the notifications of the caller.

Notifications returned via notification listener APIs still contain such
token, as they should.

Bug: 185388103
Bug: 169821287
Test: Manually tested
Change-Id: I2ede0d639a560f6acacec3864a0a7d23af152ba5
Merged-In: I2ede0d639a560f6acacec3864a0a7d23af152ba5
(cherry picked from commit 5fbeff59df)
2021-06-24 18:15:04 +00:00
Steve Elliott
49be6ee46a Don't attach private Notification to A11yEvent when user locked
Fixes: 159624555
Test: manual, atest
Change-Id: Ib44f1d3695d2b31bee4f8ccae3f948c83f3b40b6
Merged-In: Ib44f1d3695d2b31bee4f8ccae3f948c83f3b40b6
(cherry picked from commit 54fbccc293)
2021-06-24 14:47:09 +00:00
Steve Elliott
f7f339c7d0 Don't attach private Notification to A11yEvent when user locked
Fixes: 159624555
Test: manual, atest
Change-Id: Ib44f1d3695d2b31bee4f8ccae3f948c83f3b40b6
Merged-In: Ib44f1d3695d2b31bee4f8ccae3f948c83f3b40b6
(cherry picked from commit 54fbccc293)
2021-06-24 01:47:01 +00:00
Steve Elliott
93f167b8f5 Don't attach private Notification to A11yEvent when user locked
Fixes: 159624555
Test: manual, atest
Change-Id: Ib44f1d3695d2b31bee4f8ccae3f948c83f3b40b6
Merged-In: Ib44f1d3695d2b31bee4f8ccae3f948c83f3b40b6
(cherry picked from commit 54fbccc293)
2021-06-24 01:44:44 +00:00
Sudheer Shanka
29eb352baa Send targeted broadcasts to prevent other apps from receiving them.
When sending broadcasts ACTION_SNOOZE_WARNING in NPMS, which may
contain sensitive information, explicitly set the package name
that should receive it to prevent other apps from receiving them.

Bug: 177931370
Test: manual
Change-Id: I11d736771d859d2af27d5c84a502ab038974e2e2
Merged-In: I11d736771d859d2af27d5c84a502ab038974e2e2
(cherry picked from commit 1494979a6a)
2021-06-21 17:15:53 +00:00
Sudheer Shanka
c72848f9fe Send targeted broadcasts to prevent other apps from receiving them.
When sending broadcasts ACTION_SNOOZE_WARNING in NPMS, which may
contain sensitive information, explicitly set the package name
that should receive it to prevent other apps from receiving them.

Bug: 177931370
Test: manual
Change-Id: I11d736771d859d2af27d5c84a502ab038974e2e2
Merged-In: I11d736771d859d2af27d5c84a502ab038974e2e2
(cherry picked from commit 1494979a6a)
2021-06-21 04:52:48 +00:00
Hai Zhang
0abccabffe DO NOT MERGE Add cross-user check for getDefaultSmsPackage().
Bug: 177927831
Test: atest RoleSecurityTest
Change-Id: I1254804fb72a299e782d45f938acdf979a82f904
2021-06-20 03:19:27 +00:00
Christopher Tate
6984eaa9f4 Fix side effects of trace-ipc and dumpheap commands
These shell commands were implicitly deleting any client-named file for
which the system uid had deletion capability.  They no longer do this,
instead using only the client's own capabilities and file manipulation
modes.

Bug: 185398942
Test: manual "adb shell cmd activity dumpheap system_server /data/system/last-fstrim"
Test: atest CtsPermissionTestCases:ShellCommandPermissionTest
Merged-In: Ie61ab2c3f4bfbd04de09ca99c1116d1129461e8f
Change-Id: Ie61ab2c3f4bfbd04de09ca99c1116d1129461e8f
2021-06-18 22:19:47 +00:00
Christopher Tate
4c0b9a5fbd Fix side effects of trace-ipc and dumpheap commands
These shell commands were implicitly deleting any client-named file for
which the system uid had deletion capability.  They no longer do this,
instead using only the client's own capabilities and file manipulation
modes.

Bug: 185398942
Test: manual "adb shell cmd activity dumpheap system_server /data/system/last-fstrim"
Test: atest CtsPermissionTestCases:ShellCommandPermissionTest
Merged-In: Ie61ab2c3f4bfbd04de09ca99c1116d1129461e8f
Change-Id: Ie61ab2c3f4bfbd04de09ca99c1116d1129461e8f
2021-06-18 22:14:11 +00:00
Christopher Tate
3555fa2f09 Fix side effects of trace-ipc and dumpheap commands
These shell commands were implicitly deleting any client-named file for
which the system uid had deletion capability.  They no longer do this,
instead using only the client's own capabilities and file manipulation
modes.

Bug: 185398942
Test: manual "adb shell cmd activity dumpheap system_server /data/system/last-fstrim"
Test: atest CtsPermissionTestCases:ShellCommandPermissionTest
Merged-In: Ie61ab2c3f4bfbd04de09ca99c1116d1129461e8f
Change-Id: Ie61ab2c3f4bfbd04de09ca99c1116d1129461e8f
2021-06-16 23:24:25 +00:00
Daniel Sandler
1f0a6621ad Merge "Fix race condition between lockNow() and updateLockscreenTimeout" into qt-dev am: 7e742dca13
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14673294

Change-Id: I52ec38b96a54250bf25ef0da255e20b7a2f65f71
2021-06-10 14:25:04 +00:00
Jorim Jaggi
1692babe5e Fix race condition between lockNow() and updateLockscreenTimeout
If updateLockscreenTimeout gets called before the Runnable queued
from lockNow gets executed, lockNow request will be ignored. Fix
this by not clearing out the runnable if it's pending lock request.

Test: Switch user, ensure lockscreen comes up
Bug: 161149543
Change-Id: Ie486396fd7328edf8ca0912df92524bb82a1fb7f
(cherry picked from commit 875fa991aa)
Merged-In: Ie486396fd7328edf8ca0912df92524bb82a1fb7f
2021-05-21 11:40:18 +00:00
Jorim Jaggi
1d31270fd2 Fix race condition between lockNow() and updateLockscreenTimeout
If updateLockscreenTimeout gets called before the Runnable queued
from lockNow gets executed, lockNow request will be ignored. Fix
this by not clearing out the runnable if it's pending lock request.

Test: Switch user, ensure lockscreen comes up
Bug: 161149543
Change-Id: Ie486396fd7328edf8ca0912df92524bb82a1fb7f
(cherry picked from commit 875fa991aa)
Merged-In: Ie486396fd7328edf8ca0912df92524bb82a1fb7f
2021-05-21 11:38:37 +00:00
Jorim Jaggi
1fc88c383e Fix race condition between lockNow() and updateLockscreenTimeout
If updateLockscreenTimeout gets called before the Runnable queued
from lockNow gets executed, lockNow request will be ignored. Fix
this by not clearing out the runnable if it's pending lock request.

Test: Switch user, ensure lockscreen comes up
Bug: 161149543
Change-Id: Ie486396fd7328edf8ca0912df92524bb82a1fb7f
(cherry picked from commit 875fa991aa)
Merged-In: Ie486396fd7328edf8ca0912df92524bb82a1fb7f
2021-05-21 11:34:10 +00:00
Nate Myren
2f2fa37a18 Ensure storage permission revoke happens for all users am: 387182eb49
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14357211

Change-Id: Icf0e785e3ee908301240ca5c2eb63a8d21ac7b07
2021-05-12 17:36:11 +00:00
lucaslin
e97d1f5484 Fix the security issue that preloaded apps can get SSID & BSSID
NetworkMonitor sends "android.net.conn.NETWORK_CONDITIONS_MEASURED"
broadcast with Wifi SSID & BSSID. The receiver of this broadcast
is only required to have "android.permission.ACCESS_NETWORK_CONDITIONS"
permission but not the "android.permission.ACCESS_FINE_LOCATION".
It's incorrect because if the apps want to know the Wifi SSID and
BSSID, they should get the run-time permission with user consent.
Since this broadcast is not used anymore, delete it and the related
code.

Bug: 175213041
Test: atest NetworkStackNextTests NetworkStackTests
Change-Id: I12050737291c7fa0ebff4e7411b91f4c6f57a413
Merged-In: I1b8b6a3f4390adbabf92fb9e48da61c47b08b2ec
Merged-In: I7b43940dc32826c70fa82f471b35bc5cb8394aad
2021-05-12 09:16:38 +00:00
lucaslin
0684e7a64a Fix the security issue that preloaded apps can get SSID & BSSID
NetworkMonitor sends "android.net.conn.NETWORK_CONDITIONS_MEASURED"
broadcast with Wifi SSID & BSSID. The receiver of this broadcast
is only required to have "android.permission.ACCESS_NETWORK_CONDITIONS"
permission but not the "android.permission.ACCESS_FINE_LOCATION".
It's incorrect because if the apps want to know the Wifi SSID and
BSSID, they should get the run-time permission with user consent.
Since this broadcast is not used anymore, delete it and the related
code.

Bug: 175213041
Test: atest NetworkStackNextTests NetworkStackTests
Change-Id: I12050737291c7fa0ebff4e7411b91f4c6f57a413
Merged-In: I12050737291c7fa0ebff4e7411b91f4c6f57a413
Merged-In: I7b43940dc32826c70fa82f471b35bc5cb8394aad
2021-05-12 09:15:37 +00:00
Nate Myren
387182eb49 Ensure storage permission revoke happens for all users
When revoking storage permissions due to storage escalation, ensure the
revoke happens for all users

Fixes: 186034260
Bug: 171430330
Test: atest --user-type secondary_user StorageEscalationTest
Merged-In: Ieb8bb9cde1576e9eee131338d393b8a3528341ec
Change-Id: Ieb8bb9cde1576e9eee131338d393b8a3528341ec
2021-04-30 21:22:55 +00:00
Julia Reynolds
d61aae299c Restrict alarm broadcast
To android only

Test: NotificationManagerTest, NotificationManagerServiceTest
Bug: 175614289
Change-Id: I4f8e56729d90f8f5288d08881129b1c45d5790e7
Merged-In: I4f8e56729d90f8f5288d08881129b1c45d5790e7
(cherry picked from commit abf15b731a)
(cherry picked from commit 4056976f1e)
(cherry picked from commit f1e84b42b1)
2021-04-29 15:30:43 +00:00