Change the existing permission to a system level perm

for factory reset prep.

Bug: 302016478
Test: local
Change-Id: If8ede49445ce1e26a77af04216654c8f9db9c421
This commit is contained in:
Omer Ozer
2023-11-07 18:10:56 +00:00
parent 9718ae0aa9
commit 1d9c2a6f11
2 changed files with 2 additions and 9 deletions

View File

@@ -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" />

View File

@@ -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 @@ public class FactoryResetPreferenceController extends BasePreferenceController {
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 @@ public class FactoryResetPreferenceController extends BasePreferenceController {
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;
}
}