Merge changes from topic "remove_dead_snooze_code" into sc-dev
* changes: Do not allow multiple snooze menus to be open at once Remove dead snooze code
This commit is contained in:
@@ -46,8 +46,6 @@ public interface NotificationSwipeActionHelper {
|
||||
*/
|
||||
public void snooze(StatusBarNotification sbn, SnoozeOption snoozeOption);
|
||||
|
||||
public void snooze(StatusBarNotification sbn, int hours);
|
||||
|
||||
public float getMinDismissVelocity();
|
||||
|
||||
public boolean isDismissGesture(MotionEvent ev);
|
||||
|
||||
@@ -48,6 +48,5 @@ interface NotificationsController {
|
||||
fun resetUserExpandedStates()
|
||||
fun setNotificationSnoozed(sbn: StatusBarNotification, snoozeOption: SnoozeOption)
|
||||
fun getActiveNotificationsCount(): Int
|
||||
fun setNotificationSnoozed(sbn: StatusBarNotification, hoursToSnooze: Int)
|
||||
fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array<String>, dumpTruck: Boolean)
|
||||
}
|
||||
|
||||
@@ -171,10 +171,4 @@ class NotificationsControllerImpl @Inject constructor(
|
||||
override fun getActiveNotificationsCount(): Int {
|
||||
return entryManager.activeNotificationsCount
|
||||
}
|
||||
|
||||
override fun setNotificationSnoozed(sbn: StatusBarNotification, hoursToSnooze: Int) {
|
||||
notificationListener.snoozeNotification(
|
||||
sbn.key,
|
||||
hoursToSnooze * 60 * 60 * 1000.toLong())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,9 +59,6 @@ class NotificationsControllerStub @Inject constructor(
|
||||
override fun setNotificationSnoozed(sbn: StatusBarNotification, snoozeOption: SnoozeOption) {
|
||||
}
|
||||
|
||||
override fun setNotificationSnoozed(sbn: StatusBarNotification, hoursToSnooze: Int) {
|
||||
}
|
||||
|
||||
override fun getActiveNotificationsCount(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -1103,6 +1103,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
/** The click listener for the snooze button. */
|
||||
public View.OnClickListener getSnoozeClickListener(MenuItem item) {
|
||||
return v -> {
|
||||
// Dismiss a snoozed notification if one is still left behind
|
||||
mNotificationGutsManager.closeAndSaveGuts(true /* removeLeavebehind */,
|
||||
false /* force */, false /* removeControls */, -1 /* x */, -1 /* y */,
|
||||
false /* resetMenu */);
|
||||
mNotificationGutsManager.openGuts(this, 0, 0, item);
|
||||
mSnoozedMenuItems = mMenuRow.getMenuItems(mMenuRow.getMenuView().getContext());
|
||||
mMenuRow.resetMenu();
|
||||
|
||||
@@ -114,7 +114,6 @@ public class NotificationConversationInfo extends LinearLayout implements
|
||||
private @Action int mSelectedAction = -1;
|
||||
private boolean mPressedApply;
|
||||
|
||||
private OnSnoozeClickListener mOnSnoozeClickListener;
|
||||
private OnSettingsClickListener mOnSettingsClickListener;
|
||||
private NotificationGuts mGutsContainer;
|
||||
private OnConversationSettingsClickListener mOnConversationSettingsClickListener;
|
||||
@@ -134,22 +133,6 @@ public class NotificationConversationInfo extends LinearLayout implements
|
||||
static final int ACTION_MUTE = 4;
|
||||
static final int ACTION_SETTINGS = 5;
|
||||
|
||||
// TODO: b/152050825
|
||||
/*
|
||||
private OnClickListener mOnHomeClick = v -> {
|
||||
mSelectedAction = ACTION_HOME;
|
||||
mShortcutManager.requestPinShortcut(mShortcutInfo, null);
|
||||
mShadeController.animateCollapsePanels();
|
||||
mGutsContainer.closeControls(v, true);
|
||||
};
|
||||
|
||||
private OnClickListener mOnSnoozeClick = v -> {
|
||||
mSelectedAction = ACTION_SNOOZE;
|
||||
mOnSnoozeClickListener.onClick(v, 1);
|
||||
mGutsContainer.closeControls(v, true);
|
||||
};
|
||||
*/
|
||||
|
||||
private OnClickListener mOnFavoriteClick = v -> {
|
||||
setSelectedAction(ACTION_FAVORITE);
|
||||
updateToggleActions(mSelectedAction, true);
|
||||
@@ -193,10 +176,6 @@ public class NotificationConversationInfo extends LinearLayout implements
|
||||
void onClick(View v, Intent intent);
|
||||
}
|
||||
|
||||
public interface OnSnoozeClickListener {
|
||||
void onClick(View v, int hoursToSnooze);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void setSelectedAction(int selectedAction) {
|
||||
if (mSelectedAction == selectedAction) {
|
||||
@@ -218,7 +197,6 @@ public class NotificationConversationInfo extends LinearLayout implements
|
||||
NotificationEntry entry,
|
||||
Notification.BubbleMetadata bubbleMetadata,
|
||||
OnSettingsClickListener onSettingsClick,
|
||||
OnSnoozeClickListener onSnoozeClickListener,
|
||||
ConversationIconFactory conversationIconFactory,
|
||||
Context userContext,
|
||||
boolean isDeviceProvisioned,
|
||||
@@ -242,7 +220,6 @@ public class NotificationConversationInfo extends LinearLayout implements
|
||||
mAppUid = mSbn.getUid();
|
||||
mDelegatePkg = mSbn.getOpPkg();
|
||||
mIsDeviceProvisioned = isDeviceProvisioned;
|
||||
mOnSnoozeClickListener = onSnoozeClickListener;
|
||||
mOnConversationSettingsClickListener = onConversationSettingsClickListener;
|
||||
mIconFactory = conversationIconFactory;
|
||||
mUserContext = userContext;
|
||||
|
||||
@@ -76,8 +76,6 @@ import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.inject.Provider;
|
||||
|
||||
import dagger.Lazy;
|
||||
|
||||
/**
|
||||
@@ -460,11 +458,6 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
||||
row);
|
||||
};
|
||||
|
||||
final NotificationConversationInfo.OnSnoozeClickListener onSnoozeClickListener =
|
||||
(View v, int hours) -> {
|
||||
mListContainer.getSwipeActionHelper().snooze(sbn, hours);
|
||||
};
|
||||
|
||||
final NotificationConversationInfo.OnConversationSettingsClickListener
|
||||
onConversationSettingsListener =
|
||||
() -> {
|
||||
@@ -497,7 +490,6 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
||||
entry,
|
||||
entry.getBubbleMetadata(),
|
||||
onSettingsClick,
|
||||
onSnoozeClickListener,
|
||||
iconFactoryLoader,
|
||||
mContextTracker.getUserContext(),
|
||||
mDeviceProvisionedController.isDeviceProvisioned(),
|
||||
|
||||
@@ -376,11 +376,6 @@ public class NotificationStackScrollLayoutController {
|
||||
mStatusBar.setNotificationSnoozed(sbn, snoozeOption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSnooze(StatusBarNotification sbn, int hours) {
|
||||
mStatusBar.setNotificationSnoozed(sbn, hours);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldDismissQuickly() {
|
||||
return mView.isExpanded() && mView.isFullyAwake();
|
||||
|
||||
@@ -300,11 +300,6 @@ class NotificationSwipeHelper extends SwipeHelper implements NotificationSwipeAc
|
||||
mCallback.onSnooze(sbn, snoozeOption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void snooze(StatusBarNotification sbn, int hours) {
|
||||
mCallback.onSnooze(sbn, hours);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
protected void handleMenuCoveredOrDismissed() {
|
||||
View exposedMenuView = getExposedMenuView();
|
||||
@@ -470,8 +465,6 @@ class NotificationSwipeHelper extends SwipeHelper implements NotificationSwipeAc
|
||||
|
||||
void onSnooze(StatusBarNotification sbn, SnoozeOption snoozeOption);
|
||||
|
||||
void onSnooze(StatusBarNotification sbn, int hours);
|
||||
|
||||
void onDismiss();
|
||||
}
|
||||
|
||||
|
||||
@@ -4431,10 +4431,6 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
mNotificationsController.setNotificationSnoozed(sbn, snoozeOption);
|
||||
}
|
||||
|
||||
public void setNotificationSnoozed(StatusBarNotification sbn, int hoursToSnooze) {
|
||||
mNotificationsController.setNotificationSnoozed(sbn, hoursToSnooze);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleSplitScreen() {
|
||||
toggleSplitScreenMode(-1 /* metricsDockAction */, -1 /* metricsUndockAction */);
|
||||
|
||||
@@ -36,7 +36,6 @@ import static junit.framework.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.any;
|
||||
import static org.mockito.Mockito.anyInt;
|
||||
import static org.mockito.Mockito.anyString;
|
||||
import static org.mockito.Mockito.atLeastOnce;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -74,7 +73,6 @@ import android.widget.TextView;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.settingslib.notification.ConversationIconFactory;
|
||||
import com.android.systemui.Prefs;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.people.widget.PeopleSpaceWidgetManager;
|
||||
@@ -89,7 +87,6 @@ import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Answers;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
@@ -102,8 +99,6 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import javax.inject.Provider;
|
||||
|
||||
@SmallTest
|
||||
@RunWith(AndroidTestingRunner.class)
|
||||
@TestableLooper.RunWithLooper
|
||||
@@ -252,7 +247,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -278,7 +272,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -332,7 +325,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -359,7 +351,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -385,7 +376,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -422,7 +412,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
entry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -452,7 +441,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
assertEquals(mConversationChannel, c);
|
||||
latch.countDown();
|
||||
},
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -480,7 +468,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -509,7 +496,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
assertEquals(mNotificationChannel, c);
|
||||
latch.countDown();
|
||||
},
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
false,
|
||||
@@ -536,7 +522,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -566,7 +551,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -599,7 +583,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -638,7 +621,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -668,7 +650,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -705,7 +686,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -735,7 +715,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -781,7 +760,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -826,7 +804,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -872,7 +849,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -911,7 +887,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -949,7 +924,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -991,7 +965,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -1023,7 +996,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -1054,7 +1026,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -1092,7 +1063,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -1130,7 +1100,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -1167,7 +1136,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -1203,7 +1171,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -1230,7 +1197,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -1258,7 +1224,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -1290,7 +1255,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
@@ -1326,7 +1290,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mEntry,
|
||||
mBubbleMetadata,
|
||||
null,
|
||||
null,
|
||||
mIconFactory,
|
||||
mContext,
|
||||
true,
|
||||
|
||||
Reference in New Issue
Block a user