Loading core/java/android/view/IWindowManager.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,11 @@ interface IWindowManager */ void cancelTaskWindowTransition(int taskId); /** * Cancels the thumbnail transitions for the given task. */ void cancelTaskThumbnailTransition(int taskId); // These can only be called with the SET_ORIENTATION permission. /** * Update the current screen rotation based on the current state of Loading packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +13 −12 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import com.android.internal.logging.MetricsLogger; import com.android.systemui.R; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.activity.AppWidgetProviderChangedEvent; import com.android.systemui.recents.events.activity.CancelEnterRecentsWindowAnimationEvent; import com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationStartedEvent; import com.android.systemui.recents.events.activity.EnterRecentsWindowLastAnimationFrameEvent; import com.android.systemui.recents.events.activity.HideRecentsEvent; Loading Loading @@ -355,12 +356,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); mRecentsView.getViewTreeObserver().addOnEnterAnimationCompleteListener(new ViewTreeObserver.OnEnterAnimationCompleteListener() { @Override public void onEnterAnimationComplete() { System.out.println("ENTER ANIMATION COMPLETE"); } }); mEmptyViewStub = (ViewStub) findViewById(R.id.empty_view_stub); mScrimViews = new SystemBarScrimViews(this); Loading Loading @@ -515,12 +510,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView if (event.getRepeatCount() <= 0 || hasRepKeyTimeElapsed) { // As we iterate to the next/previous task, cancel any current/lagging window // transition animations RecentsConfiguration config = Recents.getConfiguration(); RecentsActivityLaunchState launchState = config.getLaunchState(); if (launchState.launchedToTaskId != -1) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.cancelWindowTransition(launchState.launchedToTaskId); } EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(null)); // Focus the next task in the stack final boolean backward = event.isShiftPressed(); Loading Loading @@ -657,6 +647,17 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView mRecentsView.getViewTreeObserver().addOnPreDrawListener(this); } public final void onBusEvent(CancelEnterRecentsWindowAnimationEvent event) { RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); int launchToTaskId = launchState.launchedToTaskId; if (launchToTaskId != -1 && (event.launchTask == null || launchToTaskId != event.launchTask.key.id)) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.cancelWindowTransition(launchState.launchedToTaskId); ssp.cancelThumbnailTransition(getTaskId()); } } public final void onBusEvent(AppWidgetProviderChangedEvent event) { refreshSearchWidgetView(); } Loading packages/SystemUI/src/com/android/systemui/recents/events/activity/CancelEnterRecentsWindowAnimationEvent.java 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.recents.events.activity; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.model.Task; /** * This is sent when we want to cancel the enter-recents window animation for the launch task. */ public class CancelEnterRecentsWindowAnimationEvent extends EventBus.Event { // This is set for the task that is launching, which allows us to ensure that we are not // cancelling the same task animation (it will just be overwritten instead) public final Task launchTask; public CancelEnterRecentsWindowAnimationEvent(Task launchTask) { this.launchTask = launchTask; } } packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +13 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,19 @@ public class SystemServicesProxy { } } /** * Cancels the current thumbnail transtion to/from Recents for the given task id. */ public void cancelThumbnailTransition(int taskId) { if (mWm == null) return; try { WindowManagerGlobal.getWindowManagerService().cancelTaskThumbnailTransition(taskId); } catch (RemoteException e) { e.printStackTrace(); } } /** Returns the top task thumbnail for the given task id */ public Bitmap getTaskThumbnail(int taskId) { if (mAm == null) return null; Loading packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +6 −15 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.android.systemui.recents.RecentsActivityLaunchState; import com.android.systemui.recents.RecentsAppWidgetHostView; import com.android.systemui.recents.RecentsConfiguration; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.activity.CancelEnterRecentsWindowAnimationEvent; import com.android.systemui.recents.events.activity.DismissRecentsToHomeAnimationStarted; import com.android.systemui.recents.events.component.ScreenPinningRequestEvent; import com.android.systemui.recents.events.ui.DismissTaskViewEvent; Loading Loading @@ -106,6 +107,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV Rect mSystemInsets = new Rect(); @GuardedBy("this") List<AppTransitionAnimationSpec> mAppTransitionAnimationSpecs; Loading Loading @@ -245,6 +247,9 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV } ctx.postAnimationTrigger.decrement(); // If we are going home, cancel the previous task's window transition EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(null)); // Notify of the exit animation EventBus.getDefault().send(new DismissRecentsToHomeAnimationStarted()); } Loading Loading @@ -554,20 +559,6 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV return new AppTransitionAnimationSpec(taskId, b, rect); } /** * Cancels any running window transitions for the launched task (the task animating into * Recents). */ private void cancelLaunchedTaskWindowTransition(final Task task) { SystemServicesProxy ssp = Recents.getSystemServices(); RecentsConfiguration config = Recents.getConfiguration(); RecentsActivityLaunchState launchState = config.getLaunchState(); if (launchState.launchedToTaskId != -1 && launchState.launchedToTaskId != task.key.id) { ssp.cancelWindowTransition(launchState.launchedToTaskId); } } /**** TaskStackView.TaskStackCallbacks Implementation ****/ @Override Loading Loading @@ -605,7 +596,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV public void onAnimationStarted() { // If we are launching into another task, cancel the previous task's // window transition cancelLaunchedTaskWindowTransition(task); EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(task)); if (lockToTask) { // Request screen pinning after the animation runs Loading Loading
core/java/android/view/IWindowManager.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,11 @@ interface IWindowManager */ void cancelTaskWindowTransition(int taskId); /** * Cancels the thumbnail transitions for the given task. */ void cancelTaskThumbnailTransition(int taskId); // These can only be called with the SET_ORIENTATION permission. /** * Update the current screen rotation based on the current state of Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +13 −12 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import com.android.internal.logging.MetricsLogger; import com.android.systemui.R; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.activity.AppWidgetProviderChangedEvent; import com.android.systemui.recents.events.activity.CancelEnterRecentsWindowAnimationEvent; import com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationStartedEvent; import com.android.systemui.recents.events.activity.EnterRecentsWindowLastAnimationFrameEvent; import com.android.systemui.recents.events.activity.HideRecentsEvent; Loading Loading @@ -355,12 +356,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); mRecentsView.getViewTreeObserver().addOnEnterAnimationCompleteListener(new ViewTreeObserver.OnEnterAnimationCompleteListener() { @Override public void onEnterAnimationComplete() { System.out.println("ENTER ANIMATION COMPLETE"); } }); mEmptyViewStub = (ViewStub) findViewById(R.id.empty_view_stub); mScrimViews = new SystemBarScrimViews(this); Loading Loading @@ -515,12 +510,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView if (event.getRepeatCount() <= 0 || hasRepKeyTimeElapsed) { // As we iterate to the next/previous task, cancel any current/lagging window // transition animations RecentsConfiguration config = Recents.getConfiguration(); RecentsActivityLaunchState launchState = config.getLaunchState(); if (launchState.launchedToTaskId != -1) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.cancelWindowTransition(launchState.launchedToTaskId); } EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(null)); // Focus the next task in the stack final boolean backward = event.isShiftPressed(); Loading Loading @@ -657,6 +647,17 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView mRecentsView.getViewTreeObserver().addOnPreDrawListener(this); } public final void onBusEvent(CancelEnterRecentsWindowAnimationEvent event) { RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); int launchToTaskId = launchState.launchedToTaskId; if (launchToTaskId != -1 && (event.launchTask == null || launchToTaskId != event.launchTask.key.id)) { SystemServicesProxy ssp = Recents.getSystemServices(); ssp.cancelWindowTransition(launchState.launchedToTaskId); ssp.cancelThumbnailTransition(getTaskId()); } } public final void onBusEvent(AppWidgetProviderChangedEvent event) { refreshSearchWidgetView(); } Loading
packages/SystemUI/src/com/android/systemui/recents/events/activity/CancelEnterRecentsWindowAnimationEvent.java 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.recents.events.activity; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.model.Task; /** * This is sent when we want to cancel the enter-recents window animation for the launch task. */ public class CancelEnterRecentsWindowAnimationEvent extends EventBus.Event { // This is set for the task that is launching, which allows us to ensure that we are not // cancelling the same task animation (it will just be overwritten instead) public final Task launchTask; public CancelEnterRecentsWindowAnimationEvent(Task launchTask) { this.launchTask = launchTask; } }
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +13 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,19 @@ public class SystemServicesProxy { } } /** * Cancels the current thumbnail transtion to/from Recents for the given task id. */ public void cancelThumbnailTransition(int taskId) { if (mWm == null) return; try { WindowManagerGlobal.getWindowManagerService().cancelTaskThumbnailTransition(taskId); } catch (RemoteException e) { e.printStackTrace(); } } /** Returns the top task thumbnail for the given task id */ public Bitmap getTaskThumbnail(int taskId) { if (mAm == null) return null; Loading
packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +6 −15 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.android.systemui.recents.RecentsActivityLaunchState; import com.android.systemui.recents.RecentsAppWidgetHostView; import com.android.systemui.recents.RecentsConfiguration; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.activity.CancelEnterRecentsWindowAnimationEvent; import com.android.systemui.recents.events.activity.DismissRecentsToHomeAnimationStarted; import com.android.systemui.recents.events.component.ScreenPinningRequestEvent; import com.android.systemui.recents.events.ui.DismissTaskViewEvent; Loading Loading @@ -106,6 +107,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV Rect mSystemInsets = new Rect(); @GuardedBy("this") List<AppTransitionAnimationSpec> mAppTransitionAnimationSpecs; Loading Loading @@ -245,6 +247,9 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV } ctx.postAnimationTrigger.decrement(); // If we are going home, cancel the previous task's window transition EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(null)); // Notify of the exit animation EventBus.getDefault().send(new DismissRecentsToHomeAnimationStarted()); } Loading Loading @@ -554,20 +559,6 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV return new AppTransitionAnimationSpec(taskId, b, rect); } /** * Cancels any running window transitions for the launched task (the task animating into * Recents). */ private void cancelLaunchedTaskWindowTransition(final Task task) { SystemServicesProxy ssp = Recents.getSystemServices(); RecentsConfiguration config = Recents.getConfiguration(); RecentsActivityLaunchState launchState = config.getLaunchState(); if (launchState.launchedToTaskId != -1 && launchState.launchedToTaskId != task.key.id) { ssp.cancelWindowTransition(launchState.launchedToTaskId); } } /**** TaskStackView.TaskStackCallbacks Implementation ****/ @Override Loading Loading @@ -605,7 +596,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV public void onAnimationStarted() { // If we are launching into another task, cancel the previous task's // window transition cancelLaunchedTaskWindowTransition(task); EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(task)); if (lockToTask) { // Request screen pinning after the animation runs Loading