summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lyn Han <lynhan@google.com> 2020-01-15 13:32:17 -0800
committer Lyn Han <lynhan@google.com> 2020-01-15 14:16:59 -0800
commit6cdc706cc29586ddf44d8659079416fff7fb651e (patch)
treebb1c71874e203004570b6092ed8e666730bf2ffd
parent0b56225ecf1b7f7cc04e70738d15ccb96516783e (diff)
Make BubbleOverflowActivity Injectable
So that we can inject BubbleController as a field Bug: 138116789 Test: manual - compiles Test: atest SystemUITests Change-Id: Iad69b3197e6c6470ed4f245e54eb52c6a06c1781
-rw-r--r--packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/DefaultActivityBinder.java7
2 files changed, 16 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java
index 018b6318575a..d99607fd6236 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java
@@ -10,6 +10,8 @@ import androidx.recyclerview.widget.RecyclerView;
import com.android.systemui.R;
+import javax.inject.Inject;
+
/**
* Activity for showing aged out bubbles.
* Must be public to be accessible to androidx...AppComponentFactory
@@ -17,6 +19,12 @@ import com.android.systemui.R;
public class BubbleOverflowActivity extends Activity {
private RecyclerView mRecyclerView;
private int mMaxBubbles;
+ private BubbleController mBubbleController;
+
+ @Inject
+ public BubbleOverflowActivity(BubbleController controller) {
+ mBubbleController = controller;
+ }
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -64,6 +72,6 @@ public class BubbleOverflowActivity extends Activity {
}
public void onDestroy() {
- super.onStop();
+ super.onDestroy();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/DefaultActivityBinder.java b/packages/SystemUI/src/com/android/systemui/dagger/DefaultActivityBinder.java
index 9598e3c21049..91f032d86a94 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/DefaultActivityBinder.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/DefaultActivityBinder.java
@@ -19,6 +19,7 @@ package com.android.systemui.dagger;
import android.app.Activity;
import com.android.systemui.ForegroundServicesDialog;
+import com.android.systemui.bubbles.BubbleOverflowActivity;
import com.android.systemui.keyguard.WorkLockActivity;
import com.android.systemui.screenrecord.ScreenRecordDialog;
import com.android.systemui.settings.BrightnessDialog;
@@ -63,4 +64,10 @@ public abstract class DefaultActivityBinder {
@IntoMap
@ClassKey(ScreenRecordDialog.class)
public abstract Activity bindScreenRecordDialog(ScreenRecordDialog activity);
+
+ /** Inject into BubbleOverflowActivity. */
+ @Binds
+ @IntoMap
+ @ClassKey(BubbleOverflowActivity.class)
+ public abstract Activity bindBubbleOverflowActivity(BubbleOverflowActivity activity);
}