Change the existing permission to a system level perm
for factory reset prep.
Bug: 302016478
Test: local
Change-Id: If8ede49445ce1e26a77af04216654c8f9db9c421
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a08bda3..578044f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -16,11 +16,6 @@
android:name="com.android.settings.USE_BIOMETRIC_PROVIDER"
android:protectionLevel="signature|privileged"/>
- <!-- Permissions for acting as the factory reset preparation application. -->
- <permission
- android:name="com.android.settings.permissions.PREPARE_FACTORY_RESET"
- android:protectionLevel="signature|privileged"/>
-
<uses-permission android:name="android.permission.REQUEST_NETWORK_SCORES" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
diff --git a/src/com/android/settings/system/FactoryResetPreferenceController.java b/src/com/android/settings/system/FactoryResetPreferenceController.java
index 739a0a7..e62e548 100644
--- a/src/com/android/settings/system/FactoryResetPreferenceController.java
+++ b/src/com/android/settings/system/FactoryResetPreferenceController.java
@@ -15,6 +15,7 @@
*/
package com.android.settings.system;
+import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
@@ -38,9 +39,6 @@
private static final String ACTION_PREPARE_FACTORY_RESET =
"com.android.settings.ACTION_PREPARE_FACTORY_RESET";
- private static final String PREPARE_FACTORY_RESET_PERMISSION =
- "com.android.settings.permissions.PREPARE_FACTORY_RESET";
-
private final UserManager mUm;
private ActivityResultLauncher<Intent> mFactoryResetPreparationLauncher;
@@ -103,7 +101,7 @@
boolean isGranted =
(factoryResetWizardPackageInfo.requestedPermissionsFlags[i]
& PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0;
- if (permission.equals(PREPARE_FACTORY_RESET_PERMISSION) && isGranted) {
+ if (permission.equals(Manifest.permission.PREPARE_FACTORY_RESET) && isGranted) {
return prepareFactoryResetWizardRequest;
}
}