am c9ffd746: Merge "Don\'t call setTask twice." into klp-dev
* commit 'c9ffd74659fac6f30f3f4653586af2069b903899': Don't call setTask twice.
This commit is contained in:
@@ -36,7 +36,6 @@ import static com.android.server.am.ActivityStackSupervisor.DEBUG_SAVED_STATE;
|
|||||||
import static com.android.server.am.ActivityStackSupervisor.DEBUG_STATES;
|
import static com.android.server.am.ActivityStackSupervisor.DEBUG_STATES;
|
||||||
import static com.android.server.am.ActivityStackSupervisor.HOME_STACK_ID;
|
import static com.android.server.am.ActivityStackSupervisor.HOME_STACK_ID;
|
||||||
|
|
||||||
import android.os.Trace;
|
|
||||||
import com.android.internal.os.BatteryStatsImpl;
|
import com.android.internal.os.BatteryStatsImpl;
|
||||||
import com.android.internal.util.Objects;
|
import com.android.internal.util.Objects;
|
||||||
import com.android.server.Watchdog;
|
import com.android.server.Watchdog;
|
||||||
@@ -64,12 +63,14 @@ import android.graphics.Bitmap;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Debug;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
import android.os.Trace;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.util.EventLog;
|
import android.util.EventLog;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
@@ -1910,6 +1911,8 @@ final class ActivityStack {
|
|||||||
// bottom of the activity stack. This also keeps it
|
// bottom of the activity stack. This also keeps it
|
||||||
// correctly ordered with any activities we previously
|
// correctly ordered with any activities we previously
|
||||||
// moved.
|
// moved.
|
||||||
|
final ThumbnailHolder newThumbHolder;
|
||||||
|
final TaskRecord targetTask;
|
||||||
final ActivityRecord bottom =
|
final ActivityRecord bottom =
|
||||||
!mTaskHistory.isEmpty() && !mTaskHistory.get(0).mActivities.isEmpty() ?
|
!mTaskHistory.isEmpty() && !mTaskHistory.get(0).mActivities.isEmpty() ?
|
||||||
mTaskHistory.get(0).mActivities.get(0) : null;
|
mTaskHistory.get(0).mActivities.get(0) : null;
|
||||||
@@ -1918,18 +1921,28 @@ final class ActivityStack {
|
|||||||
// If the activity currently at the bottom has the
|
// If the activity currently at the bottom has the
|
||||||
// same task affinity as the one we are moving,
|
// same task affinity as the one we are moving,
|
||||||
// then merge it into the same task.
|
// then merge it into the same task.
|
||||||
target.setTask(bottom.task, bottom.thumbHolder, false);
|
targetTask = bottom.task;
|
||||||
|
newThumbHolder = bottom.thumbHolder == null ? targetTask : bottom.thumbHolder;
|
||||||
if (DEBUG_TASKS) Slog.v(TAG, "Start pushing activity " + target
|
if (DEBUG_TASKS) Slog.v(TAG, "Start pushing activity " + target
|
||||||
+ " out to bottom task " + bottom.task);
|
+ " out to bottom task " + bottom.task);
|
||||||
} else {
|
} else {
|
||||||
target.setTask(createTaskRecord(mStackSupervisor.getNextTaskId(), target.info,
|
targetTask = createTaskRecord(mStackSupervisor.getNextTaskId(), target.info,
|
||||||
null, false), null, false);
|
null, false);
|
||||||
target.task.affinityIntent = target.intent;
|
newThumbHolder = targetTask;
|
||||||
|
targetTask.affinityIntent = target.intent;
|
||||||
if (DEBUG_TASKS) Slog.v(TAG, "Start pushing activity " + target
|
if (DEBUG_TASKS) Slog.v(TAG, "Start pushing activity " + target
|
||||||
+ " out to new task " + target.task);
|
+ " out to new task " + target.task);
|
||||||
}
|
}
|
||||||
|
|
||||||
final TaskRecord targetTask = target.task;
|
if (clearWhenTaskReset) {
|
||||||
|
// This is the start of a new sub-task.
|
||||||
|
if (target.thumbHolder == null) {
|
||||||
|
target.thumbHolder = new ThumbnailHolder();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
target.thumbHolder = newThumbHolder;
|
||||||
|
}
|
||||||
|
|
||||||
final int targetTaskId = targetTask.taskId;
|
final int targetTaskId = targetTask.taskId;
|
||||||
mWindowManager.setAppGroupId(target.appToken, targetTaskId);
|
mWindowManager.setAppGroupId(target.appToken, targetTaskId);
|
||||||
|
|
||||||
@@ -1950,8 +1963,8 @@ final class ActivityStack {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Removing activity " + p + " from task="
|
if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Removing activity " + p + " from task="
|
||||||
+ task + " adding to task=" + targetTask,
|
+ task + " adding to task=" + targetTask
|
||||||
new RuntimeException("here").fillInStackTrace());
|
+ " Callers=" + Debug.getCallers(4));
|
||||||
if (DEBUG_TASKS) Slog.v(TAG, "Pushing next activity " + p
|
if (DEBUG_TASKS) Slog.v(TAG, "Pushing next activity " + p
|
||||||
+ " out to target's task " + target.task);
|
+ " out to target's task " + target.task);
|
||||||
p.setTask(targetTask, curThumbHolder, false);
|
p.setTask(targetTask, curThumbHolder, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user