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:
@@ -16,11 +16,6 @@
|
|||||||
android:name="com.android.settings.USE_BIOMETRIC_PROVIDER"
|
android:name="com.android.settings.USE_BIOMETRIC_PROVIDER"
|
||||||
android:protectionLevel="signature|privileged"/>
|
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.REQUEST_NETWORK_SCORES" />
|
||||||
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.android.settings.system;
|
package com.android.settings.system;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
@@ -38,9 +39,6 @@ public class FactoryResetPreferenceController extends BasePreferenceController {
|
|||||||
private static final String ACTION_PREPARE_FACTORY_RESET =
|
private static final String ACTION_PREPARE_FACTORY_RESET =
|
||||||
"com.android.settings.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 final UserManager mUm;
|
||||||
private ActivityResultLauncher<Intent> mFactoryResetPreparationLauncher;
|
private ActivityResultLauncher<Intent> mFactoryResetPreparationLauncher;
|
||||||
|
|
||||||
@@ -103,7 +101,7 @@ public class FactoryResetPreferenceController extends BasePreferenceController {
|
|||||||
boolean isGranted =
|
boolean isGranted =
|
||||||
(factoryResetWizardPackageInfo.requestedPermissionsFlags[i]
|
(factoryResetWizardPackageInfo.requestedPermissionsFlags[i]
|
||||||
& PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0;
|
& PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0;
|
||||||
if (permission.equals(PREPARE_FACTORY_RESET_PERMISSION) && isGranted) {
|
if (permission.equals(Manifest.permission.PREPARE_FACTORY_RESET) && isGranted) {
|
||||||
return prepareFactoryResetWizardRequest;
|
return prepareFactoryResetWizardRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user