summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mady Mellor <madym@google.com> 2019-02-14 19:15:47 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-02-14 19:15:47 +0000
commitc1923b1bafac92169b2074516f15fc9c1fa09ac6 (patch)
tree14b9b2457939c402cd1ae616635c05554fa879b8
parentc9ef1542f4f46d2b221813c7a8fb46ec80484288 (diff)
parent6d00203188a5dbdf1f927b2da613f0da77aeda32 (diff)
Merge "Only populate activity view when we're showing it"
-rw-r--r--packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java1
2 files changed, 11 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java
index 3389c46f66b7..492eadd240ed 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java
@@ -107,8 +107,10 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
private ActivityView.StateCallback mStateCallback = new ActivityView.StateCallback() {
@Override
public void onActivityViewReady(ActivityView view) {
- mActivityViewReady = true;
- mActivityView.startActivity(mBubbleIntent);
+ if (!mActivityViewReady) {
+ mActivityViewReady = true;
+ mActivityView.startActivity(mBubbleIntent);
+ }
}
@Override
@@ -262,6 +264,12 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
updateHeaderView();
updatePermissionView();
updateExpandedView();
+ }
+
+ /**
+ * Lets activity view know it should be shown / populated.
+ */
+ public void populateActivityView() {
mActivityView.setCallback(mStateCallback);
}
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
index 8bc83d4c852b..6c1b93bd099f 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
@@ -707,6 +707,7 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F
mExpandedViewContainer.removeAllViews();
if (mExpandedBubble != null && mIsExpanded) {
mExpandedViewContainer.addView(mExpandedBubble.expandedView);
+ mExpandedBubble.expandedView.populateActivityView();
mExpandedViewContainer.setVisibility(mIsExpanded ? VISIBLE : GONE);
}
}