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

Commit a794cdf6 authored by Edward Savage-Jones's avatar Edward Savage-Jones Committed by Ed Savage-Jones
Browse files

Allow fabricated RROs to survive a reboot in non-user builds

Fabricated RROs created by shell are quite useful for debugging
purposes during development.  Allow them to persist in non-user
builds.

Test: $ adb shell cmd overlay fabricate --target android --name Test android:bool/test 0x12 1
      $ adb shell cmd overlay enable com.android.shell:Test
      $ adb shell cmd overlay list | grep Test
      --- com.android.shell:Test
Change-Id: I4dfdb451ae4ae8ffe745b56c325fa3ce304a78e1
parent e3a5bb9d
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -289,12 +289,13 @@ public final class OverlayManagerService extends SystemService {

            restoreSettings();

            if (Build.IS_USER) {
                // Wipe all shell overlays on boot, to recover from a potentially broken device
                String shellPkgName = TextUtils.emptyIfNull(
                        getContext().getString(android.R.string.config_systemShell));
                mSettings.removeIf(overlayInfo -> overlayInfo.isFabricated
                        && shellPkgName.equals(overlayInfo.packageName));

            }
            initIfNeeded();
            onStartUser(UserHandle.USER_SYSTEM);