Fix to custom scale animations.
These now do something reasonable when performing transitions
across two activities that are both on top of the wallpaper.
Fixed computation of the pivot point of the animations.
Fixed issue where the recents panel was considered a status
bar element for purposes of deciding if the animating elements
are obscured by the status bar, which would result in us not
running the animation correctly.
Change-Id: I4b9b588b80243463e6f087a9703ee886ee281630
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 9085cea..ad13c41 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -3946,6 +3946,17 @@
}
}
+ final void updateTransitLocked(int transit, Bundle options) {
+ if (options != null) {
+ ActivityRecord r = topRunningActivityLocked(null);
+ if (r != null && r.state != ActivityState.RESUMED) {
+ r.updateOptionsLocked(options);
+ } else {
+ ActivityOptions.abort(options);
+ }
+ }
+ mService.mWindowManager.prepareAppTransition(transit, false);
+ }
final void moveTaskToFrontLocked(TaskRecord tr, ActivityRecord reason, Bundle options) {
if (DEBUG_SWITCH) Slog.v(TAG, "moveTaskToFront: " + tr);
@@ -3955,7 +3966,12 @@
if (top < 0 || (mHistory.get(top)).task.taskId == task) {
// nothing to do!
- ActivityOptions.abort(options);
+ if (reason != null &&
+ (reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
+ ActivityOptions.abort(options);
+ } else {
+ updateTransitLocked(WindowManagerPolicy.TRANSIT_TASK_TO_FRONT, options);
+ }
return;
}
@@ -3999,16 +4015,7 @@
}
ActivityOptions.abort(options);
} else {
- if (options != null) {
- ActivityRecord r = topRunningActivityLocked(null);
- if (r != null && r.state != ActivityState.RESUMED) {
- r.updateOptionsLocked(options);
- } else {
- ActivityOptions.abort(options);
- }
- }
- mService.mWindowManager.prepareAppTransition(
- WindowManagerPolicy.TRANSIT_TASK_TO_FRONT, false);
+ updateTransitLocked(WindowManagerPolicy.TRANSIT_TASK_TO_FRONT, options);
}
mService.mWindowManager.moveAppTokensToTop(moved);