Skip to content

Commit bbc9816

Browse files
Sashidhar GanigaSteve Kondik
authored andcommitted
Fix return to task when single task activity is brought to front
When a single task activity launched on top of home is relaunched from another flow the return to task for the above activity is not set correctly. Adding a check and setting the returnto task to same as the relaunched single task activity reurnto value ensures correct activity is resumed. CRs-Fixed: 830806 Change-Id: I3acf3e301ac3acd4e7aa69bdaf1cf7281b38c907
1 parent 93a5d63 commit bbc9816

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

services/core/java/com/android/server/am/ActivityStack.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,6 +1957,12 @@ private void insertTaskAtTop(TaskRecord task) {
19571957
ActivityStack lastStack = mStackSupervisor.getLastStack();
19581958
final boolean fromHome = lastStack.isHomeStack();
19591959
if (!isHomeStack() && (fromHome || topTask() != task)) {
1960+
if( !fromHome && task.isOverHomeStack()) {
1961+
int taskNdx = mTaskHistory.indexOf(task);
1962+
if ((taskNdx + 1) < mTaskHistory.size()) {
1963+
mTaskHistory.get(taskNdx +1).setTaskToReturnTo(task.getTaskToReturnTo());
1964+
}
1965+
}
19601966
task.setTaskToReturnTo(fromHome
19611967
? lastStack.topTask() == null
19621968
? HOME_ACTIVITY_TYPE

0 commit comments

Comments
 (0)