File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
packages/SystemUI/src/com/android/systemui/recent Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments