Handle Exceptions around file creation/open fd more gracefully inside
BugreportInfo class. This is communicated to the caller of BugreportInfo
by returning null for getFd() methods.
Test: builds
Change-Id: Ie241dce0810645e04b2492dc8b1bcbc3e9f8f664
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
UsageStats will not return LOCUS_ID_SET events to callers
of #queryEvents and #queryEventsForUser if they don't have visibility.
Bug: 148821246
Test: manual, atest tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest
Change-Id: Ic904a97e66775ef63bc8b84e67e8f430b2a4121b
This reverts commit 349b2c11e9.
Reason for revert: This change was already made in aosp/1205113 and now Shell requests the permission twice.
Change-Id: Ice5522d7095f9b0dbc96c2ff31a976bfdd942c5a
Bugreport files and screenshot files are saved in the same directory.
Use common variable for consistency and to avoid duplicacy.
Move bugreport file and default screenshot file creation to the
constructor as for each bugreportInfo object a bugreportFile must exist.
Bug:123617758
Test: Takes interactive/full bugreports as expected
Change-Id: I338e852c543e63b403536cd852518b6601ea32f0
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
- 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
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
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
> 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
UsageStats will not return SHORTCUT_INVOCATION events to callers
of #queryEvents and #queryEventsForUser if they don't have visibility,
as defined by ShortcutService#hasShortcutHostPermission.
Also, add ACCESS_SHORTCUT permission to shell for CTS test and add the
ShortcutManagerUsageTest to postsubmit.
Bug: 145549490
Test: atest android.app.usage.cts.UsageStatsTest
Test: atest android.content.pm.cts.shortcutmanager.ShortcutManagerUsageTest
Change-Id: I2a69f061c35c31035a5d0381ab2f42029ec4fffc
This is required for ambient display tests
Bug: 147874708
Test: Run newly added ambient display tests.
Merged-In: I61c28e15c4e5c3d0ffee4137ecb86e33f7e8f64d
Change-Id: I26ab1cd48816ddb3aa8b30708726a3e1a3a20b9a
Legacy onProgress aidl listener callback function used to take 2 params:
progress and max. So, the client had to calculate the percentage
progress. This legacy onProgress method is removed.
Now dumpstate sends the actual progress in percentage without requiring
the client to calculate it.
Bug: 123617758
Test: Takes interactive bugreport as expected. And shows progress
notification as expected.
Change-Id: Ic5a355cc886e51b964f73c227f5f657173e99420
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
This is required for ambient display tests.
NOTE: This CL is manually cherry-picked from aosp/1215115 due to
merge conflict.
Bug: 147874708
Test: Run newly added ambient display tests.
Change-Id: I61c28e15c4e5c3d0ffee4137ecb86e33f7e8f64d
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
Add SystemConfigService and associated AIDLs and permissions for
accessing SystemConfig. The service returns values obtained from a
static instance of com.android.server.SystemConfig.
Bug: 143112379
Test: atest SystemConfigTest
Change-Id: I1a863ae9f53db21d698376008e5b1da83309b141
Also
- Adjusts some code structure around DisplayManagerShellCommand.
- Remove clearIdentity() on other display shell commands.
Test: Run all shell options for display in adb root and unroot.
Test: Verify that 'adb shell cmd display set-brightness *' still works.
Test: atest DisplayTest
Bug: 144920149
Change-Id: I9c6f584537a89a99f38871e280796fe66feeb312
Once the application called Context.getCrateDir(), the crates root
directory is also created. The application can mkdir directory under the
crates root. Each child directory in crates root is one crate.
Each crate information is descibed by CrateInfo. CrateInfo contains
the following information.
* Label:
It is used to display text to the users.
Default is the folder name.
* Expiration:
When the system needs more space. The system will clean the files
in the crates according to the expired or not.
Default is 0.
Test: atest \
CtsOsTestCases:android.os.storage.cts.CrateInfoTest \
CtsOsTestCases:android.os.storage.cts.StorageCrateTest \
CtsOsTestCases:android.os.storage.cts.StorageStatsManagerTest
Bug: 141660526
Change-Id: Icdc8123c481ef7c5b4fd68ffcfd334ffbfc9d655
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 43bbe8a2fc)