From 8672410848dfd91ed37de7bd15f5abb582753761 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Thu, 11 Jun 2020 17:51:55 +0800 Subject: [PATCH] Let activity resume after bubbles expanded Add moveTaskToFront call to ensure activity resume when bubbles expanded which means activityView status is activity started. Bug: 152416787 Test: Check event log Test: Open FB messengers, expand FB messengers bubbles and click back Change-Id: I9f95e42a4573185df83c0e7438972fea84bbb176 --- .../com/android/systemui/bubbles/BubbleExpandedView.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java index 47e6645d347fe..118e6fe50a28f 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java @@ -35,6 +35,7 @@ import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; import android.annotation.SuppressLint; +import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.ActivityTaskManager; import android.app.ActivityView; @@ -126,6 +127,7 @@ public class BubbleExpandedView extends LinearLayout { private BubbleController mBubbleController = Dependency.get(BubbleController.class); private WindowManager mWindowManager; + private ActivityManager mActivityManager; private BubbleStackView mStackView; private View mVirtualImeView; @@ -186,6 +188,10 @@ public class BubbleExpandedView extends LinearLayout { } }); mActivityViewStatus = ActivityViewStatus.ACTIVITY_STARTED; + break; + case ACTIVITY_STARTED: + post(() -> mActivityManager.moveTaskToFront(mTaskId, 0)); + break; } } @@ -247,6 +253,7 @@ public class BubbleExpandedView extends LinearLayout { int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); updateDimensions(); + mActivityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); } void updateDimensions() {