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

Commit f233c4fa authored by Rupesh Bansal's avatar Rupesh Bansal Committed by Android (Google) Code Review
Browse files

Merge "Added feature flag for disabling frozen wakelocks" into main

parents 77f101f7 0ab21806
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -67,6 +67,10 @@ public class PowerManagerFlags {
            new FlagState(Flags.FLAG_WAKELOCK_ATTRIBUTION_VIA_WORKCHAIN,
                    Flags::wakelockAttributionViaWorkchain);

    private final FlagState mDisableFrozenProcessWakelocks =
            new FlagState(Flags.FLAG_DISABLE_FROZEN_PROCESS_WAKELOCKS,
                    Flags::disableFrozenProcessWakelocks);

    /** Returns whether early-screen-timeout-detector is enabled on not. */
    public boolean isEarlyScreenTimeoutDetectorEnabled() {
        return mEarlyScreenTimeoutDetectorFlagState.isEnabled();
@@ -120,6 +124,13 @@ public class PowerManagerFlags {
        return mWakelockAttributionViaWorkchain.isEnabled();
    }

    /**
     * @return Whether the feature to disable the frozen process wakelocks is enabled
     */
    public boolean isDisableFrozenProcessWakelocksEnabled() {
        return mDisableFrozenProcessWakelocks.isEnabled();
    }

    /**
     * dumps all flagstates
     * @param pw printWriter
@@ -132,6 +143,7 @@ public class PowerManagerFlags {
        pw.println(" " + mFrameworkWakelockInfo);
        pw.println(" " + mMoveWscLoggingToNotifier);
        pw.println(" " + mWakelockAttributionViaWorkchain);
        pw.println(" " + mDisableFrozenProcessWakelocks);
    }

    private static class FlagState {
+7 −0
Original line number Diff line number Diff line
@@ -70,3 +70,10 @@ flag {
    description: "Feature flag to move logging of WakelockStateChanged atoms from BatteryStatsImpl to Notifier."
    bug: "352602149"
}

flag {
    name: "disable_frozen_process_wakelocks"
    namespace: "power"
    description: "Feature flag to disable/enable wakelocks of a process when it is frozen/unfrozen"
    bug: "291115867"
}