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

Commit 60b85b56 authored by Sindhu B's avatar Sindhu B Committed by Android (Google) Code Review
Browse files

Merge "Fix: DozeUi scheduling alarms causing jank on wakeup" into main

parents c35bb2ce 4fece3c1
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1064,3 +1064,13 @@ flag {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "dozeui_scheduling_alarms_background_execution"
  namespace: "systemui"
  description: "Decide whether to execute binder calls to schedule alarms in background thread"
  bug: "330492575"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+9 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.doze;

import static com.android.systemui.doze.DozeMachine.State.DOZE;
import static com.android.systemui.doze.DozeMachine.State.DOZE_AOD_PAUSED;
import static com.android.systemui.Flags.dozeuiSchedulingAlarmsBackgroundExecution;

import android.app.AlarmManager;
import android.content.Context;
@@ -70,6 +71,7 @@ public class DozeUi implements DozeMachine.Part {
    @Inject
    public DozeUi(Context context, AlarmManager alarmManager,
            WakeLock wakeLock, DozeHost host, @Main Handler handler,
            @Background Handler bgHandler,
            DozeParameters params,
            @Background DelayableExecutor bgExecutor,
            DozeLog dozeLog) {
@@ -80,7 +82,13 @@ public class DozeUi implements DozeMachine.Part {
        mBgExecutor = bgExecutor;
        mCanAnimateTransition = !params.getDisplayNeedsBlanking();
        mDozeParameters = params;
        mTimeTicker = new AlarmTimeout(alarmManager, this::onTimeTick, "doze_time_tick", handler);
        if (dozeuiSchedulingAlarmsBackgroundExecution()) {
            mTimeTicker = new AlarmTimeout(alarmManager, this::onTimeTick, "doze_time_tick",
                    bgHandler);
        } else {
            mTimeTicker = new AlarmTimeout(alarmManager, this::onTimeTick, "doze_time_tick",
                    handler);
        }
        mDozeLog = dozeLog;
    }

+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public class DozeUiTest extends SysuiTestCase {
        mHandler = mHandlerThread.getThreadHandler();
        mFakeExecutor = new FakeExecutor(new FakeSystemClock());
        mDozeUi = new DozeUi(mContext, mAlarmManager, mWakeLock, mHost, mHandler,
                mDozeParameters, mFakeExecutor, mDozeLog);
                mHandler, mDozeParameters, mFakeExecutor, mDozeLog);
        mDozeUi.setDozeMachine(mMachine);
    }