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

Commit 47ee1497 authored by Danae Savvidi's avatar Danae Savvidi
Browse files

Create flag for display events logging

Add flag for logging the display event occurred atom. The atom logs display event type and client UIDs. This atom will be used to create a dashboard and metrics in Pitot to be able to detect regressions in the frequency of display events. The event type and the UIDs of the clients receiving the event is also included in the atom to further analyze this information.

Bug: 433479938
Flag: com.android.server.display.feature.flags.enable_logging_for_display_events
Test: atest DisplayServiceTests
Change-Id: I2c67be97bfacaab5a98338e1247df7992727df9d
parent 9925bb05
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -270,6 +270,11 @@ public class DisplayManagerFlags {
            Flags::enableOnDisplayAddedInObserver
    );

    private final FlagState mIsLoggingForDisplayEventsEnabled = new FlagState(
            Flags.FLAG_ENABLE_LOGGING_FOR_DISPLAY_EVENTS,
            Flags::enableLoggingForDisplayEvents
    );

    /** Returns whether power throttling clamper is enabled on not. */
    public boolean isPowerThrottlingClamperEnabled() {
        return mPowerThrottlingClamperFlagState.isEnabled();
@@ -551,6 +556,10 @@ public class DisplayManagerFlags {
        return mIsOnDisplayAddedInObserverEnabled.isEnabled();
    }

    public boolean isDisplayEventsLoggingEnabled() {
        return mIsLoggingForDisplayEventsEnabled.isEnabled();
    }

    /**
     * dumps all flagstates
     * @param pw printWriter
@@ -606,6 +615,7 @@ public class DisplayManagerFlags {
        pw.println(" " + mEnsureColorFadeWhenTurningOn);
        pw.println(" " + mIsOnDisplayAddedInObserverEnabled);
        pw.println(" " + mEnableUpdatedDisplayConnectionDialogFlagState);
        pw.println(" " + mIsLoggingForDisplayEventsEnabled);
    }

    private static class FlagState {
+7 −0
Original line number Diff line number Diff line
@@ -462,3 +462,10 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "enable_logging_for_display_events"
    namespace: "display_manager"
    description: "Enable logging statistics for display event occurrences."
    bug: "433479938"
}