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

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

Merge "[ECM] Add delay before setMode" into main

parents bea630ce b83bc9e7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3039,13 +3039,14 @@ final class InstallPackageHelper {
            if (android.permission.flags.Flags.enhancedConfirmationModeApisEnabled()
                    && android.security.Flags.extendEcmToAllSettings()) {
                final int appId = request.getAppId();
                mPm.mHandler.post(() -> {
                // TODO: b/388960315 - Implement a long-term solution to race condition
                mPm.mHandler.postDelayed(() -> {
                    for (int userId : firstUserIds) {
                        // MODE_DEFAULT means that the app's guardedness will be decided lazily
                        setAccessRestrictedSettingsMode(packageName, appId, userId,
                                AppOpsManager.MODE_DEFAULT);
                    }
                });
                }, 1000L);
            } else {
                // Apply restricted settings on potentially dangerous packages. Needs to happen
                // after appOpsManager is notified of the new package