Merge "Fix CTS" into rvc-dev
This commit is contained in:
@@ -161,6 +161,19 @@ public final class NotificationChannel implements Parcelable {
|
|||||||
USER_LOCKED_ALLOW_BUBBLE
|
USER_LOCKED_ALLOW_BUBBLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int DEFAULT_ALLOW_BUBBLE = -1;
|
||||||
|
/**
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int ALLOW_BUBBLE_ON = 1;
|
||||||
|
/**
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int ALLOW_BUBBLE_OFF = 0;
|
||||||
|
|
||||||
private static final int DEFAULT_LIGHT_COLOR = 0;
|
private static final int DEFAULT_LIGHT_COLOR = 0;
|
||||||
private static final int DEFAULT_VISIBILITY =
|
private static final int DEFAULT_VISIBILITY =
|
||||||
NotificationManager.VISIBILITY_NO_OVERRIDE;
|
NotificationManager.VISIBILITY_NO_OVERRIDE;
|
||||||
@@ -168,12 +181,6 @@ public final class NotificationChannel implements Parcelable {
|
|||||||
NotificationManager.IMPORTANCE_UNSPECIFIED;
|
NotificationManager.IMPORTANCE_UNSPECIFIED;
|
||||||
private static final boolean DEFAULT_DELETED = false;
|
private static final boolean DEFAULT_DELETED = false;
|
||||||
private static final boolean DEFAULT_SHOW_BADGE = true;
|
private static final boolean DEFAULT_SHOW_BADGE = true;
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public static final int DEFAULT_ALLOW_BUBBLE = -1;
|
|
||||||
private static final int ALLOW_BUBBLE_ON = 1;
|
|
||||||
private static final int ALLOW_BUBBLE_OFF = 0;
|
|
||||||
|
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
private String mId;
|
private String mId;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ package com.android.server.notification;
|
|||||||
|
|
||||||
import static android.app.Notification.FLAG_BUBBLE;
|
import static android.app.Notification.FLAG_BUBBLE;
|
||||||
import static android.app.Notification.FLAG_FOREGROUND_SERVICE;
|
import static android.app.Notification.FLAG_FOREGROUND_SERVICE;
|
||||||
import static android.app.NotificationChannel.USER_LOCKED_ALLOW_BUBBLE;
|
import static android.app.NotificationChannel.ALLOW_BUBBLE_OFF;
|
||||||
import static android.app.NotificationManager.BUBBLE_PREFERENCE_ALL;
|
import static android.app.NotificationManager.BUBBLE_PREFERENCE_ALL;
|
||||||
import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE;
|
import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE;
|
||||||
import static android.app.NotificationManager.BUBBLE_PREFERENCE_SELECTED;
|
import static android.app.NotificationManager.BUBBLE_PREFERENCE_SELECTED;
|
||||||
@@ -82,10 +82,7 @@ public class BubbleExtractor implements NotificationSignalExtractor {
|
|||||||
// the app is allowed but there's no channel to check
|
// the app is allowed but there's no channel to check
|
||||||
record.setAllowBubble(true);
|
record.setAllowBubble(true);
|
||||||
} else if (bubblePreference == BUBBLE_PREFERENCE_ALL) {
|
} else if (bubblePreference == BUBBLE_PREFERENCE_ALL) {
|
||||||
// by default the channel is not allowed, only don't bubble if the user specified
|
record.setAllowBubble(recordChannel.getAllowBubbles() != ALLOW_BUBBLE_OFF);
|
||||||
boolean userLockedNoBubbles = !recordChannel.canBubble()
|
|
||||||
&& (recordChannel.getUserLockedFields() & USER_LOCKED_ALLOW_BUBBLE) != 0;
|
|
||||||
record.setAllowBubble(!userLockedNoBubbles);
|
|
||||||
} else if (bubblePreference == BUBBLE_PREFERENCE_SELECTED) {
|
} else if (bubblePreference == BUBBLE_PREFERENCE_SELECTED) {
|
||||||
record.setAllowBubble(recordChannel.canBubble());
|
record.setAllowBubble(recordChannel.canBubble());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package com.android.server.notification;
|
package com.android.server.notification;
|
||||||
|
|
||||||
import static android.app.NotificationChannel.USER_LOCKED_ALLOW_BUBBLE;
|
import static android.app.NotificationChannel.ALLOW_BUBBLE_OFF;
|
||||||
|
import static android.app.NotificationChannel.ALLOW_BUBBLE_ON;
|
||||||
|
import static android.app.NotificationChannel.DEFAULT_ALLOW_BUBBLE;
|
||||||
import static android.app.NotificationManager.BUBBLE_PREFERENCE_ALL;
|
import static android.app.NotificationManager.BUBBLE_PREFERENCE_ALL;
|
||||||
import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE;
|
import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE;
|
||||||
import static android.app.NotificationManager.BUBBLE_PREFERENCE_SELECTED;
|
import static android.app.NotificationManager.BUBBLE_PREFERENCE_SELECTED;
|
||||||
|
import static android.app.NotificationManager.IMPORTANCE_DEFAULT;
|
||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE;
|
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE;
|
||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
|
import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
|
||||||
|
|
||||||
@@ -59,6 +62,7 @@ import org.mockito.MockitoAnnotations;
|
|||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class BubbleExtractorTest extends UiServiceTestCase {
|
public class BubbleExtractorTest extends UiServiceTestCase {
|
||||||
|
|
||||||
|
private static final String CHANNEL_ID = "bubbleExtractorChannelId";
|
||||||
private static final String SHORTCUT_ID = "shortcut";
|
private static final String SHORTCUT_ID = "shortcut";
|
||||||
private static final String PKG = "com.android.server.notification";
|
private static final String PKG = "com.android.server.notification";
|
||||||
private static final String TAG = null;
|
private static final String TAG = null;
|
||||||
@@ -68,12 +72,11 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
UserHandle mUser = UserHandle.of(ActivityManager.getCurrentUser());
|
UserHandle mUser = UserHandle.of(ActivityManager.getCurrentUser());
|
||||||
|
|
||||||
BubbleExtractor mBubbleExtractor;
|
BubbleExtractor mBubbleExtractor;
|
||||||
|
NotificationChannel mChannel;
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
RankingConfig mConfig;
|
RankingConfig mConfig;
|
||||||
@Mock
|
@Mock
|
||||||
NotificationChannel mChannel;
|
|
||||||
@Mock
|
|
||||||
Notification.BubbleMetadata mBubbleMetadata;
|
Notification.BubbleMetadata mBubbleMetadata;
|
||||||
@Mock
|
@Mock
|
||||||
PendingIntent mPendingIntent;
|
PendingIntent mPendingIntent;
|
||||||
@@ -95,7 +98,8 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
mBubbleExtractor.setShortcutHelper(mShortcutHelper);
|
mBubbleExtractor.setShortcutHelper(mShortcutHelper);
|
||||||
mBubbleExtractor.setActivityManager(mActivityManager);
|
mBubbleExtractor.setActivityManager(mActivityManager);
|
||||||
|
|
||||||
when(mConfig.getNotificationChannel(PKG, UID, "a", false)).thenReturn(mChannel);
|
mChannel = new NotificationChannel(CHANNEL_ID, CHANNEL_ID, IMPORTANCE_DEFAULT);
|
||||||
|
when(mConfig.getNotificationChannel(PKG, UID, CHANNEL_ID, false)).thenReturn(mChannel);
|
||||||
when(mShortcutInfo.getId()).thenReturn(SHORTCUT_ID);
|
when(mShortcutInfo.getId()).thenReturn(SHORTCUT_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,10 +151,10 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
when(mShortcutHelper.getValidShortcutInfo(SHORTCUT_ID, PKG, mUser)).thenReturn(answer);
|
when(mShortcutHelper.getValidShortcutInfo(SHORTCUT_ID, PKG, mUser)).thenReturn(answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setUpBubblesEnabled(boolean feature, int app, boolean channel) {
|
void setUpBubblesEnabled(boolean feature, int app, int channel) {
|
||||||
when(mConfig.bubblesEnabled()).thenReturn(feature);
|
when(mConfig.bubblesEnabled()).thenReturn(feature);
|
||||||
when(mConfig.getBubblePreference(anyString(), anyInt())).thenReturn(app);
|
when(mConfig.getBubblePreference(anyString(), anyInt())).thenReturn(app);
|
||||||
when(mChannel.canBubble()).thenReturn(channel);
|
mChannel.setAllowBubbles(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -161,9 +165,45 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testAppYesChannelNo() {
|
public void testAppYesChannelNo() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
false /* channel */);
|
ALLOW_BUBBLE_OFF /* channel */);
|
||||||
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
||||||
when(mChannel.getUserLockedFields()).thenReturn(USER_LOCKED_ALLOW_BUBBLE);
|
mBubbleExtractor.process(r);
|
||||||
|
|
||||||
|
assertFalse(r.canBubble());
|
||||||
|
assertFalse(r.getNotification().isBubbleNotification());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAppYesChannelDefault() {
|
||||||
|
setUpBubblesEnabled(true /* feature */,
|
||||||
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
|
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
||||||
|
|
||||||
|
mBubbleExtractor.process(r);
|
||||||
|
|
||||||
|
assertTrue(r.canBubble());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAppYesChannelYes() {
|
||||||
|
setUpBubblesEnabled(true /* feature */,
|
||||||
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
|
ALLOW_BUBBLE_ON /* channel */);
|
||||||
|
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
||||||
|
|
||||||
|
mBubbleExtractor.process(r);
|
||||||
|
|
||||||
|
assertTrue(r.canBubble());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAppYesChannelYesFeatureNo() {
|
||||||
|
setUpBubblesEnabled(false /* feature */,
|
||||||
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
|
ALLOW_BUBBLE_ON /* channel */);
|
||||||
|
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
||||||
|
|
||||||
mBubbleExtractor.process(r);
|
mBubbleExtractor.process(r);
|
||||||
|
|
||||||
assertFalse(r.canBubble());
|
assertFalse(r.canBubble());
|
||||||
@@ -174,7 +214,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testAppNoChannelYes() throws Exception {
|
public void testAppNoChannelYes() throws Exception {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_NONE /* app */,
|
BUBBLE_PREFERENCE_NONE /* app */,
|
||||||
true /* channel */);
|
ALLOW_BUBBLE_ON /* channel */);
|
||||||
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
||||||
|
|
||||||
mBubbleExtractor.process(r);
|
mBubbleExtractor.process(r);
|
||||||
@@ -184,22 +224,10 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAppYesChannelYes() {
|
public void testAppNoChannelDefault() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
|
||||||
true /* channel */);
|
|
||||||
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
|
||||||
|
|
||||||
mBubbleExtractor.process(r);
|
|
||||||
|
|
||||||
assertTrue(r.canBubble());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testAppNoChannelNo() {
|
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_NONE /* app */,
|
BUBBLE_PREFERENCE_NONE /* app */,
|
||||||
false /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
||||||
|
|
||||||
mBubbleExtractor.process(r);
|
mBubbleExtractor.process(r);
|
||||||
@@ -209,10 +237,10 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAppYesChannelYesUserNo() {
|
public void testAppSelectedChannelDefault() {
|
||||||
setUpBubblesEnabled(false /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_SELECTED /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
||||||
|
|
||||||
mBubbleExtractor.process(r);
|
mBubbleExtractor.process(r);
|
||||||
@@ -225,7 +253,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testAppSelectedChannelNo() {
|
public void testAppSelectedChannelNo() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_SELECTED /* app */,
|
BUBBLE_PREFERENCE_SELECTED /* app */,
|
||||||
false /* channel */);
|
ALLOW_BUBBLE_OFF /* channel */);
|
||||||
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
||||||
|
|
||||||
mBubbleExtractor.process(r);
|
mBubbleExtractor.process(r);
|
||||||
@@ -238,15 +266,27 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testAppSeletedChannelYes() {
|
public void testAppSeletedChannelYes() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_SELECTED /* app */,
|
BUBBLE_PREFERENCE_SELECTED /* app */,
|
||||||
true /* channel */);
|
ALLOW_BUBBLE_ON /* channel */);
|
||||||
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
||||||
when(mChannel.getUserLockedFields()).thenReturn(USER_LOCKED_ALLOW_BUBBLE);
|
|
||||||
|
|
||||||
mBubbleExtractor.process(r);
|
mBubbleExtractor.process(r);
|
||||||
|
|
||||||
assertTrue(r.canBubble());
|
assertTrue(r.canBubble());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAppSeletedChannelYesFeatureNo() {
|
||||||
|
setUpBubblesEnabled(false /* feature */,
|
||||||
|
BUBBLE_PREFERENCE_SELECTED /* app */,
|
||||||
|
ALLOW_BUBBLE_ON /* channel */);
|
||||||
|
NotificationRecord r = getNotificationRecord(true /* bubble */);
|
||||||
|
|
||||||
|
mBubbleExtractor.process(r);
|
||||||
|
|
||||||
|
assertFalse(r.canBubble());
|
||||||
|
assertFalse(r.getNotification().isBubbleNotification());
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tests for flagging it as a bubble.
|
// Tests for flagging it as a bubble.
|
||||||
//
|
//
|
||||||
@@ -255,7 +295,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_false_previouslyRemoved() {
|
public void testFlagBubble_false_previouslyRemoved() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
||||||
setUpShortcutBubble(true /* isValid */);
|
setUpShortcutBubble(true /* isValid */);
|
||||||
|
|
||||||
@@ -272,7 +312,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_true_shortcutBubble() {
|
public void testFlagBubble_true_shortcutBubble() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
||||||
setUpShortcutBubble(true /* isValid */);
|
setUpShortcutBubble(true /* isValid */);
|
||||||
|
|
||||||
@@ -287,7 +327,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_true_intentBubble() {
|
public void testFlagBubble_true_intentBubble() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
||||||
setUpIntentBubble(true /* isValid */);
|
setUpIntentBubble(true /* isValid */);
|
||||||
|
|
||||||
@@ -302,7 +342,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_false_noIntentInvalidShortcut() {
|
public void testFlagBubble_false_noIntentInvalidShortcut() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
||||||
setUpShortcutBubble(false /* isValid */);
|
setUpShortcutBubble(false /* isValid */);
|
||||||
|
|
||||||
@@ -318,7 +358,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_false_invalidIntentNoShortcut() {
|
public void testFlagBubble_false_invalidIntentNoShortcut() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
||||||
setUpIntentBubble(false /* isValid */);
|
setUpIntentBubble(false /* isValid */);
|
||||||
|
|
||||||
@@ -334,7 +374,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_false_noIntentNoShortcut() {
|
public void testFlagBubble_false_noIntentNoShortcut() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
||||||
|
|
||||||
// Shortcut here is for the notification not the bubble
|
// Shortcut here is for the notification not the bubble
|
||||||
@@ -349,7 +389,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_false_noMetadata() {
|
public void testFlagBubble_false_noMetadata() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
||||||
|
|
||||||
NotificationRecord r = getNotificationRecord(false /* bubble */);
|
NotificationRecord r = getNotificationRecord(false /* bubble */);
|
||||||
@@ -363,7 +403,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_false_notConversation() {
|
public void testFlagBubble_false_notConversation() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
||||||
setUpIntentBubble(true /* isValid */);
|
setUpIntentBubble(true /* isValid */);
|
||||||
|
|
||||||
@@ -382,7 +422,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_false_lowRamDevice() {
|
public void testFlagBubble_false_lowRamDevice() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(true);
|
when(mActivityManager.isLowRamDevice()).thenReturn(true);
|
||||||
setUpIntentBubble(true /* isValid */);
|
setUpIntentBubble(true /* isValid */);
|
||||||
|
|
||||||
@@ -397,7 +437,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_false_noIntent() {
|
public void testFlagBubble_false_noIntent() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(true);
|
when(mActivityManager.isLowRamDevice()).thenReturn(true);
|
||||||
setUpIntentBubble(true /* isValid */);
|
setUpIntentBubble(true /* isValid */);
|
||||||
when(mPendingIntent.getIntent()).thenReturn(null);
|
when(mPendingIntent.getIntent()).thenReturn(null);
|
||||||
@@ -413,7 +453,7 @@ public class BubbleExtractorTest extends UiServiceTestCase {
|
|||||||
public void testFlagBubble_false_noActivityInfo() {
|
public void testFlagBubble_false_noActivityInfo() {
|
||||||
setUpBubblesEnabled(true /* feature */,
|
setUpBubblesEnabled(true /* feature */,
|
||||||
BUBBLE_PREFERENCE_ALL /* app */,
|
BUBBLE_PREFERENCE_ALL /* app */,
|
||||||
true /* channel */);
|
DEFAULT_ALLOW_BUBBLE /* channel */);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(true);
|
when(mActivityManager.isLowRamDevice()).thenReturn(true);
|
||||||
setUpIntentBubble(true /* isValid */);
|
setUpIntentBubble(true /* isValid */);
|
||||||
when(mPendingIntent.getIntent()).thenReturn(mIntent);
|
when(mPendingIntent.getIntent()).thenReturn(mIntent);
|
||||||
|
|||||||
Reference in New Issue
Block a user