Commit Graph

1038 Commits

Author SHA1 Message Date
Bill Yi
84e5cae5e8 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I652ec2029d0205de82b618fecec7e99a26b1bbd7
2020-10-31 00:37:18 +00:00
Bill Yi
8c4c530422 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I18c501af0e75d2afd6b857b02a93e03dfc9bab56
2020-07-18 23:37:31 -07:00
Joshua Duong
f2e03b393f Add shell permissions for CTS test (AdbManagerTest).
Bug: 159936209

Test: atest CtsAdbManagerTests
Change-Id: I896b53df582cceb7d1b0d6694d00064b0fb57b94
2020-06-25 15:03:19 -07:00
Nathan Harold
89796d4936 Allow Background Location Access for Shell
The shell has COARSE and FINE permission, but it
needs background access to support CTS test cases
that must be run with elevated permissions from
the shell.

Bug: 159236070
Test: atest PhoneStateListenerTest#testBarringInfo

Change-Id: Iba3fcb3a43c5df3c30dadf6b7733eaee03d1d0e3
2020-06-19 09:03:29 -07:00
Bill Yi
0edbd7bf02 Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: I4ee30f50c8fc9ad7a9884eb5403a070f2ca40be0
2020-06-14 01:24:36 +00:00
Rhed Jao
fbc9630c3f Merge "Enable scrolling for bugreport info dialog" into rvc-dev 2020-06-05 10:23:59 +00:00
Rhed Jao
de2109b178 Enable scrolling for bugreport info dialog
Bug: 156291300
Test: Scrolls the dialog with largest display and font size.
Change-Id: Ic1c101612fb8cc0c281d96b62fee3f9309e6a66f
2020-06-05 14:20:41 +08:00
Dimuthu Gamage
a2b2226d6b Adding LOADER_USAGE_STATS permission to shell
This is expected to be used with adoptShellPermission in the Incremental CTS tests.

Test: atest android.content.pm.cts.PackageManagerShellCommandTest
(There will be future tests relying on this)

Bug: 158024822
Change-Id: I4f146337429679edddba698aa88bb9b2cb883ab9
2020-06-04 23:43:47 +00:00
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
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
TreeHugger Robot
f49fa1a9ea Merge "Add support for TvInputManager.acquireTvInputHardware CTS" into rvc-dev 2020-05-27 04:39:45 +00:00
Robin Lee
1d22ea4eca Merge "Take interactive bugreports on Android TV" into rvc-dev 2020-05-22 09:58:53 +00:00
Robin Lee
93059d2f0b Take interactive bugreports on Android TV
We want to take a screenshot immediately, not after dumpsys finished.
This also gives the user some feedback that we took a screenshot when
they were paying attention, whereas the notification might go under
the radar if posted the 30-90 seconds later it will be shown
otherwise.

Also gives us the progress notification in the Android TV notification
tray, which helps the user keep track of what is going on and how long
it is expected to take.

Previously either no feedback was shown at all on key press, or a simple
Toast was shown on selecting the bugreport option from the TV Settings
app.

Test: Press DPAD_CENTER + BACK, observe screenshot and progress.
Fix: 151865303
Change-Id: I78753697a7867042d28364a6b6d61fdb96f8bc96
2020-05-21 20:19:03 +00:00
TreeHugger Robot
6351c72746 Merge "Revert "Add a null home activity to Shell.apk"" into rvc-dev 2020-05-18 17:28:46 +00:00
TreeHugger Robot
c86a144dd0 Merge "Import translations. DO NOT MERGE" into rvc-dev 2020-05-15 20:09:36 +00:00
Bill Yi
197c8d4e8f Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: I2df45fec7fcb399134f93a57adc889d392bfcf15
2020-05-15 11:43:52 +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
TreeHugger Robot
e795081a19 Merge "Grant ACCESS_SHARED_LIBRARIES permission to Shell for testing." into rvc-dev 2020-05-11 19:47:42 +00:00
Bill Yi
f561833e30 Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: Ibe70e89bdbbb848c3a9a95c70f77febb52c38aad
2020-05-09 15:45:32 -07:00
Hai Zhang
a4b344c576 Grant ACCESS_SHARED_LIBRARIES permission to Shell for testing.
Bug: 154348597
Test: presubmit
Change-Id: Ic721288e8f1e1a1f255eca95b2efb7b6e0c7c83b
2020-05-08 14:14:09 -07:00
Isaac Chen
539298c1b9 Revert "Add a null home activity to Shell.apk"
This reverts commit 6b1c4a9e09.

Bug: 149226068
Bug: 149307007
Bug: 149780604
Test: $ lunch aosp_crosshatch-userdebug; m
      # flash and boot on a crosshatch
      # Settings -> Apps & notifications -> Default apps -> Home apps
      # Only Quickstep home is there; no Shell home any more
      $ lunch csi_arm64-userdebug; m
      # flash the resulted system.img on a crosshatch and boot
      $ atest DeviceHealthTests # all passed
Change-Id: I927b7dae779da25589f2198e0480c0f2a788a7e4
2020-05-08 14:35:24 +08:00
Eugene Susla
64c88c077e Fix auto revoke installer whitelist APIs
Test: ensure APIs work
Bug: 153607914
Change-Id: Ia477d26438037fed0e39758200ded0e0fc1e96bd
2020-05-07 16:02:20 -07:00
Bill Yi
ec80ca682a Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: Ib782c35d049cbea3ac47deb8ef27e307f8805e40
2020-05-04 21:18:47 -07:00
Abhijeet Kaur
873f59dc0e Merge "Delete empty bugreport files onError" into rvc-dev 2020-04-07 09:22:26 +00:00
Abhijeet Kaur
1a5687df2c Delete empty bugreport files onError
Bug: 152839953
Test: Take another bugreport, while one is in progress.
Without this change: bugreport files for the second bugreport can be
seen in /bugreports
With this change: no file for the second bugreport can be seen. This
is the expected behavior.

Change-Id: I45c1f66f3a52ba9a31413cf9748bc5504eaa65d0
2020-04-06 12:35:19 +01:00
Bill Yi
9c0d11cbb2 Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: I8eef41a13445c1463d2cd7789b8c375deedb1d97
2020-04-04 21:08:18 -07:00
TreeHugger Robot
abfb1b0eda Merge "Follow best practices for Atomic variables" into rvc-dev 2020-04-03 11:43:33 +00:00
Abhijeet Kaur
98deae1551 Follow best practices for Atomic variables
* Make Atomic variables final so it can never be re-assigned to a null
object and hence avoid NPE.
* Set the value of the variables instead of re-assigning the object.

Test: Manual
Bug: 152479372
Change-Id: I58279d589d6247c53155755223fd8863f1049257
2020-04-02 16:52:54 +00:00
Abhijeet Kaur
8449e85f3c Track bugreports immediately after triggering a bugreport
Remove an old hack that was put in place as bugreport ID was updated
a bit later in the bugreport generation phase.
This change removes the race condition around triggering bugreports
almost instantly.

Bug: 152292912
Test: Trigger consecutive bugreports from ActivityManager WAI. (Fails
without this change)

Change-Id: Ib08bc2c7d8ae765894998e5bfa0d9b6f3efa088b
2020-04-02 15:02:29 +01:00
TreeHugger Robot
8f08b1cd40 Merge "Delete bugreport file on bugreport cancel" into rvc-dev 2020-03-31 18:38:51 +00:00
Abhijeet Kaur
982b104755 Delete bugreport file on bugreport cancel
Note: bugreport Cancel is not the same as bugreport onError. Files are not
deleted onError, as it still has some information before the bugreport
crashed/stopped. Bugreport Cancel is triggered by the user, hence clean
up all the files.

Bug: 146994281
Test: Cancel interactive bugreport from UI, deletes the current
bugreport files

Change-Id: I2606e491cbaa20eaa60980e98af56a194bae2280
2020-03-30 17:25:04 +01:00
TreeHugger Robot
937e786319 Merge "Initialize progress and lastProgress AtomicIntegers" into rvc-dev 2020-03-27 12:03:54 +00:00
Todd Kennedy
fb590035e1 Merge "Define permission for installer API v2" into rvc-dev 2020-03-26 21:50:17 +00:00
Abhijeet Kaur
5f49375c4e Initialize progress and lastProgress AtomicIntegers
This is essential for bugreports that do not send progress updates.

Bug: 152343458
Test: Take and share full bugreport
Change-Id: Id634afd82a92c02d1cf96ffd719fff8670fb8709
2020-03-26 11:12:11 +00:00
Todd Kennedy
66ed8dff37 Define permission for installer API v2
The package installer v2 APIs were marked as @SystemApi merely as
a convenience for development. These APIs may change in the next
version of Android and their usage must be strictly controlled.

Bug: 151716357
Test: Manual. Use old Shell and see that incremental installation fails with a SecurityException
Test: Manual. Request INSTALLER_V2 permission for shell and see that incremental installation succeeds
Change-Id: I9612dc145eadda20083bcc43e7a35ef3cd90aa40
2020-03-25 12:57:05 -07:00
Abhijeet Kaur
0b304c36f6 Show predefined title and description in finished notification
shareTitle and shareDescription is passed by the caller of the
bugreport. Show these in the finished bugreport notification.

Pre-set shareTitle takes precedence over user modified title.

shareDescription and description are not related/dependant on each other
in any way.

Bug: 150333444
Test: Manual (by passing EXTRA_TITLE and EXTRA_DESCRIPTION from
ActivityManagerService when trigerring a bugreport)

Change-Id: I2bfd080aeee677cdc8d0af339d7ad4a29451c3e0
2020-03-25 15:55:27 +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
Abhijeet Kaur
78ef10aa72 Merge "Clean up code in BugreportProgressService" into rvc-dev 2020-03-23 14:18:44 +00: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
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
Abhijeet Kaur
e1be940b84 Clean up code in BugreportProgressService
* Make fields (progress, lastUpdate and finished) atomic to make them
thread safe and also reduce getters/setters.
* Make lastProgress a private field in BugreportInfo.
* Move deleteScreenshots to BugreportInfo class.
* Make fields with lock protected getters/setters as private.
* Make fields that should not be changed as final.

Bug: 147033613
Test: manual
Merged-In: I8f0fb4865c1b7c5d62bebca3e250eee59b4e71f4
Change-Id: I8f0fb4865c1b7c5d62bebca3e250eee59b4e71f4
(cherry picked from commit fe7d1ab0cb)
2020-03-18 15:16:52 +00:00
Ruslan Tkhakokhov
547978ef1a Grant MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE permission to Shell
Bug: 151096665
Test: presubmit

This is needed for CTS tests to be able to call
Settings.System.putString(..., overrideableByRestore=true)

Change-Id: I7eb64df187bd59509067130c31c2e804f75d9830
2020-03-11 00:13:14 +00:00
David Su
7637ab6f52 Merge "Revert "Shell: Grant NETWORK_STACK permission for CTS"" into rvc-dev 2020-03-10 21:24:51 +00:00
Lorenzo Colitti
dcfaed6248 Revert "Shell: Grant NETWORK_STACK permission for CTS"
This reverts commit 8d14f5162a.

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

Change-Id: I5b933fe6850ebd5b5f230c16722357ead4ec4286
2020-03-09 08:30:06 +00:00
Tej Singh
0e4f868bb2 Merge "Make pull atom permission accessible to shell" into rvc-dev 2020-03-04 21:58:36 +00: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
David Su
8d14f5162a 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
Merged-In: I4f93e76bcda83c528f1f2c7bcf800965886ea8da
(clean cherry pick from AOSP)

Change-Id: I1502b2d53d3d43cce36ba6563533cd3560ff8747
2020-03-03 15:24:46 -08: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
Paul Murphy
5dbabb62a6 Merge "Add COMPANION_APPROVE_WIFI_CONNECTIONS to shell permissions" into rvc-dev 2020-02-29 23:42:23 +00:00