Merge "Get notification snoozing setting for current user" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b6e1127f6e
@@ -5754,8 +5754,8 @@ public class Notification implements Parcelable
|
|||||||
|
|
||||||
private boolean isSnoozeSettingEnabled() {
|
private boolean isSnoozeSettingEnabled() {
|
||||||
try {
|
try {
|
||||||
return Settings.Secure.getInt(mContext.getContentResolver(),
|
return Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
||||||
Settings.Secure.SHOW_NOTIFICATION_SNOOZE, 0) == 1;
|
Settings.Secure.SHOW_NOTIFICATION_SNOOZE, 0, UserHandle.USER_CURRENT) == 1;
|
||||||
} catch (SecurityException ex) {
|
} catch (SecurityException ex) {
|
||||||
// Most 3p apps can't access this snooze setting, so their NotificationListeners
|
// Most 3p apps can't access this snooze setting, so their NotificationListeners
|
||||||
// would be unable to create notification views if we propagated this exception.
|
// would be unable to create notification views if we propagated this exception.
|
||||||
|
|||||||
@@ -359,7 +359,8 @@ public class PreparationCoordinator implements Coordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NotifInflater.Params getInflaterParams(NotifUiAdjustment adjustment, String reason) {
|
NotifInflater.Params getInflaterParams(NotifUiAdjustment adjustment, String reason) {
|
||||||
return new NotifInflater.Params(adjustment.isMinimized(), reason);
|
return new NotifInflater.Params(adjustment.isMinimized(), reason,
|
||||||
|
adjustment.isSnoozeEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void abortInflation(NotificationEntry entry, String reason) {
|
private void abortInflation(NotificationEntry entry, String reason) {
|
||||||
|
|||||||
@@ -61,5 +61,5 @@ interface NotifInflater {
|
|||||||
/**
|
/**
|
||||||
* A class holding parameters used when inflating the notification row
|
* A class holding parameters used when inflating the notification row
|
||||||
*/
|
*/
|
||||||
class Params(val isLowPriority: Boolean, val reason: String)
|
class Params(val isLowPriority: Boolean, val reason: String, val showSnooze: Boolean)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,12 +16,15 @@
|
|||||||
|
|
||||||
package com.android.systemui.statusbar.notification.collection.inflation
|
package com.android.systemui.statusbar.notification.collection.inflation
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
import android.database.ContentObserver
|
import android.database.ContentObserver
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
|
import android.os.HandlerExecutor
|
||||||
import android.os.UserHandle
|
import android.os.UserHandle
|
||||||
import android.provider.Settings.Secure.SHOW_NOTIFICATION_SNOOZE
|
import android.provider.Settings.Secure.SHOW_NOTIFICATION_SNOOZE
|
||||||
import com.android.systemui.dagger.SysUISingleton
|
import com.android.systemui.dagger.SysUISingleton
|
||||||
import com.android.systemui.dagger.qualifiers.Main
|
import com.android.systemui.dagger.qualifiers.Main
|
||||||
|
import com.android.systemui.settings.UserTracker
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager
|
||||||
import com.android.systemui.statusbar.notification.collection.GroupEntry
|
import com.android.systemui.statusbar.notification.collection.GroupEntry
|
||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
||||||
@@ -39,11 +42,25 @@ class NotifUiAdjustmentProvider @Inject constructor(
|
|||||||
@Main private val handler: Handler,
|
@Main private val handler: Handler,
|
||||||
private val secureSettings: SecureSettings,
|
private val secureSettings: SecureSettings,
|
||||||
private val lockscreenUserManager: NotificationLockscreenUserManager,
|
private val lockscreenUserManager: NotificationLockscreenUserManager,
|
||||||
private val sectionStyleProvider: SectionStyleProvider
|
private val sectionStyleProvider: SectionStyleProvider,
|
||||||
|
private val userTracker: UserTracker
|
||||||
) {
|
) {
|
||||||
private val dirtyListeners = ListenerSet<Runnable>()
|
private val dirtyListeners = ListenerSet<Runnable>()
|
||||||
private var isSnoozeEnabled = false
|
private var isSnoozeEnabled = false
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the snooze enabled value on user switch
|
||||||
|
*/
|
||||||
|
private val userTrackerCallback = object : UserTracker.Callback {
|
||||||
|
override fun onUserChanged(newUser: Int, userContext: Context) {
|
||||||
|
updateSnoozeEnabled()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
init {
|
||||||
|
userTracker.addCallback(userTrackerCallback, HandlerExecutor(handler))
|
||||||
|
}
|
||||||
|
|
||||||
fun addDirtyListener(listener: Runnable) {
|
fun addDirtyListener(listener: Runnable) {
|
||||||
if (dirtyListeners.isEmpty()) {
|
if (dirtyListeners.isEmpty()) {
|
||||||
lockscreenUserManager.addNotificationStateChangedListener(notifStateChangedListener)
|
lockscreenUserManager.addNotificationStateChangedListener(notifStateChangedListener)
|
||||||
@@ -78,7 +95,8 @@ class NotifUiAdjustmentProvider @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateSnoozeEnabled() {
|
private fun updateSnoozeEnabled() {
|
||||||
isSnoozeEnabled = secureSettings.getInt(SHOW_NOTIFICATION_SNOOZE, 0) == 1
|
isSnoozeEnabled =
|
||||||
|
secureSettings.getIntForUser(SHOW_NOTIFICATION_SNOOZE, 0, UserHandle.USER_CURRENT) == 1
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isEntryMinimized(entry: NotificationEntry): Boolean {
|
private fun isEntryMinimized(entry: NotificationEntry): Boolean {
|
||||||
|
|||||||
@@ -212,6 +212,9 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
|
|||||||
mMessagingUtil.isImportantMessaging(entry.getSbn(), entry.getImportance());
|
mMessagingUtil.isImportantMessaging(entry.getSbn(), entry.getImportance());
|
||||||
final boolean isLowPriority = inflaterParams.isLowPriority();
|
final boolean isLowPriority = inflaterParams.isLowPriority();
|
||||||
|
|
||||||
|
// Set show snooze action
|
||||||
|
row.setShowSnooze(inflaterParams.getShowSnooze());
|
||||||
|
|
||||||
RowContentBindParams params = mRowContentBindStage.getStageParams(entry);
|
RowContentBindParams params = mRowContentBindStage.getStageParams(entry);
|
||||||
params.requireContentViews(FLAG_CONTENT_VIEW_CONTRACTED);
|
params.requireContentViews(FLAG_CONTENT_VIEW_CONTRACTED);
|
||||||
params.requireContentViews(FLAG_CONTENT_VIEW_EXPANDED);
|
params.requireContentViews(FLAG_CONTENT_VIEW_EXPANDED);
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
// the background on first content update just in case it happens to be during a theme change.
|
// the background on first content update just in case it happens to be during a theme change.
|
||||||
private boolean mUpdateSelfBackgroundOnUpdate = true;
|
private boolean mUpdateSelfBackgroundOnUpdate = true;
|
||||||
private boolean mIsSnoozed;
|
private boolean mIsSnoozed;
|
||||||
|
private boolean mShowSnooze = false;
|
||||||
private boolean mIsFaded;
|
private boolean mIsFaded;
|
||||||
private boolean mAnimatePinnedRoundness = false;
|
private boolean mAnimatePinnedRoundness = false;
|
||||||
|
|
||||||
@@ -3735,4 +3736,14 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
updateBaseRoundness();
|
updateBaseRoundness();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Set whether this notification may show a snooze action. */
|
||||||
|
public void setShowSnooze(boolean showSnooze) {
|
||||||
|
mShowSnooze = showSnooze;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Whether this notification may show a snooze action. */
|
||||||
|
public boolean getShowSnooze() {
|
||||||
|
return mShowSnooze;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import android.graphics.Rect;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.provider.Settings;
|
|
||||||
import android.service.notification.StatusBarNotification;
|
import android.service.notification.StatusBarNotification;
|
||||||
import android.util.ArrayMap;
|
import android.util.ArrayMap;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
@@ -1440,11 +1439,9 @@ public class NotificationContentView extends FrameLayout implements Notification
|
|||||||
if (snoozeButton == null || actionContainer == null) {
|
if (snoozeButton == null || actionContainer == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final boolean showSnooze = Settings.Secure.getInt(mContext.getContentResolver(),
|
|
||||||
Settings.Secure.SHOW_NOTIFICATION_SNOOZE, 0) == 1;
|
|
||||||
// Notification.Builder can 'disable' the snooze button to prevent it from being shown here
|
// Notification.Builder can 'disable' the snooze button to prevent it from being shown here
|
||||||
boolean snoozeDisabled = !snoozeButton.isEnabled();
|
boolean snoozeDisabled = !snoozeButton.isEnabled();
|
||||||
if (!showSnooze || snoozeDisabled) {
|
if (!mContainingNotification.getShowSnooze() || snoozeDisabled) {
|
||||||
snoozeButton.setVisibility(GONE);
|
snoozeButton.setVisibility(GONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.systemui.statusbar.notification.row;
|
package com.android.systemui.statusbar.notification.row;
|
||||||
|
|
||||||
import static android.provider.Settings.Secure.SHOW_NOTIFICATION_SNOOZE;
|
|
||||||
import static android.view.HapticFeedbackConstants.CLOCK_TICK;
|
import static android.view.HapticFeedbackConstants.CLOCK_TICK;
|
||||||
|
|
||||||
import static com.android.systemui.SwipeHelper.SWIPED_FAR_ENOUGH_SIZE_FRACTION;
|
import static com.android.systemui.SwipeHelper.SWIPED_FAR_ENOUGH_SIZE_FRACTION;
|
||||||
@@ -253,9 +252,7 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl
|
|||||||
mLeftMenuItems.clear();
|
mLeftMenuItems.clear();
|
||||||
mRightMenuItems.clear();
|
mRightMenuItems.clear();
|
||||||
|
|
||||||
boolean showSnooze = Settings.Secure.getInt(mContext.getContentResolver(),
|
final boolean showSnooze = mParent.getShowSnooze();
|
||||||
SHOW_NOTIFICATION_SNOOZE, 0) == 1;
|
|
||||||
|
|
||||||
// Construct the menu items based on the notification
|
// Construct the menu items based on the notification
|
||||||
if (showSnooze) {
|
if (showSnooze) {
|
||||||
// Only show snooze for non-foreground notifications, and if the setting is on
|
// Only show snooze for non-foreground notifications, and if the setting is on
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import androidx.test.filters.SmallTest;
|
|||||||
|
|
||||||
import com.android.internal.statusbar.IStatusBarService;
|
import com.android.internal.statusbar.IStatusBarService;
|
||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
|
import com.android.systemui.settings.UserTracker;
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
import com.android.systemui.statusbar.RankingBuilder;
|
import com.android.systemui.statusbar.RankingBuilder;
|
||||||
import com.android.systemui.statusbar.notification.collection.GroupEntry;
|
import com.android.systemui.statusbar.notification.collection.GroupEntry;
|
||||||
@@ -103,6 +104,7 @@ public class PreparationCoordinatorTest extends SysuiTestCase {
|
|||||||
@Mock private SecureSettings mSecureSettings;
|
@Mock private SecureSettings mSecureSettings;
|
||||||
@Spy private FakeNotifInflater mNotifInflater = new FakeNotifInflater();
|
@Spy private FakeNotifInflater mNotifInflater = new FakeNotifInflater();
|
||||||
private final SectionStyleProvider mSectionStyleProvider = new SectionStyleProvider();
|
private final SectionStyleProvider mSectionStyleProvider = new SectionStyleProvider();
|
||||||
|
@Mock private UserTracker mUserTracker;
|
||||||
|
|
||||||
private NotifUiAdjustmentProvider mAdjustmentProvider;
|
private NotifUiAdjustmentProvider mAdjustmentProvider;
|
||||||
|
|
||||||
@@ -118,7 +120,8 @@ public class PreparationCoordinatorTest extends SysuiTestCase {
|
|||||||
mHandler,
|
mHandler,
|
||||||
mSecureSettings,
|
mSecureSettings,
|
||||||
mLockscreenUserManager,
|
mLockscreenUserManager,
|
||||||
mSectionStyleProvider);
|
mSectionStyleProvider,
|
||||||
|
mUserTracker);
|
||||||
mEntry = getNotificationEntryBuilder().setParent(ROOT_ENTRY).build();
|
mEntry = getNotificationEntryBuilder().setParent(ROOT_ENTRY).build();
|
||||||
mInflationError = new Exception(TEST_MESSAGE);
|
mInflationError = new Exception(TEST_MESSAGE);
|
||||||
mErrorManager = new NotifInflationErrorManager();
|
mErrorManager = new NotifInflationErrorManager();
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.testing.AndroidTestingRunner
|
|||||||
import android.testing.TestableLooper.RunWithLooper
|
import android.testing.TestableLooper.RunWithLooper
|
||||||
import androidx.test.filters.SmallTest
|
import androidx.test.filters.SmallTest
|
||||||
import com.android.systemui.SysuiTestCase
|
import com.android.systemui.SysuiTestCase
|
||||||
|
import com.android.systemui.settings.UserTracker
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager
|
||||||
import com.android.systemui.statusbar.notification.collection.GroupEntry
|
import com.android.systemui.statusbar.notification.collection.GroupEntry
|
||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder
|
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder
|
||||||
@@ -53,6 +54,7 @@ class NotifUiAdjustmentProviderTest : SysuiTestCase() {
|
|||||||
private val secureSettings: SecureSettings = mock()
|
private val secureSettings: SecureSettings = mock()
|
||||||
private val uri = FakeSettings().getUriFor(SHOW_NOTIFICATION_SNOOZE)
|
private val uri = FakeSettings().getUriFor(SHOW_NOTIFICATION_SNOOZE)
|
||||||
private val dirtyListener: Runnable = mock()
|
private val dirtyListener: Runnable = mock()
|
||||||
|
private val userTracker: UserTracker = mock()
|
||||||
|
|
||||||
private val section = NotifSection(mock(), 0)
|
private val section = NotifSection(mock(), 0)
|
||||||
private val entry = NotificationEntryBuilder()
|
private val entry = NotificationEntryBuilder()
|
||||||
@@ -67,13 +69,14 @@ class NotifUiAdjustmentProviderTest : SysuiTestCase() {
|
|||||||
secureSettings,
|
secureSettings,
|
||||||
lockscreenUserManager,
|
lockscreenUserManager,
|
||||||
sectionStyleProvider,
|
sectionStyleProvider,
|
||||||
|
userTracker
|
||||||
)
|
)
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun setup() {
|
fun setup() {
|
||||||
verifyNoMoreInteractions(secureSettings)
|
verifyNoMoreInteractions(secureSettings)
|
||||||
adjustmentProvider.addDirtyListener(dirtyListener)
|
adjustmentProvider.addDirtyListener(dirtyListener)
|
||||||
verify(secureSettings).getInt(eq(SHOW_NOTIFICATION_SNOOZE), any())
|
verify(secureSettings).getIntForUser(eq(SHOW_NOTIFICATION_SNOOZE), any(), any())
|
||||||
contentObserver = withArgCaptor {
|
contentObserver = withArgCaptor {
|
||||||
verify(secureSettings).registerContentObserverForUser(
|
verify(secureSettings).registerContentObserverForUser(
|
||||||
eq(SHOW_NOTIFICATION_SNOOZE), capture(), any()
|
eq(SHOW_NOTIFICATION_SNOOZE), capture(), any()
|
||||||
@@ -105,18 +108,20 @@ class NotifUiAdjustmentProviderTest : SysuiTestCase() {
|
|||||||
fun onChangeWillQueryThenNotifyDirty() {
|
fun onChangeWillQueryThenNotifyDirty() {
|
||||||
contentObserver.onChange(false, listOf(uri), 0, 0)
|
contentObserver.onChange(false, listOf(uri), 0, 0)
|
||||||
with(inOrder(secureSettings, dirtyListener)) {
|
with(inOrder(secureSettings, dirtyListener)) {
|
||||||
verify(secureSettings).getInt(eq(SHOW_NOTIFICATION_SNOOZE), any())
|
verify(secureSettings).getIntForUser(eq(SHOW_NOTIFICATION_SNOOZE), any(), any())
|
||||||
verify(dirtyListener).run()
|
verify(dirtyListener).run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun changingSnoozeChangesProvidedAdjustment() {
|
fun changingSnoozeChangesProvidedAdjustment() {
|
||||||
whenever(secureSettings.getInt(eq(SHOW_NOTIFICATION_SNOOZE), any())).thenReturn(0)
|
whenever(secureSettings.getIntForUser(eq(SHOW_NOTIFICATION_SNOOZE), any(), any()))
|
||||||
|
.thenReturn(0)
|
||||||
val original = adjustmentProvider.calculateAdjustment(entry)
|
val original = adjustmentProvider.calculateAdjustment(entry)
|
||||||
assertThat(original.isSnoozeEnabled).isFalse()
|
assertThat(original.isSnoozeEnabled).isFalse()
|
||||||
|
|
||||||
whenever(secureSettings.getInt(eq(SHOW_NOTIFICATION_SNOOZE), any())).thenReturn(1)
|
whenever(secureSettings.getIntForUser(eq(SHOW_NOTIFICATION_SNOOZE), any(), any()))
|
||||||
|
.thenReturn(1)
|
||||||
contentObserver.onChange(false, listOf(uri), 0, 0)
|
contentObserver.onChange(false, listOf(uri), 0, 0)
|
||||||
val withSnoozing = adjustmentProvider.calculateAdjustment(entry)
|
val withSnoozing = adjustmentProvider.calculateAdjustment(entry)
|
||||||
assertThat(withSnoozing.isSnoozeEnabled).isTrue()
|
assertThat(withSnoozing.isSnoozeEnabled).isTrue()
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
package com.android.systemui.statusbar.notification.row;
|
package com.android.systemui.statusbar.notification.row;
|
||||||
|
|
||||||
import static android.provider.Settings.Global.SHOW_NEW_NOTIF_DISMISS;
|
import static android.provider.Settings.Global.SHOW_NEW_NOTIF_DISMISS;
|
||||||
import static android.provider.Settings.Secure.SHOW_NOTIFICATION_SNOOZE;
|
|
||||||
import static android.view.HapticFeedbackConstants.CLOCK_TICK;
|
import static android.view.HapticFeedbackConstants.CLOCK_TICK;
|
||||||
|
|
||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
@@ -100,7 +99,7 @@ public class NotificationMenuRowTest extends LeakCheckedTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNoAppOpsInSlowSwipe() {
|
public void testNoAppOpsInSlowSwipe() {
|
||||||
Settings.Secure.putInt(mContext.getContentResolver(), SHOW_NOTIFICATION_SNOOZE, 0);
|
when(mRow.getShowSnooze()).thenReturn(false);
|
||||||
Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0);
|
Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0);
|
||||||
|
|
||||||
NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
|
NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
|
||||||
@@ -113,7 +112,7 @@ public class NotificationMenuRowTest extends LeakCheckedTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNoSnoozeInSlowSwipe() {
|
public void testNoSnoozeInSlowSwipe() {
|
||||||
Settings.Secure.putInt(mContext.getContentResolver(), SHOW_NOTIFICATION_SNOOZE, 0);
|
when(mRow.getShowSnooze()).thenReturn(false);
|
||||||
Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0);
|
Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0);
|
||||||
|
|
||||||
NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
|
NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
|
||||||
@@ -126,7 +125,7 @@ public class NotificationMenuRowTest extends LeakCheckedTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSnoozeInSlowSwipe() {
|
public void testSnoozeInSlowSwipe() {
|
||||||
Settings.Secure.putInt(mContext.getContentResolver(), SHOW_NOTIFICATION_SNOOZE, 1);
|
when(mRow.getShowSnooze()).thenReturn(true);
|
||||||
Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0);
|
Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0);
|
||||||
|
|
||||||
NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
|
NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
|
||||||
@@ -139,7 +138,7 @@ public class NotificationMenuRowTest extends LeakCheckedTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSlowSwipe_newDismiss() {
|
public void testSlowSwipe_newDismiss() {
|
||||||
Settings.Secure.putInt(mContext.getContentResolver(), SHOW_NOTIFICATION_SNOOZE, 1);
|
when(mRow.getShowSnooze()).thenReturn(true);
|
||||||
Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 1);
|
Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 1);
|
||||||
|
|
||||||
NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
|
NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier);
|
||||||
|
|||||||
Reference in New Issue
Block a user