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
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java
index 47e6645..118e6fe 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_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 @@
private BubbleController mBubbleController = Dependency.get(BubbleController.class);
private WindowManager mWindowManager;
+ private ActivityManager mActivityManager;
private BubbleStackView mStackView;
private View mVirtualImeView;
@@ -186,6 +188,10 @@
}
});
mActivityViewStatus = ActivityViewStatus.ACTIVITY_STARTED;
+ break;
+ case ACTIVITY_STARTED:
+ post(() -> mActivityManager.moveTaskToFront(mTaskId, 0));
+ break;
}
}
@@ -247,6 +253,7 @@
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
updateDimensions();
+ mActivityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
}
void updateDimensions() {