Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationGutsManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -372,7 +372,7 @@ public class NotificationGutsManager implements Dumpable { @Override public void run() { if (row.getWindowToken() == null) { Log.e(TAG, "Trying to show notification guts, but not attached to " Log.e(TAG, "Trying to show notification guts in post(), but not attached to " + "window"); return; } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationBlockingHelperManagerTest.java +14 −12 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin; import android.content.Context; import android.support.test.filters.FlakyTest; import android.support.test.filters.SmallTest; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; Loading @@ -29,6 +30,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; Loading @@ -48,6 +50,7 @@ import static org.mockito.Mockito.when; * Tests for {@link NotificationBlockingHelperManager}. */ @SmallTest @FlakyTest @org.junit.runner.RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper public class NotificationBlockingHelperManagerTest extends SysuiTestCase { Loading @@ -56,7 +59,6 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { private NotificationTestHelper mHelper; @Rule public MockitoRule mockito = MockitoJUnit.rule(); @Mock private NotificationGutsManager mGutsManager; @Mock private NotificationEntryManager mEntryManager; @Mock private NotificationMenuRow mMenuRow; Loading @@ -64,20 +66,22 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { @Before public void setUp() { mBlockingHelperManager = new NotificationBlockingHelperManager(mContext); // By default, have the shade visible/expanded. mBlockingHelperManager.setNotificationShadeExpanded(1f); mHelper = new NotificationTestHelper(mContext); MockitoAnnotations.initMocks(this); when(mGutsManager.openGuts( any(View.class), anyInt(), anyInt(), any(NotificationMenuRowPlugin.MenuItem.class))) .thenReturn(true); when(mMenuRow.getLongpressMenuItem(any(Context.class))).thenReturn(mMenuItem); mDependency.injectTestDependency(NotificationGutsManager.class, mGutsManager); mDependency.injectTestDependency(NotificationEntryManager.class, mEntryManager); when(mMenuRow.getLongpressMenuItem(any(Context.class))).thenReturn(mMenuItem); mHelper = new NotificationTestHelper(mContext); mBlockingHelperManager = new NotificationBlockingHelperManager(mContext); // By default, have the shade visible/expanded. mBlockingHelperManager.setNotificationShadeExpanded(1f); } @Test Loading @@ -89,7 +93,7 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { @Test public void testDismissCurrentBlockingHelper_withDetachedBlockingHelperRow() throws Exception { ExpandableNotificationRow row = spy(createBlockableRowSpy()); ExpandableNotificationRow row = createBlockableRowSpy(); row.setBlockingHelperShowing(true); when(row.isAttachedToWindow()).thenReturn(false); mBlockingHelperManager.setBlockingHelperRowForTest(row); Loading @@ -102,7 +106,7 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { @Test public void testDismissCurrentBlockingHelper_withAttachedBlockingHelperRow() throws Exception { ExpandableNotificationRow row = spy(createBlockableRowSpy()); ExpandableNotificationRow row = createBlockableRowSpy(); row.setBlockingHelperShowing(true); when(row.isAttachedToWindow()).thenReturn(true); mBlockingHelperManager.setBlockingHelperRowForTest(row); Loading Loading @@ -200,7 +204,7 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { @Test public void testBlockingHelperShowAndDismiss() throws Exception{ ExpandableNotificationRow row = spy(createBlockableRowSpy()); ExpandableNotificationRow row = createBlockableRowSpy(); row.getEntry().userSentiment = USER_SENTIMENT_NEGATIVE; when(row.isAttachedToWindow()).thenReturn(true); Loading @@ -227,6 +231,4 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { when(row.getIsNonblockable()).thenReturn(false); return row; } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationGutsManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -372,7 +372,7 @@ public class NotificationGutsManager implements Dumpable { @Override public void run() { if (row.getWindowToken() == null) { Log.e(TAG, "Trying to show notification guts, but not attached to " Log.e(TAG, "Trying to show notification guts in post(), but not attached to " + "window"); return; } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationBlockingHelperManagerTest.java +14 −12 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin; import android.content.Context; import android.support.test.filters.FlakyTest; import android.support.test.filters.SmallTest; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; Loading @@ -29,6 +30,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; Loading @@ -48,6 +50,7 @@ import static org.mockito.Mockito.when; * Tests for {@link NotificationBlockingHelperManager}. */ @SmallTest @FlakyTest @org.junit.runner.RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper public class NotificationBlockingHelperManagerTest extends SysuiTestCase { Loading @@ -56,7 +59,6 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { private NotificationTestHelper mHelper; @Rule public MockitoRule mockito = MockitoJUnit.rule(); @Mock private NotificationGutsManager mGutsManager; @Mock private NotificationEntryManager mEntryManager; @Mock private NotificationMenuRow mMenuRow; Loading @@ -64,20 +66,22 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { @Before public void setUp() { mBlockingHelperManager = new NotificationBlockingHelperManager(mContext); // By default, have the shade visible/expanded. mBlockingHelperManager.setNotificationShadeExpanded(1f); mHelper = new NotificationTestHelper(mContext); MockitoAnnotations.initMocks(this); when(mGutsManager.openGuts( any(View.class), anyInt(), anyInt(), any(NotificationMenuRowPlugin.MenuItem.class))) .thenReturn(true); when(mMenuRow.getLongpressMenuItem(any(Context.class))).thenReturn(mMenuItem); mDependency.injectTestDependency(NotificationGutsManager.class, mGutsManager); mDependency.injectTestDependency(NotificationEntryManager.class, mEntryManager); when(mMenuRow.getLongpressMenuItem(any(Context.class))).thenReturn(mMenuItem); mHelper = new NotificationTestHelper(mContext); mBlockingHelperManager = new NotificationBlockingHelperManager(mContext); // By default, have the shade visible/expanded. mBlockingHelperManager.setNotificationShadeExpanded(1f); } @Test Loading @@ -89,7 +93,7 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { @Test public void testDismissCurrentBlockingHelper_withDetachedBlockingHelperRow() throws Exception { ExpandableNotificationRow row = spy(createBlockableRowSpy()); ExpandableNotificationRow row = createBlockableRowSpy(); row.setBlockingHelperShowing(true); when(row.isAttachedToWindow()).thenReturn(false); mBlockingHelperManager.setBlockingHelperRowForTest(row); Loading @@ -102,7 +106,7 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { @Test public void testDismissCurrentBlockingHelper_withAttachedBlockingHelperRow() throws Exception { ExpandableNotificationRow row = spy(createBlockableRowSpy()); ExpandableNotificationRow row = createBlockableRowSpy(); row.setBlockingHelperShowing(true); when(row.isAttachedToWindow()).thenReturn(true); mBlockingHelperManager.setBlockingHelperRowForTest(row); Loading Loading @@ -200,7 +204,7 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { @Test public void testBlockingHelperShowAndDismiss() throws Exception{ ExpandableNotificationRow row = spy(createBlockableRowSpy()); ExpandableNotificationRow row = createBlockableRowSpy(); row.getEntry().userSentiment = USER_SENTIMENT_NEGATIVE; when(row.isAttachedToWindow()).thenReturn(true); Loading @@ -227,6 +231,4 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase { when(row.getIsNonblockable()).thenReturn(false); return row; } }