Merge "When launching home activity, make sure it is top." into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
540421ba98
@@ -354,7 +354,6 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
|
||||
if (mPopup != null) {
|
||||
mPopup.dismiss();
|
||||
}
|
||||
((RecentsActivity) mContext).moveTaskToBack(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2910,6 +2910,19 @@ final class ActivityStack {
|
||||
mWindowManager.prepareAppTransition(transit, false);
|
||||
}
|
||||
|
||||
void moveHomeTaskToTop() {
|
||||
final int top = mTaskHistory.size() - 1;
|
||||
for (int taskNdx = top; taskNdx >= 0; --taskNdx) {
|
||||
final TaskRecord task = mTaskHistory.get(taskNdx);
|
||||
if (task.isHomeTask()) {
|
||||
mTaskHistory.remove(taskNdx);
|
||||
mTaskHistory.add(top, task);
|
||||
mWindowManager.moveTaskToTop(task.taskId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final boolean findTaskToMoveToFrontLocked(int taskId, int flags, Bundle options) {
|
||||
final TaskRecord task = taskForIdLocked(taskId);
|
||||
if (task != null) {
|
||||
|
||||
@@ -284,6 +284,7 @@ public final class ActivityStackSupervisor {
|
||||
if (prev != null) {
|
||||
prev.mLaunchHomeTaskNext = false;
|
||||
}
|
||||
mHomeStack.moveHomeTaskToTop();
|
||||
ActivityRecord r = mHomeStack.topRunningActivityLocked(null);
|
||||
if (r != null) {
|
||||
mService.setFocusedActivityLocked(r);
|
||||
|
||||
@@ -322,6 +322,10 @@ final class TaskRecord extends ThumbnailHolder {
|
||||
return subtask.activity;
|
||||
}
|
||||
|
||||
boolean isHomeTask() {
|
||||
return mTaskType == ActivityRecord.HOME_ACTIVITY_TYPE;
|
||||
}
|
||||
|
||||
boolean isApplicationTask() {
|
||||
return mTaskType == ActivityRecord.APPLICATION_ACTIVITY_TYPE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user