From 82a05b63f767c67081b2e89c6bc226ea9965b955 Mon Sep 17 00:00:00 2001 From: Alison Cichowlas Date: Tue, 11 Mar 2025 11:35:31 -0700 Subject: Notifications: Inline demote item. Permission revocation as MenuItem, with undo flow. Separate flag from Guts/back of card implementation. Still icon-only. Text coming soon. Bug: 379186372 Test: atest SystemUiTests Flag: com.android.systemui.permission_helper_inline_ui_rich_ongoing Change-Id: Iac339601f74c950cffb66a8e64bc75cd23c5ad55 --- packages/SystemUI/aconfig/systemui.aconfig | 9 +- .../notification/row/NotificationMenuRowTest.java | 41 +---- packages/SystemUI/res/drawable/unpin_icon.xml | 10 ++ .../res/layout/promoted_permission_guts.xml | 73 +++++++++ packages/SystemUI/res/values/strings.xml | 6 + .../row/ExpandableNotificationRow.java | 36 ++++- .../notification/row/ExpandableOutlineView.java | 3 +- .../notification/row/NotificationGutsManager.java | 29 ++++ .../notification/row/NotificationMenuRow.java | 50 ++++-- .../notification/row/PromotedNotificationInfo.java | 1 + .../row/PromotedPermissionGutsContent.java | 173 +++++++++++++++++++++ .../stack/NotificationStackScrollLayout.java | 5 +- .../row/ExpandableNotificationRowTest.java | 2 +- 13 files changed, 377 insertions(+), 61 deletions(-) create mode 100644 packages/SystemUI/res/drawable/unpin_icon.xml create mode 100644 packages/SystemUI/res/layout/promoted_permission_guts.xml create mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PromotedPermissionGutsContent.java diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig index ab18612355f0..0fd54610974a 100644 --- a/packages/SystemUI/aconfig/systemui.aconfig +++ b/packages/SystemUI/aconfig/systemui.aconfig @@ -2033,7 +2033,14 @@ flag { flag { name: "permission_helper_ui_rich_ongoing" namespace: "systemui" - description: "[RONs] Guards inline permission helper for demoting RONs" + description: "[RONs] Guards inline permission helper for demoting RONs [Guts/card version]" + bug: "379186372" +} + +flag { + name: "permission_helper_inline_ui_rich_ongoing" + namespace: "systemui" + description: "[RONs] Guards inline permission helper for demoting RONs [Inline version]" bug: "379186372" } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java index 9fdfca14a5b2..4a262b7a652a 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java @@ -96,46 +96,6 @@ public class NotificationMenuRowTest extends LeakCheckedTest { row.resetMenu(); } - - @Test - public void testNoAppOpsInSlowSwipe() { - when(mRow.getShowSnooze()).thenReturn(false); - Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0); - - NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier); - row.createMenu(mRow); - - ViewGroup container = (ViewGroup) row.getMenuView(); - // noti blocking - assertEquals(1, container.getChildCount()); - } - - @Test - public void testNoSnoozeInSlowSwipe() { - when(mRow.getShowSnooze()).thenReturn(false); - Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0); - - NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier); - row.createMenu(mRow); - - ViewGroup container = (ViewGroup) row.getMenuView(); - // just for noti blocking - assertEquals(1, container.getChildCount()); - } - - @Test - public void testSnoozeInSlowSwipe() { - when(mRow.getShowSnooze()).thenReturn(true); - Settings.Global.putInt(mContext.getContentResolver(), SHOW_NEW_NOTIF_DISMISS, 0); - - NotificationMenuRow row = new NotificationMenuRow(mContext, mPeopleNotificationIdentifier); - row.createMenu(mRow); - - ViewGroup container = (ViewGroup) row.getMenuView(); - // one for snooze and one for noti blocking - assertEquals(2, container.getChildCount()); - } - @Test public void testSlowSwipe_newDismiss() { when(mRow.getShowSnooze()).thenReturn(true); @@ -230,6 +190,7 @@ public class NotificationMenuRowTest extends LeakCheckedTest { new NotificationMenuRow(mContext, mPeopleNotificationIdentifier)); doReturn(30f).when(row).getSnapBackThreshold(); doReturn(50f).when(row).getDismissThreshold(); + doReturn(70).when(row).getSpaceForMenu(); when(row.isMenuOnLeft()).thenReturn(true); when(row.getTranslation()).thenReturn(40f); diff --git a/packages/SystemUI/res/drawable/unpin_icon.xml b/packages/SystemUI/res/drawable/unpin_icon.xml new file mode 100644 index 000000000000..4e2e15893884 --- /dev/null +++ b/packages/SystemUI/res/drawable/unpin_icon.xml @@ -0,0 +1,10 @@ + + + diff --git a/packages/SystemUI/res/layout/promoted_permission_guts.xml b/packages/SystemUI/res/layout/promoted_permission_guts.xml new file mode 100644 index 000000000000..50e5ae3c05ed --- /dev/null +++ b/packages/SystemUI/res/layout/promoted_permission_guts.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index fefc222f283f..a6b9bacd2562 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -4188,6 +4188,12 @@ All Quick Settings tiles will reset to the device’s original settings + + + + %1$s will no longer show Live Updates here. You can change this any time in Settings. + + %1$s, %2$s diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 76830646587d..70f4bd7b1073 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -2647,31 +2647,59 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } } + /** + * Whether to allow dismissal with the whole-row translation animation. + * + * If true, either animation is permissible. + * If false, usingRTX behavior is forbidden, only clipping animation should be used. + * + * Usually either is OK, except for promoted notifications, where we always need to + * dismiss with content clipping/partial translation animation instead, so that we + * can show the demotion options. + * @return + */ + private boolean allowDismissUsingRowTranslationX() { + if (Flags.permissionHelperInlineUiRichOngoing()) { + return !isPromotedOngoing(); + } else { + // Don't change behavior unless the flag is on. + return true; + } + } + /** * Set the dismiss behavior of the view. * * @param usingRowTranslationX {@code true} if the view should translate using regular * translationX, otherwise the contents will be * translated. + * @param forceUpdateChildren {@code true} to force initialization, {@code false} if lazy + * behavior is OK. */ @Override - public void setDismissUsingRowTranslationX(boolean usingRowTranslationX) { - if (usingRowTranslationX != mDismissUsingRowTranslationX) { + public void setDismissUsingRowTranslationX(boolean usingRowTranslationX, + boolean forceUpdateChildren) { + // Before updating dismiss behavior, make sure this is an allowable configuration for this + // notification. + usingRowTranslationX = usingRowTranslationX && allowDismissUsingRowTranslationX(); + + if (forceUpdateChildren || (usingRowTranslationX != mDismissUsingRowTranslationX)) { // In case we were already transitioning, let's switch over! float previousTranslation = getTranslation(); if (previousTranslation != 0) { setTranslation(0); } - super.setDismissUsingRowTranslationX(usingRowTranslationX); + super.setDismissUsingRowTranslationX(usingRowTranslationX, forceUpdateChildren); if (previousTranslation != 0) { setTranslation(previousTranslation); } + if (mChildrenContainer != null) { List notificationChildren = mChildrenContainer.getAttachedChildren(); for (int i = 0; i < notificationChildren.size(); i++) { ExpandableNotificationRow child = notificationChildren.get(i); - child.setDismissUsingRowTranslationX(usingRowTranslationX); + child.setDismissUsingRowTranslationX(usingRowTranslationX, forceUpdateChildren); } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java index 80cf818e985f..6c990df5d05e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java @@ -292,7 +292,8 @@ public abstract class ExpandableOutlineView extends ExpandableView { * translationX, otherwise the contents will be * translated. */ - public void setDismissUsingRowTranslationX(boolean usingRowTranslationX) { + public void setDismissUsingRowTranslationX(boolean usingRowTranslationX, + boolean forceUpdateChildren) { mDismissUsingRowTranslationX = usingRowTranslationX; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java index caa1d28cc914..6675ccc81dcd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java @@ -29,6 +29,7 @@ import android.content.pm.ShortcutManager; import android.net.Uri; import android.os.Bundle; import android.os.Handler; +import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; @@ -324,6 +325,7 @@ public class NotificationGutsManager implements NotifGutsViewManager, CoreStarta }); View gutsView = item.getGutsView(); + try { if (gutsView instanceof NotificationSnooze) { initializeSnoozeView(row, (NotificationSnooze) gutsView); @@ -337,6 +339,8 @@ public class NotificationGutsManager implements NotifGutsViewManager, CoreStarta (PartialConversationInfo) gutsView); } else if (gutsView instanceof FeedbackInfo) { initializeFeedbackInfo(row, (FeedbackInfo) gutsView); + } else if (gutsView instanceof PromotedPermissionGutsContent) { + initializeDemoteView(row, (PromotedPermissionGutsContent) gutsView); } return true; } catch (Exception e) { @@ -365,6 +369,31 @@ public class NotificationGutsManager implements NotifGutsViewManager, CoreStarta }); } + /** + * Sets up the {@link NotificationSnooze} inside the notification row's guts. + * + * @param row view to set up the guts for + * @param demoteGuts view to set up/bind within {@code row} + */ + private void initializeDemoteView( + final ExpandableNotificationRow row, + PromotedPermissionGutsContent demoteGuts) { + StatusBarNotification sbn = row.getEntry().getSbn(); + demoteGuts.setStatusBarNotification(sbn); + demoteGuts.setOnDemoteAction(new View.OnClickListener() { + @Override + public void onClick(View v) { + try { + // TODO(b/391661009): Signal AutomaticPromotionCoordinator here + mNotificationManager.setCanBePromoted( + sbn.getPackageName(), sbn.getUid(), false, true); + } catch (RemoteException e) { + Log.e(TAG, "Couldn't revoke live update permission", e); + } + } + }); + } + /** * Sets up the {@link FeedbackInfo} inside the notification row's guts. * diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationMenuRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationMenuRow.java index e89a76fd5a69..de31b42cedc0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationMenuRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationMenuRow.java @@ -268,6 +268,7 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl } else if (personNotifType >= PeopleNotificationIdentifier.TYPE_FULL_PERSON) { mInfoItem = createConversationItem(mContext); } else if (android.app.Flags.uiRichOngoing() + && android.app.Flags.apiRichOngoing() && Flags.permissionHelperUiRichOngoing() && entry.getSbn().getNotification().isPromotedOngoing()) { mInfoItem = createPromotedItem(mContext); @@ -280,6 +281,12 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl } mRightMenuItems.add(mInfoItem); mRightMenuItems.add(mFeedbackItem); + if (android.app.Flags.uiRichOngoing() && Flags.permissionHelperInlineUiRichOngoing() + && entry.isPromotedOngoing()) { + mRightMenuItems.add(createDemoteItem(mContext)); + } + + mLeftMenuItems.addAll(mRightMenuItems); populateMenuViews(); @@ -301,15 +308,19 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl } else { mMenuContainer = new FrameLayout(mContext); } + final int showDismissSetting = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.SHOW_NEW_NOTIF_DISMISS, /* default = */ 1); final boolean newFlowHideShelf = showDismissSetting == 1; - if (newFlowHideShelf) { - return; - } - List menuItems = mOnLeft ? mLeftMenuItems : mRightMenuItems; - for (int i = 0; i < menuItems.size(); i++) { - addMenuView(menuItems.get(i), mMenuContainer); + + // Populate menu items if we are using the new permission helper (U+) or if we are using + // the very old dismiss setting (SC-). + // TODO: SHOW_NEW_NOTIF_DISMISS==0 case can likely be removed. + if (Flags.permissionHelperInlineUiRichOngoing() || !newFlowHideShelf) { + List menuItems = mOnLeft ? mLeftMenuItems : mRightMenuItems; + for (int i = 0; i < menuItems.size(); i++) { + addMenuView(menuItems.get(i), mMenuContainer); + } } } @@ -673,6 +684,15 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl return snooze; } + static MenuItem createDemoteItem(Context context) { + PromotedPermissionGutsContent demoteContent = + (PromotedPermissionGutsContent) LayoutInflater.from(context).inflate( + R.layout.promoted_permission_guts, null, false); + MenuItem info = new NotificationMenuItem(context, null, demoteContent, + R.drawable.unpin_icon); + return info; + } + static NotificationMenuItem createConversationItem(Context context) { Resources res = context.getResources(); String infoDescription = res.getString(R.string.notification_menu_gear_description); @@ -680,7 +700,7 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl (NotificationConversationInfo) LayoutInflater.from(context).inflate( R.layout.notification_conversation_info, null, false); return new NotificationMenuItem(context, infoDescription, infoContent, - R.drawable.ic_settings); + NotificationMenuItem.OMIT_FROM_SWIPE_MENU); } static NotificationMenuItem createPromotedItem(Context context) { @@ -690,7 +710,7 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl (PromotedNotificationInfo) LayoutInflater.from(context).inflate( R.layout.promoted_notification_info, null, false); return new NotificationMenuItem(context, infoDescription, infoContent, - R.drawable.ic_settings); + NotificationMenuItem.OMIT_FROM_SWIPE_MENU); } static NotificationMenuItem createPartialConversationItem(Context context) { @@ -700,7 +720,7 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl (PartialConversationInfo) LayoutInflater.from(context).inflate( R.layout.partial_conversation_info, null, false); return new NotificationMenuItem(context, infoDescription, infoContent, - R.drawable.ic_settings); + NotificationMenuItem.OMIT_FROM_SWIPE_MENU); } static NotificationMenuItem createInfoItem(Context context) { @@ -712,14 +732,14 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl NotificationInfo infoContent = (NotificationInfo) LayoutInflater.from(context).inflate( layoutId, null, false); return new NotificationMenuItem(context, infoDescription, infoContent, - R.drawable.ic_settings); + NotificationMenuItem.OMIT_FROM_SWIPE_MENU); } static MenuItem createFeedbackItem(Context context) { FeedbackInfo feedbackContent = (FeedbackInfo) LayoutInflater.from(context).inflate( R.layout.feedback_info, null, false); MenuItem info = new NotificationMenuItem(context, null, feedbackContent, - -1 /*don't show in slow swipe menu */); + NotificationMenuItem.OMIT_FROM_SWIPE_MENU); return info; } @@ -756,6 +776,10 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl @Override public boolean isWithinSnapMenuThreshold() { + if (getSpaceForMenu() == 0) { + // don't snap open if there are no items + return false; + } float translation = getTranslation(); float snapBackThreshold = getSnapBackThreshold(); float targetRight = getDismissThreshold(); @@ -797,6 +821,10 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl } public static class NotificationMenuItem implements MenuItem { + + // Constant signaling that this MenuItem should not appear in slow swipe. + public static final int OMIT_FROM_SWIPE_MENU = -1; + View mMenuView; GutsContent mGutsContent; String mContentDescription; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PromotedNotificationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PromotedNotificationInfo.java index 01ee788f7fd7..769f0b5a4fa4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PromotedNotificationInfo.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PromotedNotificationInfo.java @@ -80,6 +80,7 @@ public class PromotedNotificationInfo extends NotificationInfo { assistantFeedbackController, metricsLogger, onCloseClick); mNotificationManager = iNotificationManager; + mPackageDemotionInteractor = packageDemotionInteractor; bindDemote(entry.getSbn(), pkg); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PromotedPermissionGutsContent.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PromotedPermissionGutsContent.java new file mode 100644 index 000000000000..222a1f4d8adf --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PromotedPermissionGutsContent.java @@ -0,0 +1,173 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui.statusbar.notification.row; + +import android.content.Context; +import android.os.Bundle; +import android.service.notification.StatusBarNotification; +import android.util.AttributeSet; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.android.internal.logging.MetricsLogger; +import com.android.systemui.res.R; + +/** + * This GutsContent shows an explanatory interstitial telling the user they've just revoked this + * app's permission to post Promoted/Live notifications. + * If the guts are dismissed without further action, the revocation is committed. + * If the user hits undo, the permission is not revoked. + */ +public class PromotedPermissionGutsContent extends LinearLayout + implements NotificationGuts.GutsContent, View.OnClickListener { + + private static final String TAG = "SnoozyPromotedGuts"; + + private NotificationGuts mGutsContainer; + private StatusBarNotification mSbn; + + private TextView mUndoButton; + + private MetricsLogger mMetricsLogger = new MetricsLogger(); + private OnClickListener mDemoteAction; + + public PromotedPermissionGutsContent(Context context, AttributeSet attrs) { + super(context, attrs); + } + + + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + mUndoButton = (TextView) findViewById(R.id.undo); + mUndoButton.setOnClickListener(this); + mUndoButton.setContentDescription( + getContext().getString(R.string.snooze_undo_content_description)); + + } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + dispatchConfigurationChanged(getResources().getConfiguration()); + } + + /** + * Update the content description of the snooze view based on the snooze option and whether the + * snooze options are expanded or not. + * For example, this will be something like "Collapsed\u2029Snooze for 1 hour". The paragraph + * separator is added to introduce a break in speech, to match what TalkBack does by default + * when you e.g. press on a notification. + */ + private void updateContentDescription() { + // + } + + + @Override + public boolean performAccessibilityActionInternal(int action, Bundle arguments) { + if (super.performAccessibilityActionInternal(action, arguments)) { + return true; + } + if (action == R.id.action_snooze_undo) { + undoDemote(mUndoButton); + return true; + } + return false; + } + + /** + * TODO docs + * @param sbn + */ + public void setStatusBarNotification(StatusBarNotification sbn) { + mSbn = sbn; + TextView demoteExplanation = (TextView) findViewById(R.id.demote_explain); + demoteExplanation.setText(mContext.getResources().getString(R.string.demote_explain_text, + mSbn.getPackageName())); + } + + @Override + public void onClick(View v) { + if (mGutsContainer != null) { + mGutsContainer.resetFalsingCheck(); + } + final int id = v.getId(); + if (id == R.id.undo) { + undoDemote(v); + } + + } + + private void undoDemote(View v) { + // Don't commit the demote action, instead log the undo and dismiss the view. + mGutsContainer.closeControls(v, /* save= */ false); + } + + @Override + public int getActualHeight() { + return getHeight(); + } + + @Override + public boolean willBeRemoved() { + return false; + } + + @Override + public View getContentView() { + return this; + } + + @Override + public void setGutsParent(NotificationGuts guts) { + mGutsContainer = guts; + } + + @Override + public boolean handleCloseControls(boolean save, boolean force) { + if (!save) { + // Undo changes and let the guts handle closing the view + return false; + } else { + // Commit demote action. + mDemoteAction.onClick(this); + return false; + } + } + + @Override + public boolean isLeavebehind() { + return true; + } + + @Override + public boolean shouldBeSavedOnClose() { + return true; + } + + @Override + public boolean needsFalsingProtection() { + return false; + } + + public void setOnDemoteAction(OnClickListener demoteAction) { + mDemoteAction = demoteAction; + } + +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index a5f711050c46..686add2c711c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -3220,8 +3220,7 @@ public class NotificationStackScrollLayout updateAnimationState(child); updateChronometerForChild(child); if (child instanceof ExpandableNotificationRow row) { - row.setDismissUsingRowTranslationX(mDismissUsingRowTranslationX); - + row.setDismissUsingRowTranslationX(mDismissUsingRowTranslationX, /* force= */ true); } } @@ -6157,7 +6156,7 @@ public class NotificationStackScrollLayout View child = getChildAt(i); if (child instanceof ExpandableNotificationRow) { ((ExpandableNotificationRow) child).setDismissUsingRowTranslationX( - dismissUsingRowTranslationX); + dismissUsingRowTranslationX, /* force= */ false); } } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java index 00ee893e0e4d..4cf56702ab15 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java @@ -581,7 +581,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { public void testIconScrollXAfterTranslationAndReset() throws Exception { ExpandableNotificationRow group = mNotificationTestHelper.createGroup(); - group.setDismissUsingRowTranslationX(false); + group.setDismissUsingRowTranslationX(false, false); group.setTranslation(50); assertEquals(50, -group.getEntry().getIcons().getShelfIcon().getScrollX()); -- cgit v1.2.3-59-g8ed1b