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

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

Simplify DisplayManager flag library

Now all the flags are read-only, we don't need to intercept the
exception, as it cannot happen anymore.

Note, there is one flag that is read-write, but it is not used anymore
and will be cleaned up soon.

Fix: 297159910
Test: Manual
Change-Id: Iac1e22bd292f02bee7a5cc4fce6ae618dfe0258f
parent 20cc1ac3
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -121,7 +121,6 @@ public class DisplayManagerFlags {
            mFlagFunction = flagFunction;
        }

        // TODO(b/297159910): Simplify using READ-ONLY flags when available.
        private boolean isEnabled() {
            if (mEnabledSet) {
                if (DEBUG) {
@@ -138,14 +137,7 @@ public class DisplayManagerFlags {
        }

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