Commit Graph

33941 Commits

Author SHA1 Message Date
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
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
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
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
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
Julia Reynolds
3b0fc6bd38 Merge "Restrict alarm broadcast" into oc-mr1-dev 2021-04-27 16:57:51 +00:00
Louis Chang
6820d70823 Detects all activities for whether showing work challenge
Work challenge did not show when a work activity is not on top, but
still visible after screen turns on.

Also show work challenge even if the work activity is behind a top
fullscreen activity of another profile because the user can still
navigate back to the work activity when top activity finishes.

Bug: 177457096
Test: ActivityStackSupervisorTests

Change-Id: I5e09b09be547d04fdfd709cb9cd4bcd4a94bbf21
Merged-In: I5e09b09be547d04fdfd709cb9cd4bcd4a94bbf21
2021-04-19 09:17:19 +00:00
Julia Reynolds
7dfcfe85ae Restrict alarm broadcast
To android only

Test: NotificationManagerTest, NotificationManagerServiceTest
Bug: 175614289
Change-Id: I4f8e56729d90f8f5288d08881129b1c45d5790e7
Merged-In: I4f8e56729d90f8f5288d08881129b1c45d5790e7
(cherry picked from commit abf15b731a)
2021-04-07 20:10:35 +00:00
Chris Tate
6cc887c00d Merge "DO NOT MERGE - Disallow deletion of channels with FGS notifications" into oc-mr1-dev 2021-04-06 16:24:22 +00:00
Christopher Tate
b320763eb8 DO NOT MERGE - Disallow deletion of channels with FGS notifications
Bug: 156090809
Test: atest CtsAppTestCases:NotificationManagerTest
Test: atest CtsAppTestCases:android.app.cts.ServiceTest
Change-Id: I1c2bb78d86f194585d273661cecf3419f51965df
Merged-In: Ie917a4d1b4595a576c4ea5ea079ecc773000abdc
2021-03-19 04:24:37 +00:00
TreeHugger Robot
835ab4eb82 Merge "Adds caller check to getAllPackages()" into oc-mr1-dev 2021-03-03 18:05:52 +00:00
yawanng
cca5bf9282 Adds caller check to getAllPackages()
This change enforces that only system, root or shell may call
getAllPackages(), a hidden API that shares all package names regardless
of user, instant app or package visibility rules.

Bug: 174661955
Change-Id: I77460ae19a4d41151577646441f11e2eddbb741a
Merged-In: I77460ae19a4d41151577646441f11e2eddbb741a
(cherry picked from commit 8124efd57b)
2021-03-03 16:04:13 +00:00
TreeHugger Robot
119ebe193f Merge "Add pkg target to snoozing alarm" into oc-mr1-dev 2021-03-03 02:59:18 +00:00
Winson Chiu
ffe45e4497 Revert "Only allow BROWSABLE && DEFAULT Intents to be always opened"
Reason for revert: Punted to future release due to invalid fix

Bug: 175319005

Merged-In: I00b78d596ee05c5a4a228771bbf8082af2b0ab8a
Change-Id: I78284e0a0dd5c41345753cdd2ed9a518db1df930
2021-03-01 20:50:35 +00:00
Julia Reynolds
1433925beb Add pkg target to snoozing alarm
Test: SnoozeHelperTest
Bug: 174493336
Change-Id: I6aaf80a11dcae2eca41d4647411126ed41587027
(cherry picked from commit 6b5813b1f1)
Merged-In: I6aaf80a11dcae2eca41d4647411126ed41587027
2021-02-23 17:47:58 +00:00
Miranda Kephart
84fcb616be Merge "[DO NOT MERGE] Close screenshot process on user switched" into oc-mr1-dev 2021-02-03 14:23:55 +00:00
Miranda Kephart
8a2656d4b6 [DO NOT MERGE] Close screenshot process on user switched
Currently, we keep the process up even if the user switches,
meaning that in some cases (if the user is switched while the
screenshot UI is up) we will save images to the wrong profile.
This change makes ScreenshotHelper listen for user switches and
close the screenshot service, so that a new screenshot is
guaranteed to be constructed with the correct user's context.

Bug: 170474245
Fix: 170474245
Test: manual -- verified bad state occurs if user switches within
the timeout period, ensured that screenshots work immediately
after switching with this change.

Change-Id: I9d32d0928e6c2bda161d04555438d0dd7afef0ba
(cherry picked from commit 7ef1a5dd15)
2021-01-29 15:03:08 +00:00
TreeHugger Robot
f4a729180c Merge "Only allow BROWSABLE && DEFAULT Intents to be always opened" into oc-mr1-dev 2021-01-28 21:33:04 +00:00
Winson
2565d0b3a1 Only allow BROWSABLE && DEFAULT Intents to be always opened
Auto verification of app links requires that an intent filter declare
action=VIEW, scheme=HTTP(S), category=BROWSABLE. However,
PackageManagerService was not taking that into account, missing the
category requirement.

But the app info Settings UI did take category into account, so it was
possible for a user to set an application to automatically open web URIs
without understanding that this also granted domains that were not
visible in the app info UI.

To resolve both this, this change makes it so that both auto
verification and the Settings state can only consider the app as
"always" open only if the Intent contains both BROWSABLE and DEFAULT.

Bug: 175139501
Bug: 175319005

Test: manual, see bug for reproduction steps

Merged-In: Ib957258735893bf2779bed19bd400c6726ee6478
Change-Id: Ib957258735893bf2779bed19bd400c6726ee6478
(cherry picked from commit 4266f938c6)
2021-01-12 16:48:38 +00:00
Robert Carr
9661bf7a40 DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL.
NO_INPUT_CHANNEL is a hidden WM flag that allows creation of a window
without an input channel. Unfortunately in releases prior to Android R
this would allow creation of a Window which will not be known to the
InputDispatcher at all. This means that the logic generating
FLAG_OBSCURED will work and a window will be able to overlay another
window without the overlayed window being notified. In Android R and
later this isn't a problem as the InputDispatcher is informed of all
windows, input channel or not. For past Android releases, this patch
disables NO_INPUT_CHANNEL for use outside of the WM.

Bug: 152064592
Test: Existing tests pass
Change-Id: I7e1f45cba139eab92e7df88d1e052baba0ae2cc6
2020-12-14 18:32:56 +00:00
Varun Shah
79062d7903 RESTRICT AUTOMERGE
Ensure caller identity is restored in CP quick-path.

Bug: 172935267
Test: PoC in bug
Change-Id: I469bde7d0a0f89c94f1234cf40983395048962e2
2020-11-23 14:24:23 -08:00
Curtis Belmonte
1a673296ae Merge "DO NOT MERGE Check fingerprint client against top activity in auth callback" into oc-mr1-dev 2020-11-09 21:36:29 +00:00
Philip P. Moltmann
37beb3172b Merge changes from topic "12940341" into oc-dev am: a9a03ae669 am: b172aaf747
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12987876

Change-Id: I90e00bb137edc75878d99f849631db40cd7ffa17
2020-11-09 18:04:05 +00:00
Philip P. Moltmann
b2152f32f4 Ensure permissions are revoked on state changes am: 3dfb544626 am: ebfe073540
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12940341

Change-Id: I8abf9d6c3d9014bad2a24a2276b9747ac04ff970
2020-11-09 18:03:57 +00:00
Philip P. Moltmann
b172aaf747 Merge changes from topic "12940341" into oc-dev am: a9a03ae669
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12987876

Change-Id: I8c63d7910a37c7c994611ac7c6c19d1e1f6bdc94
2020-11-09 17:28:33 +00:00
Philip P. Moltmann
ebfe073540 Ensure permissions are revoked on state changes am: 3dfb544626
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12940341

Change-Id: Ib991fcf4d56b6bd0fd0e7e0c4d6ebce2f7601ee2
2020-11-09 17:28:24 +00:00
Philip P. Moltmann
3dfb544626 Ensure permissions are revoked on state changes
If a permission owner changes, or a permission level is upgraded, revoke
the permission from all packages

Test: Manual
Bug: 154505240
Merged-In: I0dec9eb7c2fecd3147e33e04d3f79f6dffcf7721
Change-Id: I2b3780ba3ae5147026d4c85b3526fe1807724be6
(manually backported from commit a28931a098)
2020-11-04 13:19:00 -08:00
Philip P. Moltmann
dd6911cd57 Revoke permission on non-runtime -> runtime upgrade
Not only on normal -> runtime.

Test: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases --test android.appsecurity.cts.PermissionsHostTest#testNoPermissionEscalationAfterReboot
Bug: 154505240, 168319670
Change-Id: If3b420067b4d7111dcf67ae6f98e42176158b679
Merged-In: If3b420067b4d7111dcf67ae6f98e42176158b679
2020-11-04 13:19:00 -08:00
TreeHugger Robot
83739b6db9 Merge "Fix storing the wrong value of mLockdown in setting" into oc-mr1-dev 2020-10-08 03:40:59 +00:00
Curtis Belmonte
7786f4908f DO NOT MERGE Check fingerprint client against top activity in auth callback
Due to a race condition with activity task stack broadcasts, it's
currently possible for fingerprint authentication to succeed for a
non-top activity. This means, for example, that a malicious overlay
could be drawn in order to mislead the user about what they are
authenticating for.

This commit addresses the issue by adding a check to the fingerprint
authentication client interface that ensures the authenticating
activity is on top at the time of authentication. Otherwise, the
pending authentication will fail, as if an incorrect biometric
been presented.

Test: Follow steps from b/159249069:
1. Install com.pro100svitlo.fingerprintauthdemo from the Play store.
2. Install the PoC attack app from b/159249069.
3. Start the PoC attack app and press the "Launch PoC attack" button.
4. Use fingerprint to authenticate while the overlay is showing.

Before: Authentication succeeds, and a new activity is launched.
After: Authentication fails, and no new activity is launched.

Bug: 159249069
Change-Id: I0707c3f55eaf2a69c6625a3ceb3b5626b3676b26
Merged-In: If5cdf8ffaf3aa7d8a1ac81272e3bfb2cc7cdddf1
Merged-In: Iee6af379515385777984da55048c1efd9339ed88
Merged-In: I9b242a9fee0acbfb430875061e2d809c00fe4b97
Merged-In: I1241a12eafa0bdbac59a8ddd4cf6a0637d467b19
Merged-In: Ie5a0f8c3e9b92d348a78678a6ed192d440c45ffc
Merged-In: I289d67e5c7055ed60f7a96725c523d07cd047b23
2020-10-06 16:05:20 -07:00
wilsonshih
f75396d3c6 Make WallpaperMS bind wallpaper component PendingIntent immutable. am: b392903052
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12718696

Change-Id: I657d45a8a9358ae644cb074804242184f306292a
2020-10-06 16:55:56 +00:00
lucaslin
9226fc3723 Fix storing the wrong value of mLockdown in setting
When user is stopped, the Vpn#onUserStopped() will be called and
the value of mLockdown will be set to false then store into
setting.
This is a wrong behavior because user doesn't change it, so for
this kind of case, there is no need to store the value of
mLockdown in setting.
In fact, there is no need to call Vpn#saveAlwaysOnPackage() when
user is stopped because there is nothing changed.

Bug: 168500792
Test: atest FrameworksNetTests
Change-Id: Ie85a347216614b7873bfdf199165d89527ada3a8
2020-10-05 12:03:28 +00:00
wilsonshih
178da54fc9 Make WallpaperMS bind wallpaper component PendingIntent immutable.
Require that the PendingIntent be immutable so that a malicious app is
not able to hijack and mutate any of the details.

Fixes: 154915372
Test: build & flash, change wallpaper manually.
Change-Id: I59b48811b26736bf0575769107dd940ca33ccf8d
(cherry picked from commit d4bd69cef0)
2020-09-28 17:10:04 +00:00
wilsonshih
b392903052 Make WallpaperMS bind wallpaper component PendingIntent immutable.
Require that the PendingIntent be immutable so that a malicious app is
not able to hijack and mutate any of the details.

Fixes: 154915372
Test: build & flash, change wallpaper manually.
Change-Id: I59b48811b26736bf0575769107dd940ca33ccf8d
(cherry picked from commit d4bd69cef0)
2020-09-28 16:56:57 +00:00
Hai Zhang
043a322e4d DO NOT MERGE Don't allow non-instant permissions for instant apps. am: a710a30457 am: ea36a0c236
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12366889

Change-Id: Id791215e99e121b996892c5c06d9a54a5b7f691d
2020-08-29 01:21:46 +00:00
Hai Zhang
ea36a0c236 DO NOT MERGE Don't allow non-instant permissions for instant apps. am: a710a30457
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12366889

Change-Id: Iab47aca559ae8c13a26507827aadfc0c8b239d74
2020-08-29 01:09:22 +00:00
Hai Zhang
a710a30457 DO NOT MERGE Don't allow non-instant permissions for instant apps.
Bug: 140256621
Test: atest EphemeralTest
Change-Id: Id07342c0347c0b4d2ccb3f58a4af9fda7a20d6ef
2020-08-17 07:40:45 +00:00
Patrick Baumann
929ab61a14 RESTRICT AUTOMERGE
Do not set referrerUri on SessionInfo for non-owners

This change leaves the referrerUri field null when the caller leading to
its production is not the owner of the session.

Bug: 142125338
Test: Manual via test app in related bug
Change-Id: I84679ea0636aa2097e25e23813c48134c9cc1d75
2020-07-31 16:55:24 +00:00
TreeHugger Robot
ef301aba3e Merge "Add missing isShellUser check" into oc-dev am: adc8f21ad1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12099340

Change-Id: Ie74d2561c45785dddc65efc46902a368c8a35736
2020-07-31 05:32:49 +00:00
John Reck
5e2931c656 Add missing isShellUser check
Bug: 160390416
Test: verified command still works from shell
Change-Id: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
(cherry picked from commit 0354261197)
Merged-In: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
2020-07-18 00:32:45 +00:00
John Reck
3a5cd5bbe3 Add missing isShellUser check
Bug: 160390416
Test: verified command still works from shell
Change-Id: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
(cherry picked from commit 0354261197)
Merged-In: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
2020-07-18 00:32:37 +00:00
Christopher Tate
c41fdb42a4 DO NOT MERGE - Only autoVerify at install for new hosts am: 90b716a442
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11689886

Change-Id: I8ff3f48cfd11d3e1a5510a5a93e3f820a84a33b8
2020-06-26 16:36:25 +00:00
Chris Tate
1747090bf8 Merge "DO NOT MERGE - Only autoVerify at install for new hosts" into oc-dev 2020-06-26 16:24:08 +00:00
Chris Tate
178b57c5c5 Merge "Only autoVerify at install for new hosts" into oc-mr1-dev 2020-06-25 23:41:35 +00:00
Chris Tate
239ab1c9d6 Merge "More fixes towards the race conditions in AMS" into oc-mr1-dev 2020-06-03 22:09:12 +00:00
Winson
0ce3ba0c26 DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package am: fc8bfed553
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11384837

Change-Id: I42a87fe06a2634d5fd40119ef46d71a99e147f50
2020-06-03 18:49:15 +00:00
Winson Chiu
a567c14f22 Merge "DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package" into oc-mr1-dev 2020-06-03 18:34:31 +00:00
Winson Chiu
c842acc15a Merge "DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package" into oc-dev 2020-06-03 18:34:30 +00:00
Christopher Tate
90b716a442 DO NOT MERGE - Only autoVerify at install for new hosts
Re-run app link verification at update time only when the set of hosts
has expanded.  Intentionally revoke verify history when an app stops
using autoVerify, as a one-time measure to place it back into the
non-autoverify model for tracking the user's launch preferences.  If the
app starts using autoVerify again later, it behaves identically to an
app that has never done so before.

Bug: 151475497
Bug: 146204120
Test: described on master CL

Merged-In: I200d85085ce79842a3ed39377d1f75ec381c8991
Merged-In: Ibaf087946966ad82d60c7b255e3ee75990716b63
Change-Id: Ibaf087946966ad82d60c7b255e3ee75990716b63
2020-06-03 17:48:30 +00:00
Linus Tufvesson
c2a8913cf0 RESTRICT AUTOMERGE am: 78fe3b0aa2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11375232

Change-Id: I38516ab9216169c555e702947a5448c142648c90
2020-06-03 11:35:02 +00:00