summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jaewan Kim <jaewan@google.com> 2016-02-26 12:54:33 -0800
committer Dongwon Kang <dwkang@google.com> 2016-03-02 09:51:07 -0800
commit3ebc1e3f9963c8d786f83f21abb6b6f78270ede1 (patch)
tree4a6765d9a6388bf400f4d4aa7db4d8c2d4f2588f
parent8326e38bf51de2771dab65baee9a97fb6ae7ff1d (diff)
PIP: Show recents again when PIP menu is closed
Framework enforces that an app cannot go back to Recents. So launches the Recents again for the PIP menu. Change-Id: I7526edfe7dd38c7eb1befe6a8b2b5f4ea30aa84e
-rw-r--r--packages/SystemUI/src/com/android/systemui/tv/pip/PipMenuActivity.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/tv/pip/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/tv/pip/PipMenuActivity.java
index fb7fa4de088f..fd753e9a7044 100644
--- a/packages/SystemUI/src/com/android/systemui/tv/pip/PipMenuActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/tv/pip/PipMenuActivity.java
@@ -25,6 +25,9 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.android.systemui.R;
+import com.android.systemui.SystemUI;
+import com.android.systemui.SystemUIApplication;
+import com.android.systemui.recents.Recents;
import static android.content.pm.PackageManager.FEATURE_LEANBACK;
import static android.content.pm.PackageManager.FEATURE_PICTURE_IN_PICTURE;
@@ -214,4 +217,18 @@ public class PipMenuActivity extends Activity implements PipManager.Listener {
mPipManager.suspendPipResizing(
PipManager.SUSPEND_PIP_RESIZE_REASON_WAITING_FOR_MENU_ACTIVITY_FINISH);
}
+
+ @Override
+ public void finish() {
+ super.finish();
+ if (mPipManager.isRecentsShown()) {
+ SystemUI[] services = ((SystemUIApplication) getApplication()).getServices();
+ for (int i = services.length - 1; i >= 0; i--) {
+ if (services[i] instanceof Recents) {
+ ((Recents) services[i]).showRecents(false, null);
+ break;
+ }
+ }
+ }
+ }
}