Commit Graph

1048 Commits

Author SHA1 Message Date
Treehugger Robot
4d79a92078 Merge "Add day-night-mode permission to Shell." am: 963c11e32d am: dbf9eed8c1
Change-Id: I5fe4468f78049f9907a92121b7e3661bb9598440
2020-05-11 22:56:39 +00:00
Treehugger Robot
dbf9eed8c1 Merge "Add day-night-mode permission to Shell." am: 963c11e32d
Change-Id: Iad4aba4108aa1d60e470388bfadf2bdc78984324
2020-05-11 22:38:44 +00:00
Treehugger Robot
302bed33d8 Merge "Grant ACCESS_SHARED_LIBRARIES permission to Shell for testing." am: 1b9f4b926c
Change-Id: I663020a8a74a913035cbbd7ceab31cac59871ba7
2020-05-11 22:36:42 +00:00
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
TreeHugger Robot
5eee203278 Merge "Grant ACCESS_SHARED_LIBRARIES permission to Shell for testing." into rvc-dev am: e795081a19
Change-Id: I813dd66a377329bc9a58492b0f35092ac4f3ee3c
2020-05-11 19:59:19 +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
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
Eugene Susla
8a63b1ab19 Merge "Fix auto revoke installer whitelist APIs" into rvc-dev am: 511c3aa955
Change-Id: I3a97457a60f9dfcc42e1dea65162c575b0c8b816
2020-05-10 05:14:17 +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
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
39d7ec4fd5 Merge "Delete empty bugreport files onError" into rvc-dev am: 873f59dc0e
Change-Id: I15e242816f24c218ce81d48912f76b1651ceaeb2
2020-04-07 09:34:04 +00: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
Eugene Susla
bfb6efe93a RESTRICT AUTOMERGE am: b4aaa9d8ad am: 6015cb062b
Change-Id: I0a679eb49f46041f39edc7f3f166eaef4ffb1c1c
2020-04-01 21:10:24 +00:00
Eugene Susla
6015cb062b RESTRICT AUTOMERGE am: b4aaa9d8ad
Change-Id: I47af344ace38759669c9e13a03aee96d3ed40b9e
2020-04-01 20:58:33 +00: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
Treehugger Robot
5fe173c31f Merge "Shell: Allow usage of wifi usability score APIs" am: dfeb2a2bfc am: 025d303874
Change-Id: I6a197220e3b6d4f0206991937bddbb9986e01f56
2020-03-20 00:23:25 +00: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
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
Treehugger Robot
d8f24b052d Merge "Add MODIFY_DEFAULT_AUDIO_EFFECTS permission to shell" am: a3161c6627 am: 3637bc567d
Change-Id: I2fbc86155d031625dfd68605bb632cfca63c714d
2020-03-19 17:51:15 +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
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
Eugene Susla
b4aaa9d8ad RESTRICT AUTOMERGE
Prevent accessing companion records from arbitrary uids

Test: manual
Fixes: 129476618
Change-Id: I7b18cfcdf58e62a445cbb508116c6ce7c1cea8d7
2020-03-16 14:15:22 -07:00
Automerger Merge Worker
89c4233ef2 Merge "Revert "Shell: Grant NETWORK_STACK permission for CTS"" am: 1e77133822 am: be8c96c95a
Change-Id: Id10c161a28492fbd9093be40190953a5dbb03d42
2020-03-11 04:55:34 +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 7df351b66f.

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
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
Automerger Merge Worker
437f6f134c Merge "Shell: Allow retrieval of wifi network credentials" am: 619cd57c1f am: b2c6b12cfb
Change-Id: I1637ec6e36fa52e2abd95c1cbbe11f9d593b7f7c
2020-03-03 21:40:31 +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