diff options
author | 2025-01-09 04:55:28 +0000 | |
---|---|---|
committer | 2025-01-31 18:44:02 +0000 | |
commit | f17b79fa6b1715d6dea68d6734f74498bcbd68f7 (patch) | |
tree | b673d49ddf4f41b1e1562e7fba8c685b0b58201f /packages/Shell | |
parent | c7fa90a2f1e41325fed9a658a5f6e44f993755fb (diff) |
Add helper functions for testing trade-in mode.
Trade-in mode is difficult to test in automation because it is
inherently a user build feature. If it were enabled on ro.debuggable=1
builds, "TIM adb" would conflict with normal adb. So, it is one or the
other, and we have to pick "normal adb" to not break all CI and
developer workflows.
To work around this, we are adding new APIs to ITradeInMode to enable
testing TIM when ro.debuggable=1. This will allow us to test certain
aspects of the SUW machinery and the "getstatus" command.
We do this by setting a new persist property that is read on the next
reboot. On next reboot, normal adb is forbidden from starting, and
trade-in mode adb is allowed to start instead. disableTesting() unsets
the persist property. These APIs are only allowed when ro.debuggable=1.
Finally, we add a test method to schedule the same factory reset
procedure that occurs within "tradeinmode evaluate".
All the testing methods are restricted to ENTER_TRADE_IN_MODE privileges
and require ro.debuggable=1.
Test: adb shell tradeinmode testing start
Bug: 379970773
Flag: com.android.tradeinmode.flags.enable_trade_in_mode
Change-Id: I58234d4d2202e0be347e1a0486b7a0869a7867d2
Diffstat (limited to 'packages/Shell')
-rw-r--r-- | packages/Shell/AndroidManifest.xml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml index 8fe3a0c4b4ae..55f7317f25e4 100644 --- a/packages/Shell/AndroidManifest.xml +++ b/packages/Shell/AndroidManifest.xml @@ -1015,6 +1015,9 @@ <uses-permission android:name="android.permission.MANAGE_GLOBAL_SOUND_QUALITY_SERVICE" /> <uses-permission android:name="android.permission.READ_COLOR_ZONES" /> + <!-- Permission required for trade-in mode testing --> + <uses-permission android:name="android.permission.ENTER_TRADE_IN_MODE" /> + <application android:label="@string/app_label" android:theme="@android:style/Theme.DeviceDefault.DayNight" |