From 0569121109cd129b38ba36169bc4d6f253c51a4b Mon Sep 17 00:00:00 2001 From: James Willcox Date: Tue, 11 Jun 2024 20:53:21 +0000 Subject: [PATCH] Add @RequiresPermission to ACTION_PREPARE_FACTORY_RESET Also make it public. This should allow it to be detected appropriately by the GMSCore permission registry machinery. Bug; 346611867 Test: builds Change-Id: I15aa99541f33124ab6aea284889351d86753fa56 --- .../settings/system/FactoryResetPreferenceController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/system/FactoryResetPreferenceController.java b/src/com/android/settings/system/FactoryResetPreferenceController.java index df7cc3df3a2..54c97a389b8 100644 --- a/src/com/android/settings/system/FactoryResetPreferenceController.java +++ b/src/com/android/settings/system/FactoryResetPreferenceController.java @@ -16,6 +16,7 @@ package com.android.settings.system; import android.Manifest; +import android.annotation.RequiresPermission; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; @@ -37,8 +38,8 @@ public class FactoryResetPreferenceController extends BasePreferenceController { private static final String TAG = "FactoryResetPreference"; - @VisibleForTesting - static final String ACTION_PREPARE_FACTORY_RESET = + @RequiresPermission(Manifest.permission.PREPARE_FACTORY_RESET) + public static final String ACTION_PREPARE_FACTORY_RESET = "com.android.settings.ACTION_PREPARE_FACTORY_RESET"; private final UserManager mUm;