Merge "Remove notification actions when snoozed" into sc-dev

This commit is contained in:
Jay Aliomer
2021-05-20 18:34:24 +00:00
committed by Android (Google) Code Review

View File

@@ -134,6 +134,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
private boolean mUpdateBackgroundOnUpdate;
private boolean mNotificationTranslationFinished = false;
private ArrayList<MenuItem> mSnoozedMenuItems;
/**
* Listener for when {@link ExpandableNotificationRow} is laid out.
@@ -1103,6 +1104,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
public View.OnClickListener getSnoozeClickListener(MenuItem item) {
return v -> {
mNotificationGutsManager.openGuts(this, 0, 0, item);
mSnoozedMenuItems = mMenuRow.getMenuItems(mMenuRow.getMenuView().getContext());
mMenuRow.resetMenu();
};
}
@@ -1821,6 +1824,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
void onGutsClosed() {
updateContentAccessibilityImportanceForGuts(true /* isEnabled */);
if (mSnoozedMenuItems != null && mSnoozedMenuItems.size() > 0) {
mMenuRow.setMenuItems(mSnoozedMenuItems);
mSnoozedMenuItems = null;
}
}
/**