Precompute FLAG_ACTIVITY_NO_ANIMATION
Save lots of passing around of ActivityRecords when all you care
about is the flag.
Fixes bug 18088522 item #14
Change-Id: Ib6d95ef06b44faa1715a196ab710f96ed4517213
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 97feb41..2cc5cea 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -3470,7 +3470,7 @@
}
}
- final void moveTaskToFrontLocked(TaskRecord tr, ActivityRecord source, Bundle options,
+ final void moveTaskToFrontLocked(TaskRecord tr, boolean noAnimation, Bundle options,
String reason) {
if (DEBUG_SWITCH) Slog.v(TAG, "moveTaskToFront: " + tr);
@@ -3478,8 +3478,7 @@
final int index = mTaskHistory.indexOf(tr);
if (numTasks == 0 || index < 0) {
// nothing to do!
- if (source != null &&
- (source.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
+ if (noAnimation) {
ActivityOptions.abort(options);
} else {
updateTransitLocked(AppTransition.TRANSIT_TASK_TO_FRONT, options);
@@ -3493,8 +3492,7 @@
moveToFront(reason);
if (DEBUG_TRANSITION) Slog.v(TAG, "Prepare to front transition: task=" + tr);
- if (source != null &&
- (source.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) {
+ if (noAnimation) {
mWindowManager.prepareAppTransition(AppTransition.TRANSIT_NONE, false);
ActivityRecord r = topRunningActivityLocked(null);
if (r != null) {