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

Commit f8b40546 authored by Jay Thomas Sullivan's avatar Jay Thomas Sullivan
Browse files

[ECM] Legacy code: treat DEFAULT as ALLOWED (st)

This modifies pre-flag behavior so that MODE_DEFAULT (of
OP_ACCESS_RESTRICTED_SETTINGS) is treated the
same as MODE_ALLOWED.

The reason is that we've change the default op mode (of
OP_ACCESS_RESTRICTED_SETTINGS) to MODE_DEFAULT. Since legacy code
doesn't understand what MODE_DEFAULT means, we need to mitigate the
impact of reverted flags.

Bug: 329488185
Test: atest SpaPrivilegedLibTests
Test: atest
com.android.settings.applications.specialaccess.notificationaccess
Test: atest com.android.settings.datausage
Test: atest PremiumSmsAccessTest
Test: atest RestrictedPreferenceHelperTest
Test: atest
CtsPermissionUiTestCases:android.permissionui.cts.EnhancedConfirmationManagerTest

Change-Id: I957c75870018a9d4d2d2e122ee3bb2252b338cb2
parent dd5b4d3d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -267,7 +267,8 @@ public class RestrictedPreferenceHelper {
                            preference.getUid(), preference.getPackageName());
                    final boolean ecmEnabled = mContext.getResources().getBoolean(
                            com.android.internal.R.bool.config_enhancedConfirmationModeEnabled);
                    appOpsAllowed = !ecmEnabled || mode == AppOpsManager.MODE_ALLOWED;
                    appOpsAllowed = !ecmEnabled || mode == AppOpsManager.MODE_ALLOWED
                            || mode == AppOpsManager.MODE_DEFAULT;
                    serviceAllowed = appOpsAllowed;
                } catch (Exception e) {
                    // Allow service in case if app ops is not available in testing.