Commit Graph

454 Commits

Author SHA1 Message Date
Jiyong Park
da0ffb8e4f Merge "Implement permission check for virtualizationservice" am: 1ce000ff84 am: 01dfd737f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1763365

Change-Id: I81519001e9e2dae4eef2b38327858281e44d1886
2021-07-13 16:09:29 +00:00
Jiyong Park
a8cc7f17bf Implement permission check for virtualizationservice
For the service to be able to check permission, the AIDL interface is
exported to the virt APEX where virtualizationservice is in.

In addition, the VM permissions are granted to shell so that developers
can use the 'vm' tool on the shell.

Bug: 168588769
Test: /apex/com.android.virt/bin/vm run-app --log /dev/null
/data/local/tmp/virt/MicrodroidDemoApp.apk
/data/local/tmp/virt/MicrodroidDemoApp.apk.idsig assets/vm_config.json

Change-Id: I00db58ba9cef3b83f43db68ef86f062b59a0e6e1
2021-07-13 08:25:28 +09:00
Nikita Ioffe
65eb22cc56 Grant INSTALL_PACKAGE_UPDATES permission to Shell
Bug: 188062003
Test: m
Change-Id: I342f64e666afa4202b8af69f04d64b05d40fac40
2021-07-09 00:52:08 +01:00
TreeHugger Robot
268e58afe4 Merge "Remove SCHEDULE_EXACT_ALARM from Shell" into sc-dev 2021-06-30 00:42:40 +00:00
Suprabh Shukla
d50bc69f94 Remove SCHEDULE_EXACT_ALARM from Shell
Shell doesn't need this permission and it confusing to the user
if visible in Settings.

Test: Shell doesn't appear in Settings under
Settings -> Apps -> Special app access -> Alarms & Reminders ->
3 dot menu -> Show system

Bug: 190775895
Change-Id: I98b051f37f3edf4f616f8847f691b956dafbdd12
Merged-In: I98b051f37f3edf4f616f8847f691b956dafbdd12
2021-06-29 16:27:28 -07:00
TreeHugger Robot
69a0939764 Merge "Give Shell the NOTIFY_PENDING_SYSTEM_UPDATE permission" into sc-dev 2021-06-29 16:57:01 +00:00
Alex Kershaw
1f5ef8e31d Give Shell the NOTIFY_PENDING_SYSTEM_UPDATE permission
This is required for GTS testing it, rather than having to instrument
GMS Core.

Bug: 182271592
Test: tested as part of other CLs in this topic
Change-Id: Id56e0d206afe0a9069d1510a3dae9a07141fff60
2021-06-29 11:52:04 +01:00
Hongguang
757d741cd7 Allow Shell more permissions for TvInputManagerTest.
Bug: 171024152
Test: android.media.tv.cts.TvInputManagerTest
Change-Id: Iabea3ea72a5476892c848eaa8ebf4f93ad9b1000
2021-06-25 00:50:51 +00:00
Lucas Lin
fbc5d5d588 Add OBSERVE_NETWORK_POLICY for shell to test CTS
Both of NetworkPolicyManager#isUidNetworkingBlocked() and
NetworkPolicyManager#isUidRestrictedOnMeteredNetworks() are
required OBSERVE_NETWORK_POLICY but OBSERVE_NETWORK_POLICY is a
signature permission that CTS cannot acquire.
So add this permission for shell and call these 2 APIs with
shell identity to fix the problem.

Bug: 176289731
Test: atest CtsHostsideNetworkTests:HostsideNetworkPolicyManagerTests
Original-Change: https://android-review.googlesource.com/1737413
Merged-In: Iba7321c82e1a3ed773f99ccd4b9e3c24c607353f
Change-Id: Iba7321c82e1a3ed773f99ccd4b9e3c24c607353f
2021-06-22 05:46:59 +00:00
lucaslin
010a8e0667 Add OBSERVE_NETWORK_POLICY for shell to test CTS
Both of NetworkPolicyManager#isUidNetworkingBlocked() and
NetworkPolicyManager#isUidRestrictedOnMeteredNetworks() are
required OBSERVE_NETWORK_POLICY but OBSERVE_NETWORK_POLICY is a
signature permission that CTS cannot acquire.
So add this permission for shell and call these 2 APIs with
shell identity to fix the problem.

Bug: 176289731
Test: atest CtsHostsideNetworkTests:HostsideNetworkPolicyManagerTests
Change-Id: Iba7321c82e1a3ed773f99ccd4b9e3c24c607353f
2021-06-16 17:45:32 +08:00
Treehugger Robot
15ec62006a Merge "Remove SCHEDULE_EXACT_ALARM from Shell" 2021-06-12 11:05:56 +00:00
Suprabh Shukla
f199b66d36 Remove SCHEDULE_EXACT_ALARM from Shell
Shell doesn't need this permission and it confusing to the user
if visible in Settings.

Test: Shell doesn't appear in Settings under
Settings -> Apps -> Special app access -> Alarms & Reminders ->
3 dot menu -> Show system

Bug: 190775895
Change-Id: I98b051f37f3edf4f616f8847f691b956dafbdd12
2021-06-10 19:33:01 -07:00
zakcohen
baea422788 Give shell android.permission.GET_TOP_ACTIVITY_INFO
Grant shell android.permission.GET_TOP_ACTIVITY_INFO for testing Launcher
tests that need access to AssistContentRequester in shell context.

Bug: 190344718
Test: Local build and flash, ran test
Merged-In: I551e0bee413432653f39c91664d716f695311b6f
Change-Id: I551e0bee413432653f39c91664d716f695311b6f
2021-06-09 03:32:35 +00:00
Zak Cohen
46e5c0df76 Give shell android.permission.GET_TOP_ACTIVITY_INFO
Grant shell android.permission.GET_TOP_ACTIVITY_INFO for testing Launcher
tests that need access to AssistContentRequester in shell context.

Bug: 190344718
Test: Local build and flash, ran test
Merged-In: I551e0bee413432653f39c91664d716f695311b6f
Change-Id: I551e0bee413432653f39c91664d716f695311b6f
2021-06-09 03:27:58 +00:00
Kweku Adams
a60c62bcb7 Don't export HeapDumpProvider.
Stop exporting HeapDumpProvider so apps can only access generated dumps
when the user explicitly shares them.

Bug: 184046948
Test: capture system heap dump in developer options and confirm test app
get SecurityException if it tries to access the dump directly, but gets
access when the dump is shared through the notification flow

Change-Id: Ibdca7cde4f563baa39163869289da5b79fc3a6db
2021-06-03 16:07:56 -07:00
TreeHugger Robot
6572539f65 Merge "Check "BIND_HOTWORD_DETECTION_SERVICE" permission before binding HotwordDetectionService" into sc-dev 2021-05-25 13:24:35 +00:00
lpeter
f62ae15bad Add permission into Shell for CTS test
Bug: 187914415
Test: atest CtsVoiceInteractionTestCases
Test: atest CtsVoiceInteractionTestCases --instant
Merged-In: I4ccd8fd5b153f28fa4b1463f7412bb8067cc4ffd
Merged-In: I8829c3c389fb5fe4b06ffcf21870db50fa2ede4b
Change-Id: I1bf11112ba7c37b372db772312a75c39809962a9
2021-05-25 10:43:12 +08:00
lpeter
e66524d14f Check "BIND_HOTWORD_DETECTION_SERVICE" permission before binding HotwordDetectionService
Bug: 187914415
Test: atest CtsVoiceInteractionTestCases
Test: atest CtsVoiceInteractionTestCases --instant
Change-Id: I4ccd8fd5b153f28fa4b1463f7412bb8067cc4ffd
2021-05-21 10:49:56 +08:00
Neil Fuller
22472c6361 Add permission to shell for CTS test
This grants the shell app the SUGGEST_EXTERNAL_TIME permission needed
for the TimeManagerTest (CTS) to invoke the
TimeManager.suggestExternalTime() method during tests.

Bug: 184947690
Bug: 177079827
Test: See associated cts change
Merged-In: Ia1995ec9503dbd2b12e0b5b5f92a96e02f85beec
Change-Id: Ia1995ec9503dbd2b12e0b5b5f92a96e02f85beec
2021-05-19 16:11:32 +00:00
Neil Fuller
bc9061fdf3 Merge "Add permission to shell for CTS test" into sc-dev 2021-05-19 16:11:12 +00:00
Neil Fuller
bc4a843f18 Add permission to shell for CTS test
This grants the shell app the SUGGEST_EXTERNAL_TIME permission needed
for the TimeManagerTest (CTS) to invoke the
TimeManager.suggestExternalTime() method during tests.

Bug: 184947690
Bug: 177079827
Test: See associated cts change
Merged-In: Ia1995ec9503dbd2b12e0b5b5f92a96e02f85beec
Change-Id: Ia1995ec9503dbd2b12e0b5b5f92a96e02f85beec
2021-05-18 14:04:55 +01:00
Cassie Wang
7c41518fc2 Merge "Have the shell request AppSearch global query permission." am: f37a782378 am: 6e11df3fe7 am: 4dbd446328
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1704125

Change-Id: Ib0e16ff2dbcdb5655723058c02eab414b7beaf6d
2021-05-14 03:35:10 +00:00
Cassie Wang
aa50faacb7 Have the shell request AppSearch global query permission.
Permission to be defined in follow-ups.

Bug: 187113133
Change-Id: I74cd919d9ed19a1aac2e75397cb0d6d20b8bee02
Test: presubmit
2021-05-11 20:13:27 +00:00
kholoud mohamed
f01ffd8b53 Add a new permission to install testOnly apps
Added a new permission INSTALL_TEST_ONLY_PACKAGE
and granted it to shell, this will allow installing
testOnly apps from a testAPI.

Test: N/A
Bug: 183716601
Merged-In: I047a4013fb3462db3487eab2d1635ea75ae29264
Change-Id: I047a4013fb3462db3487eab2d1635ea75ae29264
2021-04-28 10:32:03 +01:00
Treehugger Robot
71d1186b1b Merge "Shell: Allow usage of UwbManager ranging API" am: d0c859c58f am: 8125586204 am: 3897959f77
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1680127

Change-Id: Ib84bc63ccf536686aa0d17ff97e3dcddf73819a9
2021-04-21 19:30:58 +00:00
Treehugger Robot
d0c859c58f Merge "Shell: Allow usage of UwbManager ranging API" 2021-04-21 18:26:11 +00:00
TreeHugger Robot
16472322f9 Merge "Pipe start op throught app ops policy and delegate" into sc-dev 2021-04-21 15:06:11 +00:00
Kholoud Mohamed
48cf9cdfb0 Merge "Add a new permission to install testOnly apps" into sc-dev 2021-04-21 11:07:50 +00:00
Svet Ganov
8b1aad623e Pipe start op throught app ops policy and delegate
bug: 185504196

Test: atest CtsAppOpsTestCases
      atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsPermission3TestCases
      atest CtsPermission4TestCases
      atest CtsPermission5TestCases

Change-Id: I5869a3e9719830f59624519f2d54f0765119cf5f
2021-04-21 08:06:35 +00:00
Hyundo Moon
013cf241a1 Merge changes from topic "system_mr2_media_content_control" into sc-dev
* changes:
  System MediaRouter2: Resolve API review
  Change MODIFY_AUDIO_ROUTING permission to MEDIA_CONTENT_CONTROL
2021-04-21 01:45:42 +00:00
Suprabh Shukla
508e114192 Adding a permission to Shell for testing
Adding UPDATE_DEVICE_STATS to enable testing alarms with WorkSource
objects.

Test: atest CtsAlarmManagerTestCases

Bug: 185530825
Change-Id: Ia0f8afa6dc1a13c95553b691f352c6d8c7ae5ccf
Merged-In: Ia0f8afa6dc1a13c95553b691f352c6d8c7ae5ccf
2021-04-20 15:32:03 -07:00
Shubang Lu
c505cc19a2 Merge "TIF: Change the isForeground API to isVisible and isMainSession" into sc-dev 2021-04-20 20:19:42 +00:00
kholoud mohamed
dead379e48 Add a new permission to install testOnly apps
Added a new permission INSTALL_TEST_ONLY_PACKAGE
and granted it to shell, this will allow installing
testOnly apps from a testAPI.

Test: N/A
Bug: 183716601
Change-Id: I047a4013fb3462db3487eab2d1635ea75ae29264
2021-04-20 15:37:30 +00:00
Ken Chen
e6565f57fc resolve merge conflicts of a3e32c8b4f to sc-dev
Bug: 185071689
Change-Id: I1524a534590361a585469ddf959e582484493e4e
2021-04-20 09:22:10 +00:00
shubang
e8c3a42409 TIF: Change the isForeground API to isVisible and isMainSession
isForeground is not a good approach to indentify current channel info

And add a permission for tuned info.

Bug: 180482268
Test: atest CtsPermission2TestCases
Test: atest TvInputManagerTest#testGetCurrentTunedInfos
Change-Id: Ib1c1f2da719336ae856684e843b06f8b9b442723
2021-04-20 05:49:14 +00:00
Suprabh Shukla
b0db699780 Adding a permission to Shell for testing
Adding UPDATE_DEVICE_STATS to enable testing alarms with WorkSource
objects.

Test: atest CtsAlarmManagerTestCases

Bug: 185530825
Change-Id: Ia0f8afa6dc1a13c95553b691f352c6d8c7ae5ccf
2021-04-19 23:35:39 +00:00
Roshan Pius
0662c37218 Shell: Allow usage of UwbManager ranging API
This permission is needed for uwb CTS ranging specific tests.

Is the minimally scoped permission that needs to be added?
- Yes, this only allows the app to range to uwb devices.

What options did you explore that did not need this permission?
- Without this permission, it would be impossible to test the raning
UwbManager API which is protected by UWB_RANGING + UWB_PRIVILEGED.

Bug: 183747097
Test: Compiles
Change-Id: I23fc60a111fd7d868e3982d71ffa354ea9957bfb
2021-04-19 13:45:13 -07:00
Alex Buynytskyy
e7339d98df API feedback: make DataLoader API System.
Bug: 184713911
Fixes: 184713911
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I00107102eb2e98004ed0a5db2a318a052ab60220
2021-04-18 15:48:21 +00:00
Ken Chen
81b55fbe8c Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission to shell
The shell *already had* the privileges granted by this permission due to
specific code in netd, and it lost those privileges when it gained the
CHANGE_NETWORK_STATE permission. Explicitly add
CONNECTIVITY_USE_RESTRICTED_NETWORKS so that it can obtain sufficient
permission in netd no matter CHANGE_NETWORK_STATE is set or not.

Remove a duplicate row by the way.

Bug: 185071689
Test: atest NetdClientTest#protectFromVpnTcp6
Change-Id: I64bc321de2c83378ce7bc8d9eb3044ae7772faca
2021-04-16 05:48:47 +00:00
Hyundo Moon
6ffbb9568c Change MODIFY_AUDIO_ROUTING permission to MEDIA_CONTENT_CONTROL
As changing the permission for MediaRouter2 system APIs, this CL
changes the permission in shell accordingly.

The permission was added by ag/13959439.

Bug: 183428114
Test: Passed CTS tests
Change-Id: I3aee256a11db730dd786e69821f3bb8bd590074f
2021-04-15 20:01:06 +09:00
Treehugger Robot
51e5e80876 Merge "Grant shell missing permissions" 2021-04-15 00:52:03 +00:00
Roshan Pius
43158d470e Shell: Allow usage of UwbManager APIs
This permission is needed for uwb CTS tests.

Is the minimally scoped permission that needs to be added?
- Yes, this only allows the app to range to uwb devices.

What options did you explore that did not need this permission?
- Without this permission, it would be impossible to test any of the
UwbManager API's.

Bug: 183747097
Test: Compiles
Change-Id: Ie4264cdcd3f84c965da70f8f8fefe538378c47f6
Merged-In: Ie4264cdcd3f84c965da70f8f8fefe538378c47f6
2021-04-14 21:01:58 +00:00
Roshan Pius
6e943b5450 Merge "Shell: Allow usage of UwbManager APIs" into sc-dev 2021-04-14 21:01:40 +00:00
Roshan Pius
8cf4edc118 Shell: Allow usage of UwbManager APIs
This permission is needed for uwb CTS tests.

Is the minimally scoped permission that needs to be added?
- Yes, this only allows the app to range to uwb devices.

What options did you explore that did not need this permission?
- Without this permission, it would be impossible to test any of the
UwbManager API's.

Bug: 183747097
Test: Compiles
Change-Id: Ie4264cdcd3f84c965da70f8f8fefe538378c47f6
2021-04-14 11:53:19 -07:00
Abhijeet Kaur
6d27ed1a3b Merge "Add ACCESS_MTP permission to Shell for CTS test coverage" into sc-dev 2021-04-14 14:47:43 +00:00
Abhijeet Kaur
a8ddeb4feb Add ACCESS_MTP permission to Shell for CTS test coverage
Bug: 183377919
Test: atest CtsScopedStorageHostTest
Change-Id: Ic66617e66fd88302ee82bfeb217f9b7bf9b3776b
2021-04-13 11:25:24 +01:00
Kholoud Mohamed
4701b29dbc Merge "Grant shell missing permissions" into sc-dev 2021-04-09 16:31:25 +00:00
kholoud mohamed
b8bd53aa60 Grant shell missing permissions
Granted shell the missing normal, dangerous, and
development permissions that can already be granted
to third party apps.

Test: N/A
Bug: 183716601
Merged-In: I11df0d753f830b6ba6ea2222f7d8a7d778161953
Change-Id: I11df0d753f830b6ba6ea2222f7d8a7d778161953
2021-04-09 16:30:07 +01:00
kholoud mohamed
b173952e19 Grant shell missing permissions
Granted shell the missing normal, dangerous, and
development permissions that can already be granted
to third party apps.

Test: N/A
Bug: 183716601
Change-Id: I11df0d753f830b6ba6ea2222f7d8a7d778161953
2021-04-09 11:10:49 +01:00
Jeff Sharkey
6dcac06a84 New BLUETOOTH_ADVERTISE manifest permission.
This change is part of defining a distinct BLUETOOTH_ADVERTISE
permission to guard the BluetoothLeAdvertiser APIs, since that's a
distinct enough of an operation from SCAN and CONNECT.  It'll
continue to be covered under the general "Nearby devices" runtime
permission group.

Bug: 181813006
Test: atest CtsPermission2TestCases
Test: atest CtsPermission3TestCases
Change-Id: I8b62e4d625df1e201f12a73025cd29c431feea79
2021-04-08 20:15:02 -06:00