summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2018-02-07 18:39:20 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-02-07 18:39:20 +0000
commit0ee9c0db54191141aa348227e9317f502ca09069 (patch)
tree493fa8cc12991676f78b5fe51756aa3597f9d646
parentb8b8b86d2e26dcd0ed4a84a739654d41b80fbe19 (diff)
parentbb5d97f00fd5ee64eaac110aa700cec2abf56a20 (diff)
Merge "Revert "Exposing content insets and minimized home bounds for recents transition""
-rw-r--r--core/java/android/view/IRecentsAnimationRunner.aidl18
-rw-r--r--core/java/android/view/RemoteAnimationTarget.java12
-rw-r--r--packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java13
-rw-r--r--packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java4
-rw-r--r--packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java20
-rw-r--r--services/core/java/com/android/server/am/RecentsAnimation.java7
-rw-r--r--services/core/java/com/android/server/wm/RecentsAnimationController.java28
-rw-r--r--services/core/java/com/android/server/wm/RemoteAnimationController.java2
8 files changed, 17 insertions, 87 deletions
diff --git a/core/java/android/view/IRecentsAnimationRunner.aidl b/core/java/android/view/IRecentsAnimationRunner.aidl
index 69973e6d367a..ea6226b3ea69 100644
--- a/core/java/android/view/IRecentsAnimationRunner.aidl
+++ b/core/java/android/view/IRecentsAnimationRunner.aidl
@@ -16,7 +16,6 @@
package android.view;
-import android.graphics.Rect;
import android.view.RemoteAnimationTarget;
import android.view.IRecentsAnimationController;
@@ -29,26 +28,15 @@ import android.view.IRecentsAnimationController;
oneway interface IRecentsAnimationRunner {
/**
- * Deprecated, to be removed once Launcher updates
+ * Called when the system is ready for the handler to start animating all the visible tasks.
*/
void onAnimationStart(in IRecentsAnimationController controller,
- in RemoteAnimationTarget[] apps) = 0;
+ in RemoteAnimationTarget[] apps);
/**
* Called when the system needs to cancel the current animation. This can be due to the
* wallpaper not drawing in time, or the handler not finishing the animation within a predefined
* amount of time.
*/
- void onAnimationCanceled() = 1;
-
- /**
- * Called when the system is ready for the handler to start animating all the visible tasks.
- *
- * @param homeContentInsets The current home app content insets
- * @param minimizedHomeBounds Specifies the bounds of the minimized home app, will be
- * {@code null} if the device is not currently in split screen
- */
- void onAnimationStart_New(in IRecentsAnimationController controller,
- in RemoteAnimationTarget[] apps, in Rect homeContentInsets,
- in Rect minimizedHomeBounds) = 2;
+ void onAnimationCanceled();
}
diff --git a/core/java/android/view/RemoteAnimationTarget.java b/core/java/android/view/RemoteAnimationTarget.java
index facf575872ed..c28c3894482d 100644
--- a/core/java/android/view/RemoteAnimationTarget.java
+++ b/core/java/android/view/RemoteAnimationTarget.java
@@ -79,11 +79,6 @@ public class RemoteAnimationTarget implements Parcelable {
public final Rect clipRect;
/**
- * The insets of the main app window.
- */
- public final Rect contentInsets;
-
- /**
* The index of the element in the tree in prefix order. This should be used for z-layering
* to preserve original z-layer order in the hierarchy tree assuming no "boosting" needs to
* happen.
@@ -110,14 +105,13 @@ public class RemoteAnimationTarget implements Parcelable {
public final WindowConfiguration windowConfiguration;
public RemoteAnimationTarget(int taskId, int mode, SurfaceControl leash, boolean isTranslucent,
- Rect clipRect, Rect contentInsets, int prefixOrderIndex, Point position,
- Rect sourceContainerBounds, WindowConfiguration windowConfig) {
+ Rect clipRect, int prefixOrderIndex, Point position, Rect sourceContainerBounds,
+ WindowConfiguration windowConfig) {
this.mode = mode;
this.taskId = taskId;
this.leash = leash;
this.isTranslucent = isTranslucent;
this.clipRect = new Rect(clipRect);
- this.contentInsets = new Rect(contentInsets);
this.prefixOrderIndex = prefixOrderIndex;
this.position = new Point(position);
this.sourceContainerBounds = new Rect(sourceContainerBounds);
@@ -130,7 +124,6 @@ public class RemoteAnimationTarget implements Parcelable {
leash = in.readParcelable(null);
isTranslucent = in.readBoolean();
clipRect = in.readParcelable(null);
- contentInsets = in.readParcelable(null);
prefixOrderIndex = in.readInt();
position = in.readParcelable(null);
sourceContainerBounds = in.readParcelable(null);
@@ -149,7 +142,6 @@ public class RemoteAnimationTarget implements Parcelable {
dest.writeParcelable(leash, 0 /* flags */);
dest.writeBoolean(isTranslucent);
dest.writeParcelable(clipRect, 0 /* flags */);
- dest.writeParcelable(contentInsets, 0 /* flags */);
dest.writeInt(prefixOrderIndex);
dest.writeParcelable(position, 0 /* flags */);
dest.writeParcelable(sourceContainerBounds, 0 /* flags */);
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
index 62bd72f393cc..90e3b1e73454 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
@@ -43,7 +43,6 @@ import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.graphics.Bitmap;
-import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
@@ -58,7 +57,6 @@ import android.view.IRecentsAnimationController;
import android.view.IRecentsAnimationRunner;
import android.view.RemoteAnimationTarget;
-import android.view.WindowManagerGlobal;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.Task.TaskKey;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -273,20 +271,11 @@ public class ActivityManagerWrapper {
runner = new IRecentsAnimationRunner.Stub() {
public void onAnimationStart(IRecentsAnimationController controller,
RemoteAnimationTarget[] apps) {
- final Rect stableInsets = new Rect();
- WindowManagerWrapper.getInstance().getStableInsets(stableInsets);
- onAnimationStart_New(controller, apps, stableInsets, null);
- }
-
- public void onAnimationStart_New(IRecentsAnimationController controller,
- RemoteAnimationTarget[] apps, Rect homeContentInsets,
- Rect minimizedHomeBounds) {
final RecentsAnimationControllerCompat controllerCompat =
new RecentsAnimationControllerCompat(controller);
final RemoteAnimationTargetCompat[] appsCompat =
RemoteAnimationTargetCompat.wrap(apps);
- animationHandler.onAnimationStart(controllerCompat, appsCompat,
- homeContentInsets, minimizedHomeBounds);
+ animationHandler.onAnimationStart(controllerCompat, appsCompat);
}
public void onAnimationCanceled() {
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
index a473db1a7a14..bf6179d70a5e 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
@@ -16,15 +16,13 @@
package com.android.systemui.shared.system;
-import android.graphics.Rect;
-
public interface RecentsAnimationListener {
/**
* Called when the animation into Recents can start. This call is made on the binder thread.
*/
void onAnimationStart(RecentsAnimationControllerCompat controller,
- RemoteAnimationTargetCompat[] apps, Rect homeContentInsets, Rect minimizedHomeBounds);
+ RemoteAnimationTargetCompat[] apps);
/**
* Called when the animation into Recents was canceled. This call is made on the binder thread.
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java
index b8c5049d1c1d..3871980a5b17 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java
@@ -16,9 +16,6 @@
package com.android.systemui.shared.system;
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT;
-
-import android.app.WindowConfiguration;
import android.graphics.Point;
import android.graphics.Rect;
import android.view.RemoteAnimationTarget;
@@ -40,10 +37,7 @@ public class RemoteAnimationTargetCompat {
public final Point position;
public final Rect sourceContainerBounds;
- private final RemoteAnimationTarget mTarget;
-
public RemoteAnimationTargetCompat(RemoteAnimationTarget app) {
- mTarget = app;
taskId = app.taskId;
mode = app.mode;
leash = new SurfaceControlCompat(app.leash);
@@ -62,18 +56,4 @@ public class RemoteAnimationTargetCompat {
}
return appsCompat;
}
-
- /**
- * TODO: Get as a method for compatibility (will move into ctor once Launcher updates)
- */
- public Rect getContentInsets() {
- return mTarget.contentInsets;
- }
-
- /**
- * TODO: Get as a method for compatibility (will move into ctor once Launcher updates)
- */
- public boolean isAssistantActivityType() {
- return mTarget.windowConfiguration.getActivityType() == ACTIVITY_TYPE_ASSISTANT;
- }
} \ No newline at end of file
diff --git a/services/core/java/com/android/server/am/RecentsAnimation.java b/services/core/java/com/android/server/am/RecentsAnimation.java
index db4e09fb79b8..e7b067b1ab73 100644
--- a/services/core/java/com/android/server/am/RecentsAnimation.java
+++ b/services/core/java/com/android/server/am/RecentsAnimation.java
@@ -20,7 +20,6 @@ import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
-import static android.os.Trace.TRACE_TAG_ACTIVITY_MANAGER;
import static android.view.WindowManager.TRANSIT_NONE;
import static com.android.server.am.ActivityStackSupervisor.PRESERVE_WINDOWS;
@@ -28,7 +27,6 @@ import android.app.ActivityOptions;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Handler;
-import android.os.Trace;
import android.view.IRecentsAnimationRunner;
import com.android.server.wm.RecentsAnimationController.RecentsAnimationCallbacks;
import com.android.server.wm.WindowManagerService;
@@ -72,7 +70,6 @@ class RecentsAnimation implements RecentsAnimationCallbacks {
void startRecentsActivity(Intent intent, IRecentsAnimationRunner recentsAnimationRunner,
ComponentName recentsComponent, int recentsUid) {
- Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "RecentsAnimation#startRecentsActivity");
mWindowManager.deferSurfaceLayout();
try {
// Cancel the previous recents animation if necessary
@@ -127,7 +124,6 @@ class RecentsAnimation implements RecentsAnimationCallbacks {
mHandler.postDelayed(mCancelAnimationRunnable, RECENTS_ANIMATION_TIMEOUT);
} finally {
mWindowManager.continueSurfaceLayout();
- Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);
}
}
@@ -138,8 +134,6 @@ class RecentsAnimation implements RecentsAnimationCallbacks {
if (mWindowManager.getRecentsAnimationController() == null) return;
mWindowManager.inSurfaceTransaction(() -> {
- Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER,
- "RecentsAnimation#onAnimationFinished_inSurfaceTransaction");
mWindowManager.deferSurfaceLayout();
try {
mWindowManager.cleanupRecentsAnimation();
@@ -173,7 +167,6 @@ class RecentsAnimation implements RecentsAnimationCallbacks {
mWindowManager.executeAppTransition();
} finally {
mWindowManager.continueSurfaceLayout();
- Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);
}
});
}
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index b58b890777f4..fe5b65ccbf6d 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -62,7 +62,6 @@ public class RecentsAnimationController {
// The recents component app token that is shown behind the visibile tasks
private AppWindowToken mHomeAppToken;
- private Rect mMinimizedHomeBounds = new Rect();
// We start the RecentsAnimationController in a pending-start state since we need to wait for
// the wallpaper/activity to draw before we can give control to the handler to start animating
@@ -106,7 +105,7 @@ public class RecentsAnimationController {
final AppWindowToken topChild = task.getTopChild();
final WindowState mainWindow = topChild.findMainWindow();
return new TaskSnapshot(buffer, topChild.getConfiguration().orientation,
- mainWindow.mContentInsets,
+ mainWindow.mStableInsets,
ActivityManager.isLowRamDeviceStatic() /* reduced */,
1.0f /* scale */);
}
@@ -164,6 +163,8 @@ public class RecentsAnimationController {
* @param remoteAnimationRunner The remote runner which should be notified when the animation is
* ready to start or has been canceled
* @param callbacks Callbacks to be made when the animation finishes
+ * @param restoreHomeBehindStackId The stack id to restore the home stack behind once the
+ * animation is complete. Will be passed to the callback.
*/
RecentsAnimationController(WindowManagerService service,
IRecentsAnimationRunner remoteAnimationRunner, RecentsAnimationCallbacks callbacks,
@@ -199,15 +200,13 @@ public class RecentsAnimationController {
if (recentsComponentAppToken != null) {
if (DEBUG) Log.d(TAG, "setHomeApp(" + recentsComponentAppToken.getName() + ")");
mHomeAppToken = recentsComponentAppToken;
+ final WallpaperController wc = dc.mWallpaperController;
if (recentsComponentAppToken.windowsCanBeWallpaperTarget()) {
dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
dc.setLayoutNeeded();
}
}
- // Save the minimized home height
- dc.getDockedDividerController().getHomeStackBoundsInDockedMode(mMinimizedHomeBounds);
-
mService.mWindowPlacerLocked.performSurfacePlacement();
}
@@ -233,12 +232,7 @@ public class RecentsAnimationController {
appAnimations[i] = mPendingAnimations.get(i).createRemoteAnimationApp();
}
mPendingStart = false;
-
- final Rect minimizedHomeBounds =
- mHomeAppToken != null && mHomeAppToken.inSplitScreenSecondaryWindowingMode()
- ? mMinimizedHomeBounds : null;
- mRunner.onAnimationStart_New(mController, appAnimations,
- mHomeAppToken.findMainWindow().mContentInsets, minimizedHomeBounds);
+ mRunner.onAnimationStart(mController, appAnimations);
} catch (RemoteException e) {
Slog.e(TAG, "Failed to start recents animation", e);
}
@@ -340,15 +334,11 @@ public class RecentsAnimationController {
}
RemoteAnimationTarget createRemoteAnimationApp() {
- final Point position = new Point();
- final Rect bounds = new Rect();
- final WindowContainer container = mTask.getParent();
- container.getRelativePosition(position);
- container.getBounds(bounds);
- final WindowState mainWindow = mTask.getTopVisibleAppMainWindow();
+ // TODO: Do we need position and stack bounds?
return new RemoteAnimationTarget(mTask.mTaskId, MODE_CLOSING, mCapturedLeash,
- !mTask.fillsParent(), mainWindow.mWinAnimator.mLastClipRect,
- mainWindow.mContentInsets, mTask.getPrefixOrderIndex(), position, bounds,
+ !mTask.fillsParent(),
+ mTask.getTopVisibleAppMainWindow().mWinAnimator.mLastClipRect,
+ mTask.getPrefixOrderIndex(), new Point(), new Rect(),
mTask.getWindowConfiguration());
}
diff --git a/services/core/java/com/android/server/wm/RemoteAnimationController.java b/services/core/java/com/android/server/wm/RemoteAnimationController.java
index c353c1d36d60..925199358b4e 100644
--- a/services/core/java/com/android/server/wm/RemoteAnimationController.java
+++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java
@@ -166,7 +166,7 @@ class RemoteAnimationController {
}
return new RemoteAnimationTarget(task.mTaskId, getMode(),
mCapturedLeash, !mAppWindowToken.fillsParent(),
- mainWindow.mWinAnimator.mLastClipRect, mainWindow.mContentInsets,
+ mainWindow.mWinAnimator.mLastClipRect,
mAppWindowToken.getPrefixOrderIndex(), mPosition, mStackBounds,
task.getWindowConfiguration());
}