Skip to content

Commit 150443a

Browse files
mikejurkaAndroid (Google) Code Review
authored andcommitted
Merge "Fix 7216870: recents relaunches dismissed activity" into jb-mr1-dev
2 parents e8e9870 + 08e8d84 commit 150443a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public void dismissAndGoBack() {
120120
if (mRecentsPanel != null) {
121121
final SystemUIApplication app = (SystemUIApplication) getApplication();
122122
final RecentTasksLoader recentTasksLoader = app.getRecentTasksLoader();
123-
TaskDescription firstTask = recentTasksLoader.getFirstTask();
123+
TaskDescription firstTask = mRecentsPanel.getBottomTask();
124124
if (firstTask != null && mRecentsPanel.simulateClick(firstTask)) {
125125
// recents panel will take care of calling show(false);
126126
return;

packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,24 @@ void onTaskThumbnailLoaded(TaskDescription td) {
488488
showIfReady();
489489
}
490490

491+
public TaskDescription getBottomTask() {
492+
if (mRecentsContainer != null) {
493+
ViewGroup container = mRecentsContainer;
494+
if (container instanceof RecentsScrollView) {
495+
container = (ViewGroup) container.findViewById(
496+
R.id.recents_linear_layout);
497+
}
498+
if (container.getChildCount() > 0) {
499+
View v = container.getChildAt(container.getChildCount() - 1);
500+
if (v.getTag() instanceof ViewHolder) {
501+
ViewHolder h = (ViewHolder)v.getTag();
502+
return h.taskDescription;
503+
}
504+
}
505+
}
506+
return null;
507+
}
508+
491509
public void clearRecentTasksList() {
492510
// Clear memory used by screenshots
493511
if (mRecentTaskDescriptions != null) {

0 commit comments

Comments
 (0)