Commit Graph

33931 Commits

Author SHA1 Message Date
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
TreeHugger Robot
2688770c06 Merge "RESTRICT AUTOMERGE" into oc-dev 2020-06-03 11:15:08 +00:00
TreeHugger Robot
b539388631 Merge "RESTRICT AUTOMERGE" into oc-mr1-dev 2020-06-03 11:09:39 +00:00
Christopher Tate
153de338c1 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
Change-Id: Ibaf087946966ad82d60c7b255e3ee75990716b63
2020-06-02 04:12:00 +00:00
Jing Ji
9450069de9 More fixes towards the race conditions in AMS
Bug: 142986887
Bug: 140108616
Test: Manual
Change-Id: I6e0bdc8c02bab54f6278096b3a3acadd97c064c6
Merged-In: I6e0bdc8c02bab54f6278096b3a3acadd97c064c6
(cherry picked from commit b2e84f0406)
2020-05-26 22:04:59 +00:00
Winson
40ca8b51fa DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package
Without this check, any package can set the installer package of
another package whose installer has been removed or was never set.
This provides access to other privileged actions and is undesired.

Bug: 150857253

Test: manual verify with proof of concept in linked bug
Test: atest android.appsecurity.cts.PackageSetInstallerTest

Change-Id: I2159c357911ff39ffd819054b42f96ae86bc98bc
2020-05-21 17:17:53 +00:00
Winson
fc8bfed553 DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package
Without this check, any package can set the installer package of
another package whose installer has been removed or was never set.
This provides access to other privileged actions and is undesired.

Bug: 150857253

Test: manual verify with proof of concept in linked bug
Test: atest android.appsecurity.cts.PackageSetInstallerTest

Change-Id: I2159c357911ff39ffd819054b42f96ae86bc98bc
2020-05-21 17:15:11 +00:00
lumark
748bcb047c [RESTRICT AUTOMERGE] Restrict app transition maximum duration am: 36bcc77337 am: dcc38988ee
Change-Id: Ied1793dbc8d7b58170e22729aa351c582c894ffa
2020-05-05 21:32:53 +00:00
lumark
dcc38988ee [RESTRICT AUTOMERGE] Restrict app transition maximum duration am: 36bcc77337
Change-Id: Ia049c055935fdc0ceb0369cf131e7d166e5522f6
2020-05-05 21:04:59 +00:00
Bryan Ferris
6255311d39 Merge "[RESTRICT AUTOMERGE] Restrict app transition maximum duration" into oc-dev 2020-05-05 20:49:41 +00:00
Linus Tufvesson
2bf126d042 RESTRICT AUTOMERGE
This change is the union of
I2aaab1903dee54190338f7b6e49888aa51437108 and I58834636e092f992e403342e36b475dc60e8f20ai

Original CL descriptions:

*** I2aaab1903dee54190338f7b6e49888aa51437108
Block TYPE_PRESENTATION windows on default display

... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

*** I58834636e092f992e403342e36b475dc60e8f20a
Use TYPE_PRIVATE_PRESENTATION for private presentations
Detect if the Presenation is targeting a private virtual display, and if they
are use the windowType TYPE_PRIVATE_PRESENTATION.
***

Bug: 141745510
Test: cts-tradefed run cts -m CtsDisplayTestCases -t android.display.cts.VirtualDisplayTest
Test: Manually verfied that presentations are blocked on main display
Change-Id: I67c79c84ec2adfcdaf3b0f7bc7f0f41d30618e85
2020-05-05 18:55:09 +01:00