From de3321d13bcac4108affa2a80de9c7d30eaa0ce6 Mon Sep 17 00:00:00 2001 From: Sid Soundararajan Date: Wed, 11 May 2016 14:56:21 -0700 Subject: [PATCH] Move onStart update of recents tasks to onResume This is needed to ensure that the update happens between app launches, since translucent apps do not get to onStop(). Part of fixes to improve performance for bug. BUG: 28371792 Change-Id: I47e3a20bba4f006bfc637635d9c9af697a7fc648 --- .../recents/tv/RecentsTvActivity.java | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java b/packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java index acebf427feabc..2ecec664b8a5e 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java @@ -334,7 +334,23 @@ public class RecentsTvActivity extends Activity implements OnPreDrawListener { @Override protected void onStart() { super.onStart(); + updatePipUI(); + } + @Override + public void onEnterAnimationComplete() { + super.onEnterAnimationComplete(); + if(mLaunchedFromHome) { + mHomeRecentsEnterExitAnimationHolder.startEnterAnimation(mPipManager.isPipShown()); + } + mTaskStackViewAdapter.setResetAddedCards(true); + EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent()); + } + + @Override + public void onResume() { + super.onResume(); + mPipRecentsOverlayManager.onRecentsResumed(); // Update the recent tasks updateRecentsTasks(); @@ -365,24 +381,6 @@ public class RecentsTvActivity extends Activity implements OnPreDrawListener { // Notify that recents is now visible SystemServicesProxy ssp = Recents.getSystemServices(); EventBus.getDefault().send(new RecentsVisibilityChangedEvent(this, true)); - - updatePipUI(); - } - - @Override - public void onEnterAnimationComplete() { - super.onEnterAnimationComplete(); - if(mLaunchedFromHome) { - mHomeRecentsEnterExitAnimationHolder.startEnterAnimation(mPipManager.isPipShown()); - } - mTaskStackViewAdapter.setResetAddedCards(true); - EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent()); - } - - @Override - public void onResume() { - super.onResume(); - mPipRecentsOverlayManager.onRecentsResumed(); if(mTaskStackHorizontalGridView.getStack().getTaskCount() > 1 && !mLaunchedFromHome) { // If there are 2 or more tasks, and we are not launching from home // set the selected position to the 2nd task to allow for faster app switching