891 Commits

Author SHA1 Message Date
Treehugger Robot
963c11e32d Merge "Add day-night-mode permission to Shell." 2020-05-11 22:36:27 +00:00
Hai Zhang
68cc951bf6 Grant ACCESS_SHARED_LIBRARIES permission to Shell for testing.
Bug: 154348597
Test: presubmit
Change-Id: I75f07b88c6eca9d2296d3bcdbcc43ad9ff382023
Merged-In: Ic721288e8f1e1a1f255eca95b2efb7b6e0c7c83b
2020-05-11 21:06:35 +00:00
Kweku Adams
6adfa79de1 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: Ibfb145d762c73bba9de639d4050b9b26e4778cc9
2020-05-11 11:46:34 -07:00
Roshan Pius
7b0a22dcad 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
Merged-In: Ic173e44ab818cdfecebde80715ddaec347019db6
2020-03-19 23:14:31 +00:00
Eric Laurent
05388a0d50 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
Merged-In: Iba579001aeffd85743850727135a6f536579ea17
2020-03-18 21:23:50 +00:00
David Su
1e77133822 Merge "Revert "Shell: Grant NETWORK_STACK permission for CTS"" 2020-03-11 04:25:09 +00:00
Lorenzo Colitti
3ff68aeab2 Revert "Shell: Grant NETWORK_STACK permission for CTS"
This reverts commit 7df351b66fc2c5969fe1bbaa9734fe9f56a6f171.

Reason for revert: It is not appropriate from a security perspective for the shell to have this permission.

Test: None
Bug: 150236894
Change-Id: I1f2b69320540731f6d3044f31e2bc999281f8342
Merged-In: I5b933fe6850ebd5b5f230c16722357ead4ec4286
(This change was merged internally first.)
2020-03-11 03:27:53 +00:00
Roshan Pius
8679a96511 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
Merged-In: I6881003510191f667950be1ab27a5399fe3914b4
2020-03-03 20:32:27 +00:00
David Su
686594b470 Merge "Shell: Grant NETWORK_STACK permission for CTS" 2020-03-02 23:14:42 +00:00
David Su
7df351b66f Shell: Grant NETWORK_STACK permission for CTS
Grant NETWORK_STACK permission to the shell so
that CTS can use the shell identity to call
APIs protected with this permission.

Bug: 150236894
Test: atest android.net.wifi.cts.WifiManagerTest#testGetCountryCode
Change-Id: I4f93e76bcda83c528f1f2c7bcf800965886ea8da
2020-02-28 15:39:45 -08:00
Shafik Nassar
e21d0ea642 Merge "Revert "Request MANAGE_EXTERNAL_STORAGE permission"" 2020-02-14 13:35:34 +00:00
Shafik Nassar
7a49c869b8 Revert "Request MANAGE_EXTERNAL_STORAGE permission"
This reverts commit 349b2c11e91260ff5d6a6e55355722fad09626ea.

Reason for revert: This change was already made in aosp/1205113 and now Shell requests the permission twice.

Change-Id: Ice5522d7095f9b0dbc96c2ff31a976bfdd942c5a
2020-02-12 16:50:13 +00:00
Treehugger Robot
668daf0341 Merge "Give CONTROL_DEVICE_LIGHTS permission to the shell" 2020-02-11 21:55:09 +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
Treehugger Robot
fd2ba540df Merge "Add a null home activity to Shell.apk" 2020-02-07 07:59:39 +00:00
Isaac Chen
6b1c4a9e09 Add a null home activity to Shell.apk
In configurations where AOSP Settings.apk is not included, there might
not be any home activity. E.g. CSI doesn't have Settings.apk.

This CL adds a null home activity to Shell.apk, which is in CSI,
so the framework can be in a sane state. Without such null home
activity in CSI, package manager fails to install any APKs.

Bug: 148044842
Test: $ lunch csi_arm64-userdebug; m -j
      # Flash CSI to a Pixel (with AVB disabled) and reboot
      $ m DeviceHealthChecks
      $ adb install $OUT/testcases/DeviceHealthTests/arm64/DeviceHealthTests.apk
      Performing Streamed Install
      Success

Change-Id: I87999e30298bbe42af64f28e88fc6dc5975f1ca3
2020-02-07 12:50:39 +08: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
Nikita Ioffe
a656dd889d Merge "Grant shell REBOOT permission" 2020-02-04 23:01:44 +00:00
Treehugger Robot
602faa961a Merge "Add UPGRADE_RUNTIME_PERMISSIONS permission to support testing." 2020-02-03 23:50:29 +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
Hai Zhang
e244583ef0 Add UPGRADE_RUNTIME_PERMISSIONS permission to support testing.
Bug: 136503238
Test: presubmit
Merged-In: I7e40296120e18f2dfbbf04b5ae9d148724afa920
Change-Id: I7e40296120e18f2dfbbf04b5ae9d148724afa920
2020-02-03 13:05:28 -08:00
Treehugger Robot
8ca170d09a Merge "Import translations. DO NOT MERGE" 2020-02-01 20:33:25 +00:00
Bill Yi
25dbc49cfc Import translations. DO NOT MERGE
Change-Id: Id295f834c169dfc9fda8d12fe93efbd95ffa6d4b
Auto-generated-cl: translation import
2020-01-31 18:42:05 -08:00
sqian
dfdee636e3 Add LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH into Shell permission
> Is the minimally scoped permission that needs to be added?
This is a minimal permission for always listening to signal strength.

> What options did you explore that did not need this permission?
CTS is required by API council; Telephony CTS is using shell to have
system permission. I don't see other options.

Integrate the callback of LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH

Test: CTS; https://paste.googleplex.com/5811446241820672
Bug: 147322848
Change-Id: Id5afd261a7f00c25e3af3558f30fb92aad42f060
2020-01-30 14:14:43 -08:00
Steven Ng
733ac0d946 Grant READ_DREAM_STATE & WRITE_DREAM_STATE permissions to shell
This is required for ambient display tests

Bug: 147874708
Test: Run newly added ambient display tests.
Merged-In: I61c28e15c4e5c3d0ffee4137ecb86e33f7e8f64d
Change-Id: I26ab1cd48816ddb3aa8b30708726a3e1a3a20b9a
2020-01-29 09:54:19 +00:00
Zim
349b2c11e9 Request MANAGE_EXTERNAL_STORAGE permission
With the deprecation of WRITE_MEDIA_STORAGE in R. Apps should migrate
to requesting MANAGE_EXTERNAL_STORAGE permission

Test: m
Bug: 144914977
Change-Id: Ie42b5ceaf01111a1d3151f697ce173ddc3c7fd9b
2020-01-24 22:45:09 +00:00
Treehugger Robot
3095c56b3a Merge "Make com.android.shell request MANAGE_EXTERNAL_STORAGE" 2020-01-10 19:39:53 +00:00
shafik
ae42afc937 Make com.android.shell request MANAGE_EXTERNAL_STORAGE
This helps in testing using adoptShellPermissionIdentity.
Also, as a nice side-effect, it solves the problem where Settings app
crashes if no packages are requesting the permission.

Bug: 146778323
Fixes: 147434040
Test: device boots
Change-Id: I0982f854ad8260cab247882d04aea9bdcdf5d586
2020-01-10 16:16:29 +00:00
Mark Chien
30642b395c Merge "Add TETHER_PRIVILEGED permission to shell for CTS test." 2019-12-19 04:59:02 +00:00
Abhijeet Kaur
b7518de1b4 Add Light/Dark theme for bugreport warning dialog
Previously added "android:theme="@android:style/Theme.
DeviceDefault.DayNight" to the application tag in this manifest file to
enable dark theme for bugreport info.
BugreportWarningActivity is nested within this application tag, so
assumed all the child tags to have DayNight theme.

android:theme="@android:style/Theme.DeviceDefault.Dialog.Alert" shows
the dialog always as Dark mode.

android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.Alert"
shows the dialog always as Light mode.

This bug is not easily notice-able as "Do not show this again" checkbox
is checked by default for this dialog. Unless one wipes data partition,
this dialog doesn't come up even after flashing new builds.

Bug: 141663298
Bug: 146400225
Test: Normal (light mode) Trigger interactive/full/wifi bugreport.
      Click on bugreport finished "Share" notification.
      Light mode warning dialog should appear. (with white background)
      Uncheck the "Do not show this again" checkbox to test with dark
      mode.
Test: Go to Settings. Turn on Dark theme.
      Trigger interactive/full/wifi bugreport.
      Click on bugreport finished "Share" notification.
      Dark mode warning dialog should appear. (with dark grey background)

Merged-In: I200c592608261665e4c2416303f573522c6bc59a
Change-Id: I200c592608261665e4c2416303f573522c6bc59a
(cherry picked from commit 43bbe8a2fcce4bddfb59b8545e55ed328315a064)
2019-12-18 14:09:44 +00:00
Abhijeet Kaur
6a8f0fb9a5 Fix bugreport warning dialog
This bug was introduced when fixing dark theme for bugreport dialogs.

Bug: 135446537
Bug: 146400225
Test: manually (both in light and dark theme)
Merged-In: Ib8c16d068c00632d009033c2eab7d2d6cb7e4eea
Change-Id: Ib8c16d068c00632d009033c2eab7d2d6cb7e4eea
(cherry picked from commit f90de9746b119d2bc540b563ac7cc46fa7957366)
2019-12-18 14:09:17 +00:00
markchien
9fe658adc3 Add TETHER_PRIVILEGED permission to shell for CTS test.
Grant TETHER_PRIVILEGED permissions to the shell identity
for use within CTS tests.

Bug: 145490751
Test: atest CtsTetheringTest
Change-Id: Ifad265cdc5e0b1b1b2fa8f4f79eeb7dd18493624
Merged-In: Ifad265cdc5e0b1b1b2fa8f4f79eeb7dd18493624
2019-12-17 13:30:26 +00:00
Tyler Gunn
1d4fcf1703 Merge "Car mode InCallService changes." 2019-12-04 16:50:47 +00:00
Tyler Gunn
f701f7a765 Car mode InCallService changes.
1. Grant ENTER_CAR_MODE and CONTROL_INCALL_EXPERIENCE permissions to the
shell identity for use within CTS tests.
2. Remove un-needed Telecom shell command.

Test: unit tests, telecom CTS tests, manual testing
Bug: 144345414
Change-Id: I54a2e723d6ef9552117e6cadf4ab7c449dd5e3cb
2019-11-26 13:43:53 -08:00
Tyler Gunn
5474568b87 Merge "Add prioritized enableCarMode API in UiModeManager"
am: 8e7a1f8528

Change-Id: I81d8b4a457c567e19c3c8e499cc1f08e1c8af3b3
2019-11-20 00:17:34 -08:00
Tyler Gunn
f05f2c2cc2 Add prioritized enableCarMode API in UiModeManager
Per design doc (go/android-car-mode-design), added new system API to
enable car mode and specify a priority for the calling app.
Also modified UiModeManager to pass the package name of the caller to
UiModeManagerService.

Bug: 136109592
Test: Added new unit tests and CTS tests.
Test: Added Telecom test app functionality to verify.
Change-Id: I2848039c9ea18ba93e7694e04c4e5dc70759daa3
Merged-In: I2848039c9ea18ba93e7694e04c4e5dc70759daa3
2019-11-19 23:15:52 +00:00
TreeHugger Robot
abc015499a Merge "DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master" into stage-aosp-master 2019-10-31 18:38:40 +00:00
Kweku Adams
4d345d7af1 Move heap dump sharing to SHELL.
The system shouldn't be granting read URI permissions as itself. This
means that heap dumps aren't successfully shared. Moving the heap dump
sharing mechanism to SHELL, which already has the permission to dump
heaps so that dumps can be shared properly.

The ActivityManagerService changes are submitted separately.

Bug: 126885951
Bug: 135150619
Test: collect a heap dump and confirm it's successfully shared with an app
Test: do manual test on a secondary user & confirm it's not available to
other user

Change-Id: I6fad69280b5124c8ec2d3b4bef0f7dddb6a9422c
2019-10-29 15:17:42 -07:00
Brad Ebinger
32dfda5c4a Merge "Integrate the active emergency session listener in TelephonyRegistry" am: 4a54c2fa2b
am: 64418f4c31

Change-Id: Ideeb0afb508068fbe6feebbd472e94a24d94192f
2019-09-30 16:22:04 -07:00
Brad Ebinger
64418f4c31 Merge "Integrate the active emergency session listener in TelephonyRegistry"
am: 4a54c2fa2b

Change-Id: I890a913c18332669dee8f21baf81db78a50a0fb0
2019-09-30 16:08:04 -07:00
Shuo Qian
b61230c51d Integrate the active emergency session listener in TelephonyRegistry
Add Telecom shell command: "adb shell telecom set-system-dialer"

Test: PhoneStateListener cts
Bug: 135204580
Merged-In: I5eaada6a671606642a849f0ff6fe964332d80d5f
Change-Id: I5eaada6a671606642a849f0ff6fe964332d80d5f
2019-09-30 20:43:42 +00:00
Bill Yi
f4e73af0c3 Import translations. DO NOT MERGE
Change-Id: If07d6777ce034937bc52f3039b367aeff214c174
Auto-generated-cl: translation import
2019-09-25 15:29:18 -07:00
Dan Sandler
bc20d4e79f Bugreport progress notification should use the bug icon.
(Don't worry, stat_sys_adb isn't going away, but it will
only be used by the ADB notification now.)

Bug: 138661761
Test: initiate bugreport from globalactions
Change-Id: I238659d50f70bfbc047133d89afb76f78ec841f9
2019-09-12 23:11:36 -04:00
Nandana Dutt
b745860a3e Merge "Remove obsolete methods from DumpstateListener implementations"
am: cbdb10f982

Change-Id: Ia746b0cdadd0c4d652c373763f7a12266b080e3b
2019-08-07 07:08:27 -07:00
Nandana Dutt
cbdb10f982 Merge "Remove obsolete methods from DumpstateListener implementations" 2019-08-07 13:45:36 +00:00
Nandana Dutt
47c5ecc50a Remove obsolete methods from DumpstateListener implementations
Note that with the new Bugreporting API, SystemServer is the only
expected DumpstateListener implementation. Once we fully migrate Shell
app, we can remove the implementation in BugreportService as well.

BUG: 128980174
Test: bugreport from power menu, observe progress bar

Change-Id: I40d654a70bd9ceb3a29f8a0113b85616100f4ee9
Merged-In: I40d654a70bd9ceb3a29f8a0113b85616100f4ee9
2019-08-06 17:43:11 +00:00
jay
ed63903250 Merge "Clean up duplicated uses-permission"
am: 2bfe37de04

Change-Id: I283778ef4b61e9f0a7a6592f1be563da91e8c628
2019-08-05 13:10:39 -07:00
jay
67feca7041 Clean up duplicated uses-permission
android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS
It would be duplicated and we can remove it.

Bug:
Test: refactoring CL

Change-Id: I75bf3761be64d850781c29b734c2f7e60ef3b6a2
Signed-off-by: jay <jdragon.bae@gmail.com>
2019-07-26 09:09:03 +00:00
Abhijeet Kaur
1cceacc469 Merge "Add dark theme for Shell app." into qt-dev
am: 190e99cf3a

Change-Id: I5e0d09befb3d1d45176a8826b4710f001e6fdce3
2019-05-29 07:17:36 -07:00