Commit Graph

1421 Commits

Author SHA1 Message Date
TreeHugger Robot
2043c30ace Merge "Add MODIFY_AUDIO_ROUTING permission to shell for CTS test." into sc-dev am: 34cfcb8226
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13959439

Change-Id: I2a54ba30ecac43b8de713a6620047bbf702c5819
2021-04-01 17:25:42 +00:00
Hyundo Moon
9ebc56d6dd Add MODIFY_AUDIO_ROUTING permission to shell for CTS test.
Grant MODIFY_AUDIO_ROUTING permissions to the shell identity
for use within CTS tests.

Bug: 183428114
Test: CTS passed with the permission
Change-Id: I6e8c7553d7fe3263c0345adf0fe67340e5afcbe5
2021-04-01 13:19:40 +09:00
Suprabh Shukla
c3a13a6db0 Merge "Adding a permission to Shell to enable testing" into sc-dev am: 7ff8faf4af
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14015949

Change-Id: I6b7566e00be9168124547d801c46c4ddd63545f3
2021-03-31 21:13:10 +00:00
Suprabh Shukla
7ff8faf4af Merge "Adding a permission to Shell to enable testing" into sc-dev 2021-03-31 21:08:07 +00:00
Suprabh Shukla
6f86e37f42 Adding a permission to Shell to enable testing
Adding SCHEDULE_PRIORITIZED_ALARM permission to Shell so the API can be
called from tests.

Test: Builds, boots.
atest CtsAlarmManagerTestCases:BasicApiTests

Bug: 183661625
Change-Id: I983b0d9d7a5ab417e74feae9dadf4d472d277b20
2021-03-30 22:43:28 -07:00
Bill Yi
4c5df9f411 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Id158bea8432c030b0cb0cdd7ebf8838138c81ce1
2021-03-31 03:37:36 +00:00
Svetoslav Ganov
77591d9942 Merge "Runtime permission attribution improvements" into sc-dev am: a6c3d6ad39
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13692058

Change-Id: Ibad155ee212f6e71800e288a44bbed6012d32838
2021-03-29 21:05:00 +00:00
Svet Ganov
8d2ed50604 Runtime permission attribution improvements
When an app is proxying access to runtime permission protected
data it needs to check whether the calling app has a permission
to the data it is about to proxy which leaves a trace in app ops
that the requesting app perofmed a data access. However, then the
app doing the work needs to get the protected data itself from the
OS which access gets attributed only to itself. As a result there
are two data accesses in app ops where only the first one is a
proxy one that app A got access to Foo through app B - that is the
one we want to show in the permission tracking UIs - and one
for the data access - that is the one we would want to blame on
the calling app, and in fact, these two accesses should be one -
that app A accessed Foo though B. This limitation requires fragile
one off workarounds where both accesses use the same attribution
tag and sys UI has hardcoded rules to dedupe. Since this is not
documented we cannot expect that the ecosystem would reliably
do this workaround in apps that that the workaround in the OS
would be respected by every OEM.

This change adds a mechaism to resolve this issue. It allows for
an app to create an attribution context for another app and then
any private data access thorugh this context would result in a
single app op blame that A accessed Foo though B, i.e. we no longer
have double accounting. Also this can be nested through apps, e.g.
app A asks app B which asks app C for contacts. In this case app
B creates an attribution context for app A and calls into app C
which creates an attribution context for app B. When app C gets
contacts the entire attribution chain would get a porper, single
blame: that C accessed the data, that B got the data from C, and
that A got the data form B. Furthermore, this mechanism ensures
that apps cannot forget to check permissions for the caller
before proxying private data. In our example B and C don't need
to check the permisisons for A and B, respectively, since the
permisisons for the entire attribution chain are checked before
data delivery. Attribution chains are not forgeable preventing
a bad actor to create an arbitrary one - each attribution is
created by the app it refers to and points to a chain of
attributions created by their corresponding apps.

This change also fixes a bug where all content provider accesses
were double counted in app ops due to double noting. While at
this it also fixes that apps can now access their own last ops.
There was a bug where one could not pass null getting the attributed
ops from a historical package ops while this is a valid use case
since if there is no attribution everything is mapped to the null
tag. There were some app op APIs not being piped thorough the app
ops delegate and by extension through the app ops policy. Also
now that we have nice way to express the permission chain in a
call we no longer need the special casing in activity manager to
handle content provider accesses through the OS. Fixed a bug
where we don't properly handle the android.os.shell calls with
an invlaid tag which was failing while the shell can do any tag.

Finally, to ensure the mechanims is validated and works end-to-end
we are adding support for a voice recognizer to blame the client
app for the mic access. The recognition service can create a blaming
context when opening the mic and if the mic is open, which would
do all permission checks, we would not do so again. Since changes
to PermissionChercker for handling attribution sources were made
the CL also hooks up renounced permissoins in the request permission
flow and in the permission checks.

bug:158792096
bug:180647319

Test:atest CtsPermissionsTestCases
     atest CtsPermissions2TestCases
     atest CtsPermissions3TestCases
     atest CtsPermissions4TestCases
     atest CtsPermissions5TestCases
     atest CtsAppOpsTestCases
     atest CtsAppOps2TestCases

Change-Id: Ib04585515d3dc3956966005ae9d94955b2f3ee08
2021-03-29 16:49:33 +00:00
TreeHugger Robot
52c50e9938 Merge "Add high sampling rate permission to shell" into sc-dev am: 16d5f62a66
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13972865

Change-Id: I0b6ec8ad76c56d643754bc5df9a8cc6d2b24bb97
2021-03-24 01:02:01 +00:00
TreeHugger Robot
16d5f62a66 Merge "Add high sampling rate permission to shell" into sc-dev 2021-03-23 18:47:59 +00:00
Anthony Stange
dc78cb5473 Add high sampling rate permission to shell
Tooling run with the shell needs to be able to sample sensors above
200hz to facilitate with running tests.

Fixes: 183240340
Test: Run tool that requires the permission to sample at a high rate
Change-Id: Ic6782ea5afe750d3ec3167d11eef791881dceb53
2021-03-23 16:56:24 +00:00
Kholoud Mohamed
cb3c990c9a Merge "Create new permission SET_AND_VERIFY_LOCKSCREEN_CREDENTIALS" into sc-dev am: 5ee5b490d8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13901256

Change-Id: If0863ad38ff51102da580418fdc85dde7e4b7e98
2021-03-23 15:29:49 +00:00
Kholoud Mohamed
5ee5b490d8 Merge "Create new permission SET_AND_VERIFY_LOCKSCREEN_CREDENTIALS" into sc-dev 2021-03-23 15:04:43 +00:00
Jeff Sharkey
cbdf88ce58 Merge changes from topic "nearby-bluetooth-permission-group" into sc-dev am: 9f5392e8b7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13956893

Change-Id: Idef7bb2a70ff9a5f0c4eff73ccbdc6e2bae02259
2021-03-23 13:10:54 +00:00
Jeff Sharkey
7b14b87647 Request new Bluetooth runtime permissions.
An upcoming platform change is introducing a new "Nearby devices"
runtime permission which contains the new BLUETOOTH_CONNECT and
BLUETOOTH_SCAN permissions.

We have logic in place to use <split-permission> to translate the
older BLUETOOTH and BLUETOOTH_ADMIN permissions into these new
runtime permissions, but modern apps will need to pivot to
requesting them directly as part of targeting Android S.

This change requests both the old and new permissions to avoid
breakage while the new permission enforcement is being phased in.

Bug: 181813006
Test: atest CtsPermission2TestCases
Test: atest CtsPermission3TestCases
Test: atest CtsStatsdAtomHostTestCases
Change-Id: I39f45e7d22d132d44c84017cd98e6d9e98533c7f
2021-03-22 15:34:05 -06:00
Jan Tomljanovic
760818cf49 Merge "Add permission for avoiding toast rate limiting." into sc-dev am: 2eb7e4f948
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13853986

Change-Id: I614d67697b1222233634a178beb1148dc89b5efc
2021-03-22 19:12:52 +00:00
Jan Tomljanovic
2eb7e4f948 Merge "Add permission for avoiding toast rate limiting." into sc-dev 2021-03-22 15:29:52 +00:00
Kholoud Mohamed
a618ebe24b Merge "Remove no longer needed QUERY_USERS permission" into sc-dev am: 1ee4a4ecba
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13904925

Change-Id: I991181102f1e2ffa0e450c8513e579814d59d662
2021-03-22 14:22:06 +00:00
Kholoud Mohamed
1ee4a4ecba Merge "Remove no longer needed QUERY_USERS permission" into sc-dev 2021-03-22 13:00:37 +00:00
Jan Tomljanovic
b7ac0ad3c7 Add permission for avoiding toast rate limiting.
I've decided to use a new permission since it needs to be added to
the settings app, which doesn't have INTERNAL_SYSTEM_WINDOW permission,
so I didn't want to add it as it may enable it to do some other things
it's not supposed to do.

Bug: 182448615
Test: atest android.widget.cts.ToastTest as regression test
Test: atest NotificationManagerServiceTest
Change-Id: I6adc84856f1fe9c33e0ad8470e7248a20587a1e9
2021-03-22 11:43:16 +00:00
TreeHugger Robot
a8f9c385b3 Merge "Import translations. DO NOT MERGE ANYWHERE" 2021-03-20 18:03:33 +00:00
Bill Yi
fc2c87d78c Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I55f139f5a494d77768fa7b808a087ff9754bc90c
2021-03-20 12:46:25 +00:00
Chong Zhang
00967754c3 Grant permission to shell for ResourceObserverNativeTest
bug: 178811728
bug: 182845274
test: atest ResourceObserverNativeTest
Change-Id: I60e745c4ff32cbf8f8ff8b5d016555a25a065f39
2021-03-19 09:45:35 -07:00
kholoud mohamed
1c1cc6c250 Remove no longer needed QUERY_USERS permission
Bug: 178695365
Test: atest PermissionPolicyTest#platformPermissionPolicyIsUnaltered
Change-Id: I4e050d6ea7df08ba789021fd06e8c4cf8936dfe9
2021-03-19 15:22:02 +00:00
kholoud mohamed
ca6813867a Create new permission SET_AND_VERIFY_LOCKSCREEN_CREDENTIALS
Created a new permission to allow setting and verifying lock screen
credentials.

Test: N/A
Bug: 182260585
Change-Id: I3cf624f063ba582bc8d3b6aeeb11a46a2ab37636
2021-03-19 14:59:52 +00:00
Kevin Han
7d14fde4f4 Add MANAGE_APP_HIBERNATION permission
Add permission for app hibernation state manipulation.

Bug: 183058954
Test: run hibernation job and confirm the API works for
PermissionController

Change-Id: Id57ee57f49710d0b8a49a4ec561800db43089f87
2021-03-18 17:02:25 -07:00
TreeHugger Robot
3be701e767 Merge "Only allow preinstalled application to be able to call setHotwordDetectionServiceConfig" into sc-dev 2021-03-18 08:24:21 +00:00
lpeter
b787d41387 Only allow preinstalled application to be able to call setHotwordDetectionServiceConfig
We added a new permission "MANAGE_HOTWORD_DETECTION" to allow
the application that held this permission to be able to use
setHotwordDetectionServiceConfig functions.

In order to avoid the feature leakage, we submit the change
about Shell in internal branch.

Bug: 178346114
Test: atest CtsVoiceInteractionTestCases
Test: atest PermissionPolicyTest
Change-Id: I8829c3c389fb5fe4b06ffcf21870db50fa2ede4b
2021-03-17 19:37:16 +08:00
kholoud mohamed
63a2278e0b Create new permission QUERY_AUDIO_STATE
Created a new permission to allow access to device audio
state and granted it to shell.

Test: N/A
Bug: 182260585
Change-Id: If1bfcb1341402717fec74cc704caa7e1eb18fa2e
2021-03-15 19:53:05 +00:00
Seigo Nonaka
84383b5ef8 Update FontManager#getFontConfig to require permission
There is no security risk in getFontConfig without calling permissions
but for keeping compatibility it is recommended to have permissions
to all (non-mainline) system APIs.

To be able to test these APIs, grant UPDATE_FONTS permission to shell.

Bug: 181796732
Test: atest FontManagerTest
Change-Id: Ic1f663e1e01f3625a076e68949f717366e79f5fa
2021-03-09 18:13:20 -08:00
Sergey Volnov
50f0175f3e Merge "Allow shell to temporary change speech recognition service" am: aa212a0109 am: a7c55dc99e am: 82abc59b39
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1604913

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib6413ed4352ba6d967742063ab73b8e321f88dee
2021-03-09 17:05:40 +00:00
Sergey Volnov
82abc59b39 Merge "Allow shell to temporary change speech recognition service" am: aa212a0109 am: a7c55dc99e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1604913

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iac4f7ed714d9493ff4235a8ae162ee6d801cecc5
2021-03-09 16:39:55 +00:00
Sergey Volnov
aa212a0109 Merge "Allow shell to temporary change speech recognition service" 2021-03-09 15:24:32 +00:00
Nicholas Ambur
9853ce9204 Merge "remove BIND_VOICE_INTERACTION perm from shell user" am: 85b00aa8f4 am: 2bbc9852f5 am: c045cca28c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614259

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I323028b0995164744995b88b38fca20d5186905d
2021-03-08 18:48:01 +00:00
Nicholas Ambur
c045cca28c Merge "remove BIND_VOICE_INTERACTION perm from shell user" am: 85b00aa8f4 am: 2bbc9852f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614259

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ica55667e5d7333e773bbd6badc4e6b6a2d974a5f
2021-03-08 18:23:23 +00:00
Nicholas Ambur
85b00aa8f4 Merge "remove BIND_VOICE_INTERACTION perm from shell user" 2021-03-08 17:13:38 +00:00
Oli Lan
265752d824 Add SET_CLIP_SOURCE permission.
This adds a permission that allows the holder to provide the source
package when setting the primary clip in clipboard. This will be done
using a new system API.

This is needed to ensure that the clipboard access notifications can be
properly attributed. For example, when a copy is performed through the
share sheet, the data should be attributed to the app that opened the
share sheet, not Android System.

Bug: 180577866
Test: builds
Change-Id: If3193d476fa923b849b505ad8b6dd893a2feae8f
2021-03-08 10:27:46 +00:00
Tim Van Patten
7f2f873b59 GameManager: Add Public API
Add the public API to GameManager:
- getGameMode()

Bug: b/178860939
Test: atest CtsGameManagerTestCases
Test: atest GameManagerTests
Test: atest GameManagerServiceTests
Test: atest GameManagerServiceSettingsTests
Change-Id: Ie6030e4ec796c9ecf2c756f24f00e445572accda
2021-03-05 19:59:28 -07:00
Gavin Corkery
8699e31071 Merge "Add immutability flag to PendingIntents" into rvc-qpr-dev-plus-aosp 2021-03-05 10:41:30 +00:00
Brad Ebinger
77e564bfba Merge "Define new permission to perform IMS RCS Reg actions and integrate ACCESS_IMS_SINGLE_REGISTRATION into APIS" am: ca282c8cbf am: a0f85ebf75
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1596514

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I11af5489b456fd6e84586c5f3ae8ee8da0aede11
2021-03-05 05:11:15 +00:00
Brad Ebinger
ca282c8cbf Merge "Define new permission to perform IMS RCS Reg actions and integrate ACCESS_IMS_SINGLE_REGISTRATION into APIS" 2021-03-04 23:17:13 +00:00
Nicholas Ambur
b2e65af564 remove BIND_VOICE_INTERACTION perm from shell user
BIND_VOICE_INTERACTION permission was added for GTS test code usage.
The GTS test cases relying on this permission previously have been
refactored to not require the permision any longer.

Bug: 178984748
Test: gts-tradefed run gts -m GtsAssistIntentTestCases
Change-Id: I6811b929d65400af39e17c75c638bc2c1fd9ef7e
2021-03-02 19:41:19 -08:00
Joanne Chung
7e3f7d1061 Merge "Add shell commands and dump information for Translation" into sc-dev 2021-03-02 11:39:07 +00:00
Brad Ebinger
29dfa1cd76 Define new permission to perform IMS RCS Reg actions and integrate ACCESS_IMS_SINGLE_REGISTRATION into APIS
Move from MODIFY_PHONE_STATE to ACCESS_IMS_SINGLE_REGISTRATION
as per design doc.

Bug: 149426399
Bug: 173652571
Bug: 168923956
Test: atest CtsTelephonyTestCases
Merged-In: I6d4ae879d9d2b347f6576ea20f9e42454b39936b
Merged-In: Idabfda6853ec2a24544da5253ad0e43c47a6cc69
Change-Id: Ie0e1198c8b9cfa0bab90407c8d35273159f63302
2021-03-02 11:39:02 +08:00
Brad Ebinger
d2fbe50daa Merge "[RCS UCE] Define a new ACCESS_RCS_USER_CAPABILITY_EXCHANGE permission for associated RCS UCE APIs" am: 44d6bdc332 am: f92683b7d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1555055

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib2c57f359f140a22e6d1bc84cc9b05ae47ba52ae
2021-02-26 21:17:19 +00:00
Brad Ebinger
f92683b7d1 Merge "[RCS UCE] Define a new ACCESS_RCS_USER_CAPABILITY_EXCHANGE permission for associated RCS UCE APIs" am: 44d6bdc332
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1555055

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I62579792679ebb079d9fd2f97720a66d1d5aec3f
2021-02-26 20:54:10 +00:00
Joanne Chung
3a907ab1eb Add shell commands and dump information for Translation
1. Add shell command to allow a temporary override of the
TranslationService that helps e2e CTS tests.
2. Add permission to allow the shell call the UiTranslationManager
APIs for the tests.
3. Dump translation systemservice and activity translation related
information to help debugging

We don't want to leak translation feature now, so we submit the
change about Shell in internal branch.

Bug: 179047265
Test: manual.
1. Switch to temp TranslationService by "adb shell cmd transformer set
<myTranslationService> 12000" and make sure only the same app can
access the APIs when switching to the temp service.
2. adb shell dumpsys transformer
3. adb shell dumpsys activity <myactivity> --translation
(We set "transformer" now to prevent feature leak, the final value is
translation)

Change-Id: I2573b7ea226bd805a951f8346d5370d9c9776364
2021-02-26 11:13:39 +00:00
Alex Buynytskyy
a1ec6ad5e2 Merge "Remove INSTALLER_V2 permission since the API is finalized in S." into sc-dev 2021-02-26 09:50:23 +00:00
Alex Buynytskyy
28d0b7b712 Remove INSTALLER_V2 permission since the API is finalized in S.
Bug: 152310230
Fixes: 152310230
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I624eb44a455ba65f156064c57787af5903567d96
2021-02-25 19:50:42 -08:00
Evan Severson
445abca30e Merge "Expose SensorPrivacy as SystemApi" into sc-dev 2021-02-25 18:29:43 +00:00