Add permissions check for brightness changes via shell.

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
This commit is contained in:
Santos Cordon
2019-12-18 13:01:05 +00:00
parent 44e5637c75
commit c4fd8e6558
3 changed files with 54 additions and 45 deletions

View File

@@ -230,6 +230,9 @@
<!-- Permission required for CTS test - CtsOsTestCases -->
<uses-permission android:name="android.permission.MANAGE_CRATES"/>
<!-- Allows setting brightness from the shell -->
<uses-permission android:name="android.permission.CONTROL_DISPLAY_BRIGHTNESS"/>
<application android:label="@string/app_label"
android:theme="@android:style/Theme.DeviceDefault.DayNight"
android:defaultToDeviceProtectedStorage="true"