android-test icon indicating copy to clipboard operation
android-test copied to clipboard

Clearing package data also revokes development permissions on API < 23

Open consp1racy opened this issue 1 year ago • 0 comments

This matches the behavior on API 23 and newer.

Background

We have a custom androidTestUtil APK that backports UiConnection.executeShellCommand to Kitkat. It's AOSP-signed so it works in AVD, which has to be enough. We use it to grant a library under test android.permission.WRITE_SECURE_SETTINGS. We also need to clean that up in the test. Given that the instrumentation package and target package are the same, removing permission kills our instrumentation process. The solution is to revoke permissions from the orchestrator when testInstrumentationRunnerArguments["clearPackageData"] = "true".

consp1racy avatar Mar 22 '24 00:03 consp1racy