Loading packages/SystemUI/aconfig/systemui.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -1435,16 +1435,6 @@ flag { } } 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 } } flag { name: "media_lockscreen_launch_animation" namespace : "systemui" Loading packages/SystemUI/src/com/android/systemui/doze/DozeUi.java +3 −16 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ 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; Loading Loading @@ -84,13 +83,7 @@ public class DozeUi implements DozeMachine.Part { mBgExecutor = bgExecutor; mCanAnimateTransition = !params.getDisplayNeedsBlanking(); mDozeParameters = params; if (dozeuiSchedulingAlarmsBackgroundExecution()) { mTimeTicker = new AlarmTimeout(alarmManager, this::onTimeTick, "doze_time_tick", bgHandler); } else { mTimeTicker = new AlarmTimeout(alarmManager, this::onTimeTick, "doze_time_tick", handler); } mTimeTicker = new AlarmTimeout(alarmManager, this::onTimeTick, "doze_time_tick", bgHandler); mDozeLog = dozeLog; } Loading Loading @@ -184,7 +177,7 @@ public class DozeUi implements DozeMachine.Part { mTimeTickScheduled = true; long time = System.currentTimeMillis(); long delta = roundToNextMinute(time) - System.currentTimeMillis(); long delta = roundToNextMinute(time) - time; boolean scheduled = mTimeTicker.schedule(delta, AlarmTimeout.MODE_RESCHEDULE_IF_SCHEDULED); if (scheduled) { mDozeLog.traceTimeTickScheduled(time, time + delta); Loading Loading @@ -224,14 +217,8 @@ public class DozeUi implements DozeMachine.Part { private void onTimeTick() { verifyLastTimeTick(); if (dozeuiSchedulingAlarmsBackgroundExecution()) { mHandler.post(mHost::dozeTimeTick); } else { mHost.dozeTimeTick(); } // Keep wakelock until a frame has been pushed. mHandler.post(mWakeLock.wrap(() -> {})); mHandler.post(mWakeLock.wrap(mHost::dozeTimeTick)); mTimeTickScheduled = false; scheduleTimeTick(); Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +7 −0 Original line number Diff line number Diff line Loading @@ -1744,6 +1744,9 @@ public class KeyguardViewMediator implements CoreStartable, mJavaAdapter.alwaysCollectFlow( mWallpaperRepository.getWallpaperSupportsAmbientMode(), this::setWallpaperSupportsAmbientMode); mJavaAdapter.alwaysCollectFlow( mKeyguardInteractor.getDozeTimeTick(), this::triggerTimeUpdate); } @Override Loading Loading @@ -4056,6 +4059,10 @@ public class KeyguardViewMediator implements CoreStartable, mWallpaperSupportsAmbientMode = supportsAmbientMode; } private void triggerTimeUpdate(long timeInMillis) { mUpdateMonitor.triggerTimeUpdate(); } private static class StartKeyguardExitAnimParams { @WindowManager.TransitionOldType int mTransit; Loading packages/SystemUI/src/com/android/systemui/util/AlarmTimeout.java +1 −8 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.os.SystemClock; */ public class AlarmTimeout implements AlarmManager.OnAlarmListener { public static final int MODE_CRASH_IF_SCHEDULED = 0; public static final int MODE_IGNORE_IF_SCHEDULED = 1; public static final int MODE_RESCHEDULE_IF_SCHEDULED = 2; Loading @@ -48,17 +47,11 @@ public class AlarmTimeout implements AlarmManager.OnAlarmListener { * Schedules an alarm in {@code timeout} milliseconds in the future. * * @param timeout How long to wait from now. * @param mode {@link #MODE_CRASH_IF_SCHEDULED}, {@link #MODE_IGNORE_IF_SCHEDULED} or * {@link #MODE_RESCHEDULE_IF_SCHEDULED}. * @param mode {@link #MODE_IGNORE_IF_SCHEDULED} or {@link #MODE_RESCHEDULE_IF_SCHEDULED}. * @return {@code true} when scheduled successfully, {@code false} otherwise. */ public boolean schedule(long timeout, int mode) { switch (mode) { case MODE_CRASH_IF_SCHEDULED: if (mScheduled) { throw new IllegalStateException(mTag + " timeout is already scheduled"); } break; case MODE_IGNORE_IF_SCHEDULED: if (mScheduled) { return false; Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +1 −3 Original line number Diff line number Diff line Loading @@ -101,7 +101,6 @@ import com.android.systemui.dreams.ui.viewmodel.DreamViewModel; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FakeFeatureFlags; import com.android.systemui.flags.SystemPropertiesHelper; import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor; import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionBootInteractor; import com.android.systemui.kosmos.KosmosJavaAdapter; import com.android.systemui.log.SessionTracker; Loading Loading @@ -207,7 +206,6 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { private @Mock ShadeWindowLogger mShadeWindowLogger; private @Mock SelectedUserInteractor mSelectedUserInteractor; private @Mock UserTracker.Callback mUserTrackerCallback; private @Mock KeyguardInteractor mKeyguardInteractor; private @Mock KeyguardTransitionBootInteractor mKeyguardTransitionBootInteractor; private @Captor ArgumentCaptor<KeyguardStateController.Callback> mKeyguardStateControllerCallback; Loading Loading @@ -1499,7 +1497,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { mSystemPropertiesHelper, () -> mock(WindowManagerLockscreenVisibilityManager.class), mSelectedUserInteractor, mKeyguardInteractor, mKosmos.getKeyguardInteractor(), mKeyguardTransitionBootInteractor, mKosmos::getCommunalSceneInteractor, mock(WindowManagerOcclusionManager.class)); Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -1435,16 +1435,6 @@ flag { } } 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 } } flag { name: "media_lockscreen_launch_animation" namespace : "systemui" Loading
packages/SystemUI/src/com/android/systemui/doze/DozeUi.java +3 −16 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ 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; Loading Loading @@ -84,13 +83,7 @@ public class DozeUi implements DozeMachine.Part { mBgExecutor = bgExecutor; mCanAnimateTransition = !params.getDisplayNeedsBlanking(); mDozeParameters = params; if (dozeuiSchedulingAlarmsBackgroundExecution()) { mTimeTicker = new AlarmTimeout(alarmManager, this::onTimeTick, "doze_time_tick", bgHandler); } else { mTimeTicker = new AlarmTimeout(alarmManager, this::onTimeTick, "doze_time_tick", handler); } mTimeTicker = new AlarmTimeout(alarmManager, this::onTimeTick, "doze_time_tick", bgHandler); mDozeLog = dozeLog; } Loading Loading @@ -184,7 +177,7 @@ public class DozeUi implements DozeMachine.Part { mTimeTickScheduled = true; long time = System.currentTimeMillis(); long delta = roundToNextMinute(time) - System.currentTimeMillis(); long delta = roundToNextMinute(time) - time; boolean scheduled = mTimeTicker.schedule(delta, AlarmTimeout.MODE_RESCHEDULE_IF_SCHEDULED); if (scheduled) { mDozeLog.traceTimeTickScheduled(time, time + delta); Loading Loading @@ -224,14 +217,8 @@ public class DozeUi implements DozeMachine.Part { private void onTimeTick() { verifyLastTimeTick(); if (dozeuiSchedulingAlarmsBackgroundExecution()) { mHandler.post(mHost::dozeTimeTick); } else { mHost.dozeTimeTick(); } // Keep wakelock until a frame has been pushed. mHandler.post(mWakeLock.wrap(() -> {})); mHandler.post(mWakeLock.wrap(mHost::dozeTimeTick)); mTimeTickScheduled = false; scheduleTimeTick(); Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +7 −0 Original line number Diff line number Diff line Loading @@ -1744,6 +1744,9 @@ public class KeyguardViewMediator implements CoreStartable, mJavaAdapter.alwaysCollectFlow( mWallpaperRepository.getWallpaperSupportsAmbientMode(), this::setWallpaperSupportsAmbientMode); mJavaAdapter.alwaysCollectFlow( mKeyguardInteractor.getDozeTimeTick(), this::triggerTimeUpdate); } @Override Loading Loading @@ -4056,6 +4059,10 @@ public class KeyguardViewMediator implements CoreStartable, mWallpaperSupportsAmbientMode = supportsAmbientMode; } private void triggerTimeUpdate(long timeInMillis) { mUpdateMonitor.triggerTimeUpdate(); } private static class StartKeyguardExitAnimParams { @WindowManager.TransitionOldType int mTransit; Loading
packages/SystemUI/src/com/android/systemui/util/AlarmTimeout.java +1 −8 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.os.SystemClock; */ public class AlarmTimeout implements AlarmManager.OnAlarmListener { public static final int MODE_CRASH_IF_SCHEDULED = 0; public static final int MODE_IGNORE_IF_SCHEDULED = 1; public static final int MODE_RESCHEDULE_IF_SCHEDULED = 2; Loading @@ -48,17 +47,11 @@ public class AlarmTimeout implements AlarmManager.OnAlarmListener { * Schedules an alarm in {@code timeout} milliseconds in the future. * * @param timeout How long to wait from now. * @param mode {@link #MODE_CRASH_IF_SCHEDULED}, {@link #MODE_IGNORE_IF_SCHEDULED} or * {@link #MODE_RESCHEDULE_IF_SCHEDULED}. * @param mode {@link #MODE_IGNORE_IF_SCHEDULED} or {@link #MODE_RESCHEDULE_IF_SCHEDULED}. * @return {@code true} when scheduled successfully, {@code false} otherwise. */ public boolean schedule(long timeout, int mode) { switch (mode) { case MODE_CRASH_IF_SCHEDULED: if (mScheduled) { throw new IllegalStateException(mTag + " timeout is already scheduled"); } break; case MODE_IGNORE_IF_SCHEDULED: if (mScheduled) { return false; Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +1 −3 Original line number Diff line number Diff line Loading @@ -101,7 +101,6 @@ import com.android.systemui.dreams.ui.viewmodel.DreamViewModel; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FakeFeatureFlags; import com.android.systemui.flags.SystemPropertiesHelper; import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor; import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionBootInteractor; import com.android.systemui.kosmos.KosmosJavaAdapter; import com.android.systemui.log.SessionTracker; Loading Loading @@ -207,7 +206,6 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { private @Mock ShadeWindowLogger mShadeWindowLogger; private @Mock SelectedUserInteractor mSelectedUserInteractor; private @Mock UserTracker.Callback mUserTrackerCallback; private @Mock KeyguardInteractor mKeyguardInteractor; private @Mock KeyguardTransitionBootInteractor mKeyguardTransitionBootInteractor; private @Captor ArgumentCaptor<KeyguardStateController.Callback> mKeyguardStateControllerCallback; Loading Loading @@ -1499,7 +1497,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { mSystemPropertiesHelper, () -> mock(WindowManagerLockscreenVisibilityManager.class), mSelectedUserInteractor, mKeyguardInteractor, mKosmos.getKeyguardInteractor(), mKeyguardTransitionBootInteractor, mKosmos::getCommunalSceneInteractor, mock(WindowManagerOcclusionManager.class)); Loading