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

Commit a0c78a05 authored by Jay Sullivan's avatar Jay Sullivan Committed by Android (Google) Code Review
Browse files

Merge "[ECM] Legacy code: treat DEFAULT as ALLOWED" into main

parents 9120c0f5 95d93a6d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -144,7 +144,8 @@ public class RestrictedLockUtilsInternal extends RestrictedLockUtils {
                        uid, packageName);
                final boolean ecmEnabled = context.getResources().getBoolean(
                        com.android.internal.R.bool.config_enhancedConfirmationModeEnabled);
                return ecmEnabled && mode != AppOpsManager.MODE_ALLOWED;
                return ecmEnabled && mode != AppOpsManager.MODE_ALLOWED
                        && mode != AppOpsManager.MODE_DEFAULT;
            } catch (Exception e) {
                // Fallback in case if app ops is not available in testing.
                return false;
+2 −1
Original line number Diff line number Diff line
@@ -289,7 +289,8 @@ public class RestrictedSwitchPreference extends SwitchPreferenceCompat {
                uid, packageName);
        final boolean ecmEnabled = getContext().getResources().getBoolean(
                com.android.internal.R.bool.config_enhancedConfirmationModeEnabled);
        final boolean appOpsAllowed = !ecmEnabled || mode == AppOpsManager.MODE_ALLOWED;
        final boolean appOpsAllowed = !ecmEnabled || mode == AppOpsManager.MODE_ALLOWED
                || mode == AppOpsManager.MODE_DEFAULT;
        if (!isEnableAllowed && !isEnabled) {
            setEnabled(false);
        } else if (isEnabled) {
+2 −1
Original line number Diff line number Diff line
@@ -4815,7 +4815,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
                                        uid, packageName);
                        final boolean ecmEnabled = mContext.getResources().getBoolean(
                                com.android.internal.R.bool.config_enhancedConfirmationModeEnabled);
                        return !ecmEnabled || mode == AppOpsManager.MODE_ALLOWED;
                        return !ecmEnabled || mode == AppOpsManager.MODE_ALLOWED
                                || mode == AppOpsManager.MODE_DEFAULT;
                    } catch (Exception e) {
                        // Fallback in case if app ops is not available in testing.
                        return false;
+1 −1
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ public final class PackageUtils {
            final int mode = context.getSystemService(AppOpsManager.class).noteOpNoThrow(
                    AppOpsManager.OP_ACCESS_RESTRICTED_SETTINGS, uid,
                    packageName, /* attributionTag= */ null, /* message= */ null);
            return mode == AppOpsManager.MODE_ALLOWED;
            return mode == AppOpsManager.MODE_ALLOWED || mode == AppOpsManager.MODE_DEFAULT;
        }
    }
}