Loading core/java/android/service/dreams/DreamOverlayService.java +5 −20 Original line number Diff line number Diff line Loading @@ -71,13 +71,7 @@ public abstract class DreamOverlayService extends Service { @Override public void wakeUp() { mService.wakeUp(this, () -> { try { mDreamOverlayCallback.onWakeUpComplete(); } catch (RemoteException e) { Log.e(TAG, "Could not notify dream of wakeUp", e); } }); mService.wakeUp(this); } @Override Loading Loading @@ -125,14 +119,14 @@ public abstract class DreamOverlayService extends Service { mCurrentClient = null; } private void wakeUp(OverlayClient client, Runnable callback) { private void wakeUp(OverlayClient client) { // Run on executor as this is a binder call from OverlayClient. mExecutor.execute(() -> { if (mCurrentClient != client) { return; } onWakeUp(callback); onWakeUp(); }); } Loading Loading @@ -190,19 +184,10 @@ public abstract class DreamOverlayService extends Service { /** * This method is overridden by implementations to handle when the dream has been requested * to wakeup. This allows any overlay animations to run. By default, the method will invoke * the callback immediately. * * This callback will be run on the {@link Executor} provided in the constructor if provided, or * on the main executor if none was provided. * * @param onCompleteCallback The callback to trigger to notify the dream service that the * overlay has completed waking up. * to wakeup. * @hide */ public void onWakeUp(@NonNull Runnable onCompleteCallback) { onCompleteCallback.run(); } public void onWakeUp() {} /** * This method is overridden by implementations to handle when the dream has ended. There may Loading core/java/android/service/dreams/DreamService.java +1 −7 Original line number Diff line number Diff line Loading @@ -249,13 +249,6 @@ public class DreamService extends Service implements Window.Callback { // Simply finish dream when exit is requested. mHandler.post(() -> finish()); } @Override public void onWakeUpComplete() { // Finish the dream once overlay animations are complete. Execute on handler since // this is coming in on the overlay binder. mHandler.post(() -> finish()); } }; Loading Loading @@ -923,6 +916,7 @@ public class DreamService extends Service implements Window.Callback { overlay.wakeUp(); } catch (RemoteException e) { Slog.e(TAG, "Error waking the overlay service", e); } finally { finish(); } }); Loading core/java/android/service/dreams/IDreamOverlayCallback.aidl +0 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,4 @@ interface IDreamOverlayCallback { * Invoked to request the dream exit. */ void onExitRequested(); /** Invoked when the dream overlay wakeUp animation is complete. */ void onWakeUpComplete(); } No newline at end of file packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayAnimationsController.kt +8 −4 Original line number Diff line number Diff line Loading @@ -34,13 +34,11 @@ import com.android.systemui.complication.ComplicationLayoutParams.POSITION_TOP import com.android.systemui.complication.ComplicationLayoutParams.Position import com.android.systemui.dreams.dagger.DreamOverlayModule import com.android.systemui.keyguard.ui.viewmodel.DreamingToLockscreenTransitionViewModel import com.android.systemui.keyguard.ui.viewmodel.DreamingToLockscreenTransitionViewModel.Companion.DREAM_ANIMATION_DURATION import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.statusbar.BlurUtils import com.android.systemui.statusbar.CrossFadeHelper import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener import com.android.systemui.util.concurrency.DelayableExecutor import javax.inject.Inject import javax.inject.Named import kotlinx.coroutines.flow.MutableStateFlow Loading Loading @@ -129,6 +127,12 @@ constructor( ) } } launch { transitionViewModel.transitionEnded.collect { _ -> mOverlayStateController.setExitAnimationsRunning(false) } } } configController.removeCallback(configCallback) Loading Loading @@ -251,9 +255,9 @@ constructor( } /** Starts the dream content and dream overlay exit animations. */ fun wakeUp(doneCallback: Runnable, executor: DelayableExecutor) { fun wakeUp() { cancelAnimations() executor.executeDelayed(doneCallback, DREAM_ANIMATION_DURATION.inWholeMilliseconds) mOverlayStateController.setExitAnimationsRunning(true) } /** Cancels the dream content and dream overlay animations, if they're currently running. */ Loading packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayContainerViewController.java +2 −10 Original line number Diff line number Diff line Loading @@ -31,8 +31,6 @@ import android.util.MathUtils; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import com.android.app.animation.Interpolators; import com.android.dream.lowlight.LowLightTransitionCoordinator; import com.android.systemui.R; Loading @@ -46,7 +44,6 @@ import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerCallbackInt import com.android.systemui.shade.ShadeExpansionChangeEvent; import com.android.systemui.statusbar.BlurUtils; import com.android.systemui.util.ViewController; import com.android.systemui.util.concurrency.DelayableExecutor; import java.util.Arrays; Loading Loading @@ -302,20 +299,15 @@ public class DreamOverlayContainerViewController extends /** * Handle the dream waking up and run any necessary animations. * * @param onAnimationEnd Callback to trigger once animations are finished. * @param callbackExecutor Executor to execute the callback on. */ public void wakeUp(@NonNull Runnable onAnimationEnd, @NonNull DelayableExecutor callbackExecutor) { public void wakeUp() { // When swiping causes wakeup, do not run any animations as the dream should exit as soon // as possible. if (mWakingUpFromSwipe) { onAnimationEnd.run(); return; } mDreamOverlayAnimationsController.wakeUp(onAnimationEnd, callbackExecutor); mDreamOverlayAnimationsController.wakeUp(); } @Override Loading Loading
core/java/android/service/dreams/DreamOverlayService.java +5 −20 Original line number Diff line number Diff line Loading @@ -71,13 +71,7 @@ public abstract class DreamOverlayService extends Service { @Override public void wakeUp() { mService.wakeUp(this, () -> { try { mDreamOverlayCallback.onWakeUpComplete(); } catch (RemoteException e) { Log.e(TAG, "Could not notify dream of wakeUp", e); } }); mService.wakeUp(this); } @Override Loading Loading @@ -125,14 +119,14 @@ public abstract class DreamOverlayService extends Service { mCurrentClient = null; } private void wakeUp(OverlayClient client, Runnable callback) { private void wakeUp(OverlayClient client) { // Run on executor as this is a binder call from OverlayClient. mExecutor.execute(() -> { if (mCurrentClient != client) { return; } onWakeUp(callback); onWakeUp(); }); } Loading Loading @@ -190,19 +184,10 @@ public abstract class DreamOverlayService extends Service { /** * This method is overridden by implementations to handle when the dream has been requested * to wakeup. This allows any overlay animations to run. By default, the method will invoke * the callback immediately. * * This callback will be run on the {@link Executor} provided in the constructor if provided, or * on the main executor if none was provided. * * @param onCompleteCallback The callback to trigger to notify the dream service that the * overlay has completed waking up. * to wakeup. * @hide */ public void onWakeUp(@NonNull Runnable onCompleteCallback) { onCompleteCallback.run(); } public void onWakeUp() {} /** * This method is overridden by implementations to handle when the dream has ended. There may Loading
core/java/android/service/dreams/DreamService.java +1 −7 Original line number Diff line number Diff line Loading @@ -249,13 +249,6 @@ public class DreamService extends Service implements Window.Callback { // Simply finish dream when exit is requested. mHandler.post(() -> finish()); } @Override public void onWakeUpComplete() { // Finish the dream once overlay animations are complete. Execute on handler since // this is coming in on the overlay binder. mHandler.post(() -> finish()); } }; Loading Loading @@ -923,6 +916,7 @@ public class DreamService extends Service implements Window.Callback { overlay.wakeUp(); } catch (RemoteException e) { Slog.e(TAG, "Error waking the overlay service", e); } finally { finish(); } }); Loading
core/java/android/service/dreams/IDreamOverlayCallback.aidl +0 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,4 @@ interface IDreamOverlayCallback { * Invoked to request the dream exit. */ void onExitRequested(); /** Invoked when the dream overlay wakeUp animation is complete. */ void onWakeUpComplete(); } No newline at end of file
packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayAnimationsController.kt +8 −4 Original line number Diff line number Diff line Loading @@ -34,13 +34,11 @@ import com.android.systemui.complication.ComplicationLayoutParams.POSITION_TOP import com.android.systemui.complication.ComplicationLayoutParams.Position import com.android.systemui.dreams.dagger.DreamOverlayModule import com.android.systemui.keyguard.ui.viewmodel.DreamingToLockscreenTransitionViewModel import com.android.systemui.keyguard.ui.viewmodel.DreamingToLockscreenTransitionViewModel.Companion.DREAM_ANIMATION_DURATION import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.statusbar.BlurUtils import com.android.systemui.statusbar.CrossFadeHelper import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener import com.android.systemui.util.concurrency.DelayableExecutor import javax.inject.Inject import javax.inject.Named import kotlinx.coroutines.flow.MutableStateFlow Loading Loading @@ -129,6 +127,12 @@ constructor( ) } } launch { transitionViewModel.transitionEnded.collect { _ -> mOverlayStateController.setExitAnimationsRunning(false) } } } configController.removeCallback(configCallback) Loading Loading @@ -251,9 +255,9 @@ constructor( } /** Starts the dream content and dream overlay exit animations. */ fun wakeUp(doneCallback: Runnable, executor: DelayableExecutor) { fun wakeUp() { cancelAnimations() executor.executeDelayed(doneCallback, DREAM_ANIMATION_DURATION.inWholeMilliseconds) mOverlayStateController.setExitAnimationsRunning(true) } /** Cancels the dream content and dream overlay animations, if they're currently running. */ Loading
packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayContainerViewController.java +2 −10 Original line number Diff line number Diff line Loading @@ -31,8 +31,6 @@ import android.util.MathUtils; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import com.android.app.animation.Interpolators; import com.android.dream.lowlight.LowLightTransitionCoordinator; import com.android.systemui.R; Loading @@ -46,7 +44,6 @@ import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerCallbackInt import com.android.systemui.shade.ShadeExpansionChangeEvent; import com.android.systemui.statusbar.BlurUtils; import com.android.systemui.util.ViewController; import com.android.systemui.util.concurrency.DelayableExecutor; import java.util.Arrays; Loading Loading @@ -302,20 +299,15 @@ public class DreamOverlayContainerViewController extends /** * Handle the dream waking up and run any necessary animations. * * @param onAnimationEnd Callback to trigger once animations are finished. * @param callbackExecutor Executor to execute the callback on. */ public void wakeUp(@NonNull Runnable onAnimationEnd, @NonNull DelayableExecutor callbackExecutor) { public void wakeUp() { // When swiping causes wakeup, do not run any animations as the dream should exit as soon // as possible. if (mWakingUpFromSwipe) { onAnimationEnd.run(); return; } mDreamOverlayAnimationsController.wakeUp(onAnimationEnd, callbackExecutor); mDreamOverlayAnimationsController.wakeUp(); } @Override Loading