Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +4 −3 Original line number Diff line number Diff line Loading @@ -150,7 +150,8 @@ public class BubbleController implements BubbleExpandedView.OnBubbleBlockedListe } @Inject public BubbleController(Context context, StatusBarWindowController statusBarWindowController) { public BubbleController(Context context, StatusBarWindowController statusBarWindowController, BubbleData data) { mContext = context; mNotificationEntryManager = Dependency.get(NotificationEntryManager.class); Loading @@ -171,7 +172,7 @@ public class BubbleController implements BubbleExpandedView.OnBubbleBlockedListe mTaskStackListener = new BubbleTaskStackListener(); ActivityManagerWrapper.getInstance().registerTaskStackListener(mTaskStackListener); mBubbleData = BubbleData.getInstance(); mBubbleData = data; } /** Loading Loading @@ -253,7 +254,7 @@ public class BubbleController implements BubbleExpandedView.OnBubbleBlockedListe mStackView.updateBubble(notif, updatePosition); } else { if (mStackView == null) { mStackView = new BubbleStackView(mContext); mStackView = new BubbleStackView(mContext, mBubbleData); ViewGroup sbv = mStatusBarWindowController.getStatusBarView(); // XXX: Bug when you expand the shade on top of expanded bubble, there is no scrim // between bubble and the shade Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +6 −10 Original line number Diff line number Diff line Loading @@ -22,23 +22,19 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry; import java.util.Collection; import java.util.HashMap; import javax.inject.Inject; import javax.inject.Singleton; /** * Keeps track of active bubbles. */ @Singleton class BubbleData { private HashMap<String, Bubble> mBubbles = new HashMap<>(); private static BubbleData sBubbleData = null; private BubbleData() {} public static BubbleData getInstance() { if (sBubbleData == null) { sBubbleData = new BubbleData(); } return sBubbleData; } @Inject BubbleData() {} /** * The set of bubbles. Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +3 −3 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F private final SpringAnimation mExpandedViewXAnim; private final SpringAnimation mExpandedViewYAnim; private final BubbleData mBubbleData; private PhysicsAnimationLayout mBubbleContainer; private StackAnimationController mStackAnimationController; Loading @@ -92,7 +93,6 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F private FrameLayout mExpandedViewContainer; private BubbleData mBubbleData; private int mBubbleSize; private int mBubblePadding; Loading Loading @@ -140,10 +140,10 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F } }; public BubbleStackView(Context context) { public BubbleStackView(Context context, BubbleData data) { super(context); mBubbleData = BubbleData.getInstance(); mBubbleData = data; mInflater = LayoutInflater.from(context); mTouchHandler = new BubbleTouchHandler(context); setOnTouchListener(mTouchHandler); Loading packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +7 −6 Original line number Diff line number Diff line Loading @@ -82,6 +82,8 @@ public class BubbleControllerTest extends SysuiTestCase { @Mock private BubbleController.BubbleExpandListener mBubbleExpandListener; private BubbleData mBubbleData; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); Loading @@ -104,7 +106,9 @@ public class BubbleControllerTest extends SysuiTestCase { when(mNotificationData.getChannel(mRow.getEntry().key)).thenReturn(mRow.getEntry().channel); when(mNotificationData.getChannel(mNoChannelRow.getEntry().key)).thenReturn(null); mBubbleController = new TestableBubbleController(mContext, mStatusBarWindowController); mBubbleData = new BubbleData(); mBubbleController = new TestableBubbleController(mContext, mStatusBarWindowController, mBubbleData); mBubbleController.setBubbleStateChangeListener(mBubbleStateChangeListener); mBubbleController.setExpandListener(mBubbleExpandListener); Loading @@ -112,9 +116,6 @@ public class BubbleControllerTest extends SysuiTestCase { verify(mNotificationEntryManager, atLeastOnce()) .addNotificationEntryListener(mEntryListenerCaptor.capture()); mEntryListener = mEntryListenerCaptor.getValue(); // Reset the data BubbleData.getInstance().clear(); } @Test Loading Loading @@ -300,8 +301,8 @@ public class BubbleControllerTest extends SysuiTestCase { static class TestableBubbleController extends BubbleController { TestableBubbleController(Context context, StatusBarWindowController statusBarWindowController) { super(context, statusBarWindowController); StatusBarWindowController statusBarWindowController, BubbleData data) { super(context, statusBarWindowController, data); } @Override Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +4 −3 Original line number Diff line number Diff line Loading @@ -150,7 +150,8 @@ public class BubbleController implements BubbleExpandedView.OnBubbleBlockedListe } @Inject public BubbleController(Context context, StatusBarWindowController statusBarWindowController) { public BubbleController(Context context, StatusBarWindowController statusBarWindowController, BubbleData data) { mContext = context; mNotificationEntryManager = Dependency.get(NotificationEntryManager.class); Loading @@ -171,7 +172,7 @@ public class BubbleController implements BubbleExpandedView.OnBubbleBlockedListe mTaskStackListener = new BubbleTaskStackListener(); ActivityManagerWrapper.getInstance().registerTaskStackListener(mTaskStackListener); mBubbleData = BubbleData.getInstance(); mBubbleData = data; } /** Loading Loading @@ -253,7 +254,7 @@ public class BubbleController implements BubbleExpandedView.OnBubbleBlockedListe mStackView.updateBubble(notif, updatePosition); } else { if (mStackView == null) { mStackView = new BubbleStackView(mContext); mStackView = new BubbleStackView(mContext, mBubbleData); ViewGroup sbv = mStatusBarWindowController.getStatusBarView(); // XXX: Bug when you expand the shade on top of expanded bubble, there is no scrim // between bubble and the shade Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +6 −10 Original line number Diff line number Diff line Loading @@ -22,23 +22,19 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry; import java.util.Collection; import java.util.HashMap; import javax.inject.Inject; import javax.inject.Singleton; /** * Keeps track of active bubbles. */ @Singleton class BubbleData { private HashMap<String, Bubble> mBubbles = new HashMap<>(); private static BubbleData sBubbleData = null; private BubbleData() {} public static BubbleData getInstance() { if (sBubbleData == null) { sBubbleData = new BubbleData(); } return sBubbleData; } @Inject BubbleData() {} /** * The set of bubbles. Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +3 −3 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F private final SpringAnimation mExpandedViewXAnim; private final SpringAnimation mExpandedViewYAnim; private final BubbleData mBubbleData; private PhysicsAnimationLayout mBubbleContainer; private StackAnimationController mStackAnimationController; Loading @@ -92,7 +93,6 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F private FrameLayout mExpandedViewContainer; private BubbleData mBubbleData; private int mBubbleSize; private int mBubblePadding; Loading Loading @@ -140,10 +140,10 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F } }; public BubbleStackView(Context context) { public BubbleStackView(Context context, BubbleData data) { super(context); mBubbleData = BubbleData.getInstance(); mBubbleData = data; mInflater = LayoutInflater.from(context); mTouchHandler = new BubbleTouchHandler(context); setOnTouchListener(mTouchHandler); Loading
packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +7 −6 Original line number Diff line number Diff line Loading @@ -82,6 +82,8 @@ public class BubbleControllerTest extends SysuiTestCase { @Mock private BubbleController.BubbleExpandListener mBubbleExpandListener; private BubbleData mBubbleData; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); Loading @@ -104,7 +106,9 @@ public class BubbleControllerTest extends SysuiTestCase { when(mNotificationData.getChannel(mRow.getEntry().key)).thenReturn(mRow.getEntry().channel); when(mNotificationData.getChannel(mNoChannelRow.getEntry().key)).thenReturn(null); mBubbleController = new TestableBubbleController(mContext, mStatusBarWindowController); mBubbleData = new BubbleData(); mBubbleController = new TestableBubbleController(mContext, mStatusBarWindowController, mBubbleData); mBubbleController.setBubbleStateChangeListener(mBubbleStateChangeListener); mBubbleController.setExpandListener(mBubbleExpandListener); Loading @@ -112,9 +116,6 @@ public class BubbleControllerTest extends SysuiTestCase { verify(mNotificationEntryManager, atLeastOnce()) .addNotificationEntryListener(mEntryListenerCaptor.capture()); mEntryListener = mEntryListenerCaptor.getValue(); // Reset the data BubbleData.getInstance().clear(); } @Test Loading Loading @@ -300,8 +301,8 @@ public class BubbleControllerTest extends SysuiTestCase { static class TestableBubbleController extends BubbleController { TestableBubbleController(Context context, StatusBarWindowController statusBarWindowController) { super(context, statusBarWindowController); StatusBarWindowController statusBarWindowController, BubbleData data) { super(context, statusBarWindowController, data); } @Override Loading