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

Commit f088d160 authored by Pierre Barbier de Reuille's avatar Pierre Barbier de Reuille
Browse files

Update the DM sysprop flags to override gantry's

In the DisplayManager, the sysprop flags are now suffixed with
`-override` and, if defined as true or false, will override the flag
from Gantry.

This allows testing what happens if the flag is turned on during
development or off during trunk staging or trunk fooding.

Fix: 304233664
Test: Manual
Change-Id: Iff5bd0aa8c99b0bb197701ac0f5f85af6bdc9510
parent c41764f9
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -138,19 +138,20 @@ public class DisplayManagerFlags {
        }

        private boolean flagOrSystemProperty(Supplier<Boolean> flagFunction, String flagName) {
            // TODO(b/299462337) Remove when the infrastructure is ready.
            if ((Build.IS_ENG || Build.IS_USERDEBUG)
                    && SystemProperties.getBoolean("persist.sys." + flagName, false)) {
                return true;
            }
            boolean flagValue = false;
            try {
                return flagFunction.get();
                flagValue = flagFunction.get();
            } catch (Throwable ex) {
                if (DEBUG) {
                    Slog.i(TAG, "Flags not ready yet. Return false for " + flagName, ex);
                }
                return false;
            }
            // TODO(b/299462337) Remove when the infrastructure is ready.
            if (Build.IS_ENG || Build.IS_USERDEBUG) {
                return SystemProperties.getBoolean("persist.sys." + flagName + "-override",
                        flagValue);
            }
            return flagValue;
        }
    }
}