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

Commit 68756981 authored by bvineeth's avatar bvineeth
Browse files

Move notifying powerManager userActivity to background thread

Test: checked perfetto binder transaction
Bug: 325203885
Flag: ACONFIG com.android.systemui.notify_power_manager_user_activity_background DEVELOPMENT

Change-Id: I5d9cc4a563748b2d07c9f6cac99ad271aebba58b
parent ab438ccc
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -546,3 +546,13 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "notify_power_manager_user_activity_background"
    namespace: "systemui"
    description: "Decide whether to notify the user activity to power manager in the background thread."
    bug: "325203885"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+6 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN;
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_FOR_UNATTENDED_UPDATE;
import static com.android.systemui.DejankUtils.whitelistIpcs;
import static com.android.systemui.Flags.notifyPowerManagerUserActivityBackground;
import static com.android.systemui.Flags.refactorGetCurrentUser;
import static com.android.systemui.keyguard.ui.viewmodel.LockscreenToDreamingTransitionViewModel.DREAMING_ANIMATION_DURATION_MS;
import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow;
@@ -1488,8 +1489,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
    }

    public void userActivity() {
        if (notifyPowerManagerUserActivityBackground()) {
            mUiBgExecutor.execute(() -> mPM.userActivity(mSystemClock.uptimeMillis(), false));
        } else {
            mPM.userActivity(mSystemClock.uptimeMillis(), false);
        }
    }

    private void setupLocked() {
        IntentFilter filter = new IntentFilter();