Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b347d32b authored by Omer Ozer's avatar Omer Ozer Committed by Android (Google) Code Review
Browse files

Merge "Change the existing permission to a system level perm for factory reset prep." into main

parents 958a6ab7 1d9c2a6f
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -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" />
+2 −4
Original line number Diff line number Diff line
@@ -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;
                }
            }