Commit Graph

305 Commits

Author SHA1 Message Date
Sung Min Lee
a90b1fcaca Add CAPTURE_AUDIO_OUTPUT permission required for GTS test
GtsDialerAudioTestCases require this privileged permission for testing in GTS.

Bug: 157243201
Test: run gts -m GtsDialerAudioTestCases
Change-Id: I32516e5dcf966b05cfb8ab4956a0cdb183298f2a
2020-06-02 21:24:59 -07:00
Mina Granic
3420744449 Merge "Whitelist READ_PRIVILEGED_PHONE_STATE permission needed by Build.getSerial()." into rvc-dev 2020-05-29 16:43:43 +00:00
Wei Wang
96f7636149 Add LOCATION_HARDWARE permission to shell.
A few location System APIs require LOCATION_HARDWARE permssion. Adding
this permission to shell so CTS tests can adopt this permission.

Bug:154347471

Test: atest PrivilegedLocationPermissionTest
Change-Id: I4abe4dc044ec4a3ab62352cc0f4a1726bebac633
2020-05-27 17:53:31 -07:00
Chen Xu
ef0740e227 Merge "support cellbroadcast data migration by dafault" into rvc-dev 2020-05-28 00:24:30 +00:00
Chen Xu
1d4939fff2 support cellbroadcast data migration by dafault
As part of mainline effort, cellbroadcastreceiver package name has been
renamed. Now its a completely new apk with different uid. That said all
user data e.g, cellbroadcast history and user preference from legacy app
com.android.cellbroadcastreceiver are gone. This change is to support
preserve user data when devices upgrate to R and take cellbraodcast.
mainline module.
1. create legacy cellbroadcast app with old pakcage name
com.android.cellbroadcastreceiver. this app only surface the old data
and should not contains any activities/services to handle emergecy apert
2. legacy cellbroadcast app will be included to the system image by
default. OEMs are free to remove it if they don't care data loss or
after R data migration is done. leagcy app will not be part of
com.android.cellbroadcast apex.
3. the real mainline module rename to com.android.cellbroadcast.module

Bug: 155844209

Change-Id: I5e61c7e777526e038cd8d9971a2c5b87c00eaacb
Merged-in: I5e61c7e777526e038cd8d9971a2c5b87c00eaacb
2020-05-27 20:25:10 +00:00
minagranic
f750a61838 Whitelist READ_PRIVILEGED_PHONE_STATE permission needed by Build.getSerial().
Bug: 144779107
Test: Plugged the phone, no SecurityException, started Phantoscope.
Change-Id: I2af21c1318fabb4d9a8b9bc6808dc163a3e353b5
2020-05-27 17:40:41 +00:00
Amy Zhang
5f8498bcf1 Add support for TvInputManager.acquireTvInputHardware CTS
1. Add a test api in TvInputManager to add hardware device for testing
2. Add Shell permission for TV_INPUT_HARDWARE
3. Add TUNER_RESOURCE_ACCESS permission for TvInput Framework.

Test: atest android.media.tv.cts
Bug: 155114656
Change-Id: I227f13cbf14532d8732729412ae9c2518755ef02
2020-05-14 17:37:52 -07:00
Treehugger Robot
fbd4a6f80a Add day-night-mode permission to Shell.
Without the permission "adb shell cmd uimode night <mode>" doesn't work.
Adding the permission to the AndroidManifest file so the shell command
will work.

Bug: 155584597
Test: run `adb shell cmd uimode night <no|yes|auto>`
Change-Id: Ic444f3351cb130d24a2794284c6bf8709c80712c
(cherry picked from commit a85cc22044)
2020-05-12 15:13:26 +00:00
Nate Myren
068b2b0df2 Add enable/disable permission to permissioncontroller
Ensure the permission controller can enable and disable apps

Bug: 146513245
Test: Manual
Change-Id: I185335bd729c8fa94b150d3b3adb95b89013aa16
2020-04-07 12:07:54 -07:00
TreeHugger Robot
1410b406d7 Merge "Allow WRITE_SECURE_SETTINGS for ANGLE to provide developer options." into rvc-dev 2020-03-27 17:16:35 +00:00
Geoff Lang
4b5a106542 Allow WRITE_SECURE_SETTINGS for ANGLE to provide developer options.
ANGLE is a system library which adds a developer option to control when
it is used as the default OpenGL ES driver.

Test: manual, ANGLE.apk's developer options work.
Bug: 142239747

This is a cherry-pick of https://android-review.googlesource.com/c/platform/frameworks/base/+/1222890

Change-Id: I3e616d6252d0daa0e32c942b05987d17e73a2709
2020-03-25 16:13:24 +00:00
TreeHugger Robot
e0b1bfb87d Merge "Add tuner permissions to Shell" into rvc-dev 2020-03-24 06:26:00 +00:00
shubang
d7a3204c4e Add tuner permissions to Shell
So we can test system APIs in cts.

Bug: 150952758
Test: atest android.media.tv.tuner.cts.TunerTest
Change-Id: Ife5a5f712cdf3d3c2e5dd747fa1d3bc8c165b85b
2020-03-23 19:41:35 -07:00
markchien
1f47e1c22e Give tethering bluetooth privilege permission
Permisssion of PanService#setBluetoothTethering is change from
BLUETOOTH_ADMIN to BLUETOOTH_PRIVILEGED.
Tethering service need bluetooth privilege permission to enable
bluetooth tethering.

Bug: 146045934
Test: on/off bluetooth tethering
Merged-In: Ib87a5d5a5bb49390aa55e52713bb3539d4a52348
Change-Id: Ib87a5d5a5bb49390aa55e52713bb3539d4a52348
2020-03-23 11:42:39 -07:00
Roshan Pius
c551b3386a Shell: Allow usage of wifi usability score APIs
This permission is needed for wifi CTS tests.

Is the minimally scoped permission that needs to be added?
- Yes, this only allows the app to influnce wifi vs lte network
selection algorithm.

What options did you explore that did not need this permission?
- Without this permission, it would be impossible to test these API's:
WifiManager.setWifiConnectedNetworkScorer()
WifiManager.clearWifiConnectedNetworkScorer()
WifiManager.clearWifiConnectedNetworkScorer()
WifiManager.addOnWifiUsabilityStatsListener()

Bug: 150236894
Test: Device boots up.
Change-Id: Ic173e44ab818cdfecebde80715ddaec347019db6
2020-03-19 13:14:50 -07:00
Remi NGUYEN VAN
aa59d13672 Merge "Remove privapp grants for CaptivePortalLogin" into rvc-dev 2020-03-19 05:43:54 +00:00
Eric Laurent
e23ed86890 Add MODIFY_DEFAULT_AUDIO_EFFECTS permission to shell
Add MODIFY_DEFAULT_AUDIO_EFFECTS permission to shell which
is needed to run GTS tests on @systemApis for
audio effects control.

Bug: 148703417
Test: run gts -m GtsAudioTestCases -t com.google.android.audio.gts.DeviceEffectTest#testCreateDeviceEffect
Change-Id: Iba579001aeffd85743850727135a6f536579ea17
2020-03-18 12:07:57 -07:00
Winson Chung
bdf1684824 Adding launcher permission to base whitelist
- This is a *temporary* permission that we are using to set the system
  rotation setting via the launcher settings.  The framework uses the
  same setting for forced-rotation, but this currently only is scoped to
  launcher so it makes more sense as a launcher setting than as a
  developer option (and we plan on removing it shortly).  We are working
  with jjaggi@ and caen@ to coordinate the fw and launcher settings.

Bug: 151611270
Test: Manual
Change-Id: If371cac4d580785ed1714c82a67b995a40ecf9a6
2020-03-16 16:28:22 +00:00
Automerger Merge Worker
366c9406fd Remove privapp grants for CaptivePortalLogin
CaptivePortalLogin is not a privileged app, so it cannot get these
permissions anyway.

Test: CaptivePortalLogin working without the permissions
Bug: 151214275
Change-Id: I283b8068b9eada28d92c9d550473106a1b680a27
Merged-In: I283b8068b9eada28d92c9d550473106a1b680a27
(cherry picked from commit 53839762d4)
2020-03-16 10:14:01 +00:00
Chi Zhang
bb9ed92165 Telephony statsd atoms.
Test: build
Bug: 146066107
Bug: 141631489
Bug: 122371089
Bug: 149880090
Bug: 127666858

Change-Id: I124cf2da59ed4c5e92406081aac0df0f347ace74
2020-03-11 15:10:36 -07:00
TreeHugger Robot
a01570b72f Merge "Whitelist READ_PRIVILEGED_PHONE_STATE for the contacts provider" into rvc-dev 2020-03-07 00:58:35 +00:00
Tej Singh
0e4f868bb2 Merge "Make pull atom permission accessible to shell" into rvc-dev 2020-03-04 21:58:36 +00:00
Philip P. Moltmann
a3040ca8df Merge "Nicer share target for default print service" into rvc-dev 2020-03-04 17:52:35 +00:00
Philip P. Moltmann
26e1d17778 Nicer share target for default print service
This was suggested by the share sheet team and I checked that this
permission only narrowly adds the ability to present a nicer share
target.

The default print service cannot be renamed "print" as the name of the
app shows up on other print UI.

Bug: 150646365
Test: Checked permission after boot
Change-Id: I3aa5900605bda90ce0cb58a09fe08128bf4c9531
2020-03-03 16:02:32 -08:00
Tej Singh
924910db90 Make pull atom permission accessible to shell
Make REGISTER_STATS_PULL_ATOM permission available to Shell to allow
testing it in gts.

Is the minimally scoped permission that needs to be added?
Yes, it is the only permission to register pulled atoms.

What options did you explore that did not need this permission?
I explored expanding the permission to be development in addition to
privileged, and giving the permission to gmscore. However, this solution
was recommended to me by the GTS team. If there are better ways to enable
testing the API in GTS, I am open to feedback.

Test: atest GtsStatsdHostTestCases
Bug: 150329323
Change-Id: I103d937842beaa2d918181b1a952d27179411dcc
2020-03-03 23:36:08 +00:00
Hall Liu
81866d4149 Merge "Add PlatformCompat permissions to TelephonyProvider" into rvc-dev 2020-03-03 23:29:19 +00:00
Roshan Pius
75dbcfff98 Shell: Allow retrieval of wifi network credentials
This permission is needed for some wifi CTS tests.

Is the minimally scoped permission that needs to be added?
- Yes, this only allows the retireval of the saved wifi network
credentials on the device.

What options did you explore that did not need this permission?
- Possibly creating a UI to ask for manual entry of network credentials.
But, that would not let us do automated CTS tests (will need to become
CTS verifier tests then).

Bug: 150236894
Test: atest android.net.wifi.cts.WifiNetworkSpecifierTest
Change-Id: I6881003510191f667950be1ab27a5399fe3914b4
2020-03-03 09:26:27 -08:00
Hall Liu
106c0defca Add PlatformCompat permissions to TelephonyProvider
Add the required permissions for querying PlatformCompat to the
whitelist for TelephonyProvider.

This is the minimum scoped permission -- PlatformCompat only defines two
permissions for access (read and write) and we need both.

The alternative for using these permissions is to not call
PlatformCompat and enforce the new behavior on all apps. This was deemed
unacceptable by the app compat team because it was breaking some popular
apps.

Bug: 144631034
Test: atest TelephonyProviderHostTest

Change-Id: I43a0a66ae381caf8d9e21d0f14d471b20a4e44af
2020-03-02 13:04:01 -08:00
Paul Murphy
1460b76a02 Add COMPANION_APPROVE_WIFI_CONNECTIONS to shell permissions
1. This is a minimally scoped permission (which allows the new WiFi API's
to silently connect to a wifi network).
2. I explored writing a GTS test instead of a CTS test, with the idea being that it would run inside the Android Auto user. Unfortunately the API under test requires two permissions, MANAGE_COMPANION_DEVICES and COMPANION_APPROVE_WIFI_CONNECTIONS. Android Auto will only have COMPANION_APPROVE_WIFI_CONNECTIONS, and if I elevate to Shell privileges the test will have MANAGE_COMPANION_DEVICES, but not COMPANION_APPROVE_WIFI_CONNECTIONS. Beyond this, I've been told that it's better for us to test this API in CTS than what it is under GTS.

The addition of the permission to androis.os.shell could theoretically allow it to connect to a WiFi network using the new WiFi APIs without the user being prompted. Android R will still allow the legacy WiFi API's which also allow wifi connections without users being prompted without this permission. Android Auto requires the new API's as they better handle cases of connecting to WiFi networks with no internet access. The old API's will not always result in fallback to LTE, whereas the new ones do that.

Test: Unit test in separate change.
Change-Id: Ifd8ae6b7e53307ea8973406fdefa468dfa679bda
Bug: b/147748710
2020-02-28 21:58:08 +00:00
Michael Groover
58f20c408f Whitelist READ_PRIVILEGED_PHONE_STATE for the contacts provider
In Android 10 access to device identifiers was moved from a runtime
permission to the privileged READ_PRIVILEGED_PHONE_STATE permission.
One of the non-resettable identifiers missed was SubscriptionInfo#
getIccId. The contacts provider currently uses this ID to upgrade
to version 1003 of the database; to ensure there are no issues with
this upgrade this permission is being whitelisted for the contacts
provider.

Bug: 131909991
Test: atest ContactsProviderTests
Change-Id: I7574f787a7e55aa0337237b9fe916ee143a2f697
Merged-In: I7574f787a7e55aa0337237b9fe916ee143a2f697
(cherry picked from commit 7b484438ec)
2020-02-26 18:43:50 +00:00
Automerger Merge Worker
7e66d1c563 Merge "Merge "Key revocation check is permissive when device is unlocked" am: a9384cdc9b am: 3f638d9a3f" into qt-qpr1-dev-plus-aosp am: 5882228ab8
Change-Id: I39879ca88d139e51e71f2fa7050ff2ee5a67b96b
2020-02-19 23:13:15 +00:00
Yo Chiang
be20495f0b Key revocation check is permissive when device is unlocked
imageValidationThrowOrWarning() logs the error as a warning if device
bootloader is unlocked, else re-throw the error.
Device lock state is queried via PersistentDataBlockManager service.

Bug: 128892201
Test: adb shell am start-activity \
    -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
    -a android.os.image.action.START_INSTALL \
    --el KEY_USERDATA_SIZE 8192 \
    -d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip \
    --es ${IMAGE_KEY}
Test: Observe the logcat
Change-Id: I895e70d90624afda2bf7cd3b34ea8d21a1702163
2020-02-19 11:11:29 +00:00
Abhijeet Kaur
0a04f04ea0 Merge "Whitelist PlatformCompat permissions for MediaProvider" 2020-02-17 14:18:48 +00:00
Abhijeet Kaur
0f7b206acd Whitelist PlatformCompat permissions for MediaProvider
Bug: 132649864
Test: builds
Change-Id: If3d37a00f607e3cbe16a943c89bfbf3e7c100b5d
2020-02-14 12:27:52 +00:00
Varun Shah
0cbb6b63ee Obfuscate visibility of notification-related events.
UsageStats will return obfuscated NOTIFICATION_SEEN or
NOTIFICATION_INTERRUPTION events to callers of #queryEvents
and #queryEventsForUser if they don't hold the MANAGE_NOTIFICATIONS
permission.

Additionaly, refactor the query API in UsageStats to take in flags as
defined in UsageEvents to make future obfuscation/visibility parameters
cleaner.

Also, add the MANAGE_NOTIFICATIONS permission to shell for CTS test.

Bug: 144724524
Test: atest android.app.usage.cts.UsageStatsTest
Test: atest com.android.server.people.data.UsageStatsQueryHelperTest
Test: atest android.content.pm.cts.shortcutmanager.ShortcutManagerUsageTest
Change-Id: I118de7e589ac8dd5924d3740c70903fa484b79b5
2020-02-13 12:01:13 -08:00
Alex Kershaw
e7a405a54e Merge "Give new permission to set cross-profile app-op to ManagedProvisioning" 2020-02-11 22:44:23 +00:00
Robin Lee
9be54b5b67 Give CONTROL_DEVICE_LIGHTS permission to the shell
Bug: 144979010
Bug: 144978691
Test: atest LightsManagerTest
Change-Id: I2924460c76ce4545c9c3dd3875456b936fe3fc69
Merged-In: I2b4224e79e013bae27ee068b0a0898b5afa5489a
2020-02-11 17:46:40 +00:00
Alex Kershaw
0124a09844 Give new permission to set cross-profile app-op to ManagedProvisioning
This is required for the provisioning cross-profile consent screen which
is used to take some apps off INTERACT_ACROSS_USERS.

Hidden API CrossProfileApps#setInteractAcrossProfilesAppOp is changed
from requiring the broad app-op permissions to requiring
CONFIGURE_INTERACT_ACROSS_PROFILES. It then clears identity before
calling into AppOpsManager. For convenience, we also allow apps (such as
Settings) with the broader app-op permissions to continue to call this
method; in that case, we simply don't clear the identity and let
AppOpsManager check the permissions (so we allow AppOpsManager to set
the requirements if you don't have the new
CONFIGURE_INTERACT_ACROSS_PROFILES).

The CL also adds 'withCleanCallingIdentity' support to
CrossProfileAppsServiceImpl and moves over existing calls.

Bug: 136249261
Bug: 140728653
Test: atest --verbose com.android.managedprovisioning.provisioning.crossprofile.CrossProfileConsentActivityRoboTest
Change-Id: Ibd304563dd1ef5f16784e3502be5ef1ec4675b63
2020-02-11 14:06:33 +00:00
Chris Ye
473c84ff4c Access to Device Vibrator State
Add API to access vibrator state and vibrator state listener.

Bug: 135949568
Change-Id: I96636b432d581cea03a9fc9fecba4c08045f5006
2020-02-11 00:02:37 +00:00
Automerger Merge Worker
746ba5d891 Merge "More renames for API council" am: b03661f5d8 am: 02e64e352c am: 9522f9ff0f
Change-Id: I642777126bf77db09c8b64a8302145472272c9c6
2020-02-06 17:48:17 +00:00
Jack Yu
4d5d4fb7ba Merge changes from topics "area_info_refactor", "dbgf_test"
* changes:
  Added device-based geo-fencing debug info support
  Refactored cell broadcast area info support
2020-02-06 17:17:49 +00:00
Neil Fuller
b03661f5d8 Merge "More renames for API council" 2020-02-06 17:05:02 +00:00
Automerger Merge Worker
29097108e3 Merge "Add permissions for using PlatformCompat methods" am: 7202e904c9 am: 69ca2fcfa0 am: 9e28d2118f
Change-Id: Id9b74f1f74f3e4efaaa3e1657a64b7f8d229cc01
2020-02-06 14:18:16 +00:00
Andrei-Valentin Onea
7202e904c9 Merge "Add permissions for using PlatformCompat methods" 2020-02-06 13:40:34 +00:00
Andrei Onea
26559bcb40 Add permissions for using PlatformCompat methods
- READ_COMPAT_CHANGE_CONFIG is required to read the current state of the
config
- LOG_COMPAT_CHANGE is required to log the status of a compat change for
a package and/or uid to statsd
- OVERRIDE_COMPAT_CHANGE_CONFIG is required to add overrides

The permissions must be signature|privileged, as there are already
examples of code which this would not be sufficient (e.g.
MediaProvider).

This is a re-landing of https://r.android.com/1209240, which was
reverted due to http://b/142942524. The actual fix was done in
http://ag/10234812.


Bug: 142650523
Test: atest PlatformCompatTest
Test: atest PlatformCompatPermissionsTest
Change-Id: Ie9429477c9a1725b5cb67756787bf742038e5d2b
2020-02-06 12:22:42 +00:00
Neil Fuller
c0d59e39d7 More renames for API council
Renames PhoneTime[|Zone]Suggestion to TelephonyTime[|Zone]Suggestion.
Makes changes to generally avoid PHONE and use SLOT_INDEX or telephony
as appropriate for the usage. Removes telephony / phone from a few
variable names where it doesn't add value.

This commit also renames some remaining phoneId instances to slotIndex
which were missed when that rename happened.

Bug: 148842434
Test: treehugger
Change-Id: I4302e68082b802b75b53c02a9c9b1ae39dff6085
2020-02-06 08:41:26 +00:00
Jack Yu
324ca000ac Refactored cell broadcast area info support
Area info cell broadcast messages are not handled
by cell broadcast receiver anymore. Instead, they will
be processed in cell broadcast service. Privileged apps
that are interested in getting the information will need
to get it directly from cell broadcast service.

Note this is only enabled for certain countries and carriers.

Test: Manual
Bug: 141318859
Bug: 141425194

Merged-In: I2245c39f679d0ad94c9a1325edc553f362fdce7c
Change-Id: I2245c39f679d0ad94c9a1325edc553f362fdce7c
(cherry picked from commit 80e4320435)
2020-02-04 20:49:23 -08:00
Eugene Susla
177caa7a2b Merge "Auto-revoke permissions for unused apps" 2020-02-04 18:31:09 +00:00
Jack Yu
80e4320435 Refactored cell broadcast area info support
Area info cell broadcast messages are not handled
by cell broadcast receiver anymore. Instead, they will
be processed in cell broadcast service. Privileged apps
that are interested in getting the information will need
to get it directly from cell broadcast service.

Note this is only enabled for certain countries and carriers.

Test: Manual
Bug: 141318859
Bug: 141425194

Change-Id: I2245c39f679d0ad94c9a1325edc553f362fdce7c
2020-02-04 00:35:58 +00:00
Nikita Ioffe
bf19417b0d Grant shell REBOOT permission
Shell already can reboot a device (via `adb reboot` command). This
change allows shell to also trigger a reboot logic inside the
system_server.

Additionally, it allows to CTS test PowerManager.reboot API.

Test: adb shell svc reboot
Change-Id: I4545c4f3587fee2840a00648c569f75bb57501fc
Merged-In: I4545c4f3587fee2840a00648c569f75bb57501fc
2020-02-03 23:35:24 +00:00