Merge "Apply enhanced confirmation mode OEM config to Settings" into tm-dev am: fd7153ed39

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17615240

Change-Id: I8342a30b9e86699fcce7f8f5858572def92c30ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Ricky Wai
2022-04-22 15:18:58 +00:00
committed by Automerger Merge Worker
2 changed files with 6 additions and 2 deletions

View File

@@ -163,7 +163,9 @@ public class AccessibilityDetailsSettingsFragment extends InstrumentedFragment {
try { try {
final int mode = mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_RESTRICTED_SETTINGS, final int mode = mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_RESTRICTED_SETTINGS,
uid, packageName); uid, packageName);
return mode != AppOpsManager.MODE_ERRORED && mode != AppOpsManager.MODE_IGNORED; final boolean ecmEnabled = getContext().getResources().getBoolean(
com.android.internal.R.bool.config_enhancedConfirmationModeEnabled);
return !ecmEnabled || mode == AppOpsManager.MODE_ALLOWED;
} catch (Exception e) { } catch (Exception e) {
// Fallback in case if app ops is not available in testing. // Fallback in case if app ops is not available in testing.
return true; return true;

View File

@@ -233,7 +233,9 @@ public class RestrictedPreferenceHelper {
final int mode = mAppOps.noteOpNoThrow( final int mode = mAppOps.noteOpNoThrow(
AppOpsManager.OP_ACCESS_RESTRICTED_SETTINGS, AppOpsManager.OP_ACCESS_RESTRICTED_SETTINGS,
preference.getUid(), preference.getPackageName()); preference.getUid(), preference.getPackageName());
appOpsAllowed = mode == AppOpsManager.MODE_ALLOWED; final boolean ecmEnabled = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_enhancedConfirmationModeEnabled);
appOpsAllowed = !ecmEnabled || mode == AppOpsManager.MODE_ALLOWED;
serviceAllowed = appOpsAllowed; serviceAllowed = appOpsAllowed;
} catch (Exception e) { } catch (Exception e) {
// Allow service in case if app ops is not available in testing. // Allow service in case if app ops is not available in testing.