summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2015-01-27 22:15:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-01-27 22:15:56 +0000
commita171ae1bb2b5803b2661ce0d54ef073555ee4b6b (patch)
treeaa5f2a29bbf86677c1fa352c246fb151848992c6
parent1ab8674be06d3a12719013bb314729a0d8e565c5 (diff)
parent8f5f7e9245278a46326ea0f04f193976c363695e (diff)
downloadframeworks_base-a171ae1bb2b5803b2661ce0d54ef073555ee4b6b.zip
frameworks_base-a171ae1bb2b5803b2661ce0d54ef073555ee4b6b.tar.gz
frameworks_base-a171ae1bb2b5803b2661ce0d54ef073555ee4b6b.tar.bz2
Merge "Precompute FLAG_ACTIVITY_NO_ANIMATION"
-rw-r--r--services/core/java/com/android/server/am/ActivityStack.java8
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java14
2 files changed, 11 insertions, 11 deletions
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 class ActivityStack {
}
}
- 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 class ActivityStack {
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 @@ final class ActivityStack {
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) {
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index b7728b3..c68430e 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -1596,7 +1596,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
}
}
- final int startActivityUncheckedLocked(ActivityRecord r, ActivityRecord sourceRecord,
+ final int startActivityUncheckedLocked(final ActivityRecord r, ActivityRecord sourceRecord,
IVoiceInteractionSession voiceSession, IVoiceInteractor voiceInteractor, int startFlags,
boolean doResume, Bundle options, TaskRecord inTask) {
final Intent intent = r.intent;
@@ -1807,6 +1807,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
ActivityStack targetStack;
intent.setFlags(launchFlags);
+ final boolean noAnimation = (launchFlags & Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0;
// We may want to try to place the new activity in to an existing task. We always
// do this if the target activity is singleTask or singleInstance; we will also do
@@ -1869,8 +1870,8 @@ public final class ActivityStackSupervisor implements DisplayListener {
intentActivity.setTaskToAffiliateWith(sourceRecord.task);
}
movedHome = true;
- targetStack.moveTaskToFrontLocked(intentActivity.task, r, options,
- "bringingFoundTaskToFront");
+ targetStack.moveTaskToFrontLocked(intentActivity.task, noAnimation,
+ options, "bringingFoundTaskToFront");
if ((launchFlags &
(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME))
== (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME)) {
@@ -2100,7 +2101,8 @@ public final class ActivityStackSupervisor implements DisplayListener {
targetStack.moveToFront("sourceStackToFront");
final TaskRecord topTask = targetStack.topTask();
if (topTask != sourceTask) {
- targetStack.moveTaskToFrontLocked(sourceTask, r, options, "sourceTaskToFront");
+ targetStack.moveTaskToFrontLocked(sourceTask, noAnimation, options,
+ "sourceTaskToFront");
}
if (!addingToTask && (launchFlags&Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) {
// In this case, we are adding the activity to an existing
@@ -2154,7 +2156,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
return ActivityManager.START_RETURN_LOCK_TASK_MODE_VIOLATION;
}
targetStack = inTask.stack;
- targetStack.moveTaskToFrontLocked(inTask, r, options, "inTaskToFront");
+ targetStack.moveTaskToFrontLocked(inTask, noAnimation, options, "inTaskToFront");
// Check whether we should actually launch the new activity in to the task,
// or just reuse the current activity on top.
@@ -2519,7 +2521,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
// we'll just indicate that this task returns to the home task.
task.setTaskToReturnTo(HOME_ACTIVITY_TYPE);
}
- task.stack.moveTaskToFrontLocked(task, null, options, reason);
+ task.stack.moveTaskToFrontLocked(task, false /* noAnimation */, options, reason);
if (DEBUG_STACK) Slog.d(TAG, "findTaskToMoveToFront: moved to front of stack="
+ task.stack);
}