Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -280,6 +280,7 @@ public class NotificationGutsManager implements Dumpable { mCheckSaveListener, onSettingsClick, onAppSettingsClick, mPresenter.isDeviceProvisioned(), row.getIsNonblockable(), isForBlockingHelper, row.getEntry().userSentiment == USER_SENTIMENT_NEGATIVE); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java +7 −3 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G private StatusBarNotification mSbn; private AnimatorSet mExpandAnimation; private boolean mIsForeground; private boolean mIsDeviceProvisioned; private CheckSaveListener mCheckSaveListener; private OnSettingsClickListener mOnSettingsClickListener; Loading Loading @@ -143,12 +144,13 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G final CheckSaveListener checkSaveListener, final OnSettingsClickListener onSettingsClick, final OnAppSettingsClickListener onAppSettingsClick, boolean isDeviceProvisioned, boolean isNonblockable) throws RemoteException { bindNotification(pm, iNotificationManager, pkg, notificationChannel, numUniqueChannelsInRow, sbn, checkSaveListener, onSettingsClick, onAppSettingsClick, isNonblockable, false /* isBlockingHelper */, false /* isUserSentimentNegative */); onAppSettingsClick, isDeviceProvisioned, isNonblockable, false /* isBlockingHelper */, false /* isUserSentimentNegative */); } public void bindNotification( Loading @@ -161,6 +163,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G CheckSaveListener checkSaveListener, OnSettingsClickListener onSettingsClick, OnAppSettingsClickListener onAppSettingsClick, boolean isDeviceProvisioned, boolean isNonblockable, boolean isForBlockingHelper, boolean isUserSentimentNegative) Loading @@ -183,6 +186,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G (mSbn.getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE) != 0; mIsForBlockingHelper = isForBlockingHelper; mAppUid = mSbn.getUid(); mIsDeviceProvisioned = isDeviceProvisioned; int numTotalChannels = mINotificationManager.getNumNotificationChannelsForPackage( pkg, mAppUid, false /* includeDeleted */); Loading Loading @@ -246,7 +250,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G // Settings button. final View settingsButton = findViewById(R.id.info); if (mAppUid >= 0 && mOnSettingsClickListener != null) { if (mAppUid >= 0 && mOnSettingsClickListener != null && mIsDeviceProvisioned) { settingsButton.setVisibility(View.VISIBLE); final int appUidF = mAppUid; settingsButton.setOnClickListener( Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java +30 −0 Original line number Diff line number Diff line Loading @@ -286,6 +286,7 @@ public class NotificationGutsManagerTest extends SysuiTestCase { any(NotificationInfo.OnSettingsClickListener.class), any(NotificationInfo.OnAppSettingsClickListener.class), eq(false), eq(false), eq(true) /* isForBlockingHelper */, eq(true) /* isUserSentimentNegative */); } Loading @@ -312,6 +313,35 @@ public class NotificationGutsManagerTest extends SysuiTestCase { any(NotificationInfo.OnSettingsClickListener.class), any(NotificationInfo.OnAppSettingsClickListener.class), eq(false), eq(false), eq(false) /* isForBlockingHelper */, eq(true) /* isUserSentimentNegative */); } @Test public void testInitializeNotificationInfoView_PassesAlongProvisionedState() throws Exception { NotificationInfo notificationInfoView = mock(NotificationInfo.class); ExpandableNotificationRow row = spy(mHelper.createRow()); row.setBlockingHelperShowing(false); row.getEntry().userSentiment = USER_SENTIMENT_NEGATIVE; when(row.getIsNonblockable()).thenReturn(false); StatusBarNotification statusBarNotification = row.getStatusBarNotification(); when(mPresenter.isDeviceProvisioned()).thenReturn(true); mGutsManager.initializeNotificationInfo(row, notificationInfoView); verify(notificationInfoView).bindNotification( any(PackageManager.class), any(INotificationManager.class), eq(statusBarNotification.getPackageName()), any(NotificationChannel.class), anyInt(), eq(statusBarNotification), any(NotificationInfo.CheckSaveListener.class), any(NotificationInfo.OnSettingsClickListener.class), any(NotificationInfo.OnAppSettingsClickListener.class), eq(true), eq(false), eq(false) /* isForBlockingHelper */, eq(true) /* isUserSentimentNegative */); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java +69 −51 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -280,6 +280,7 @@ public class NotificationGutsManager implements Dumpable { mCheckSaveListener, onSettingsClick, onAppSettingsClick, mPresenter.isDeviceProvisioned(), row.getIsNonblockable(), isForBlockingHelper, row.getEntry().userSentiment == USER_SENTIMENT_NEGATIVE); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java +7 −3 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G private StatusBarNotification mSbn; private AnimatorSet mExpandAnimation; private boolean mIsForeground; private boolean mIsDeviceProvisioned; private CheckSaveListener mCheckSaveListener; private OnSettingsClickListener mOnSettingsClickListener; Loading Loading @@ -143,12 +144,13 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G final CheckSaveListener checkSaveListener, final OnSettingsClickListener onSettingsClick, final OnAppSettingsClickListener onAppSettingsClick, boolean isDeviceProvisioned, boolean isNonblockable) throws RemoteException { bindNotification(pm, iNotificationManager, pkg, notificationChannel, numUniqueChannelsInRow, sbn, checkSaveListener, onSettingsClick, onAppSettingsClick, isNonblockable, false /* isBlockingHelper */, false /* isUserSentimentNegative */); onAppSettingsClick, isDeviceProvisioned, isNonblockable, false /* isBlockingHelper */, false /* isUserSentimentNegative */); } public void bindNotification( Loading @@ -161,6 +163,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G CheckSaveListener checkSaveListener, OnSettingsClickListener onSettingsClick, OnAppSettingsClickListener onAppSettingsClick, boolean isDeviceProvisioned, boolean isNonblockable, boolean isForBlockingHelper, boolean isUserSentimentNegative) Loading @@ -183,6 +186,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G (mSbn.getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE) != 0; mIsForBlockingHelper = isForBlockingHelper; mAppUid = mSbn.getUid(); mIsDeviceProvisioned = isDeviceProvisioned; int numTotalChannels = mINotificationManager.getNumNotificationChannelsForPackage( pkg, mAppUid, false /* includeDeleted */); Loading Loading @@ -246,7 +250,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G // Settings button. final View settingsButton = findViewById(R.id.info); if (mAppUid >= 0 && mOnSettingsClickListener != null) { if (mAppUid >= 0 && mOnSettingsClickListener != null && mIsDeviceProvisioned) { settingsButton.setVisibility(View.VISIBLE); final int appUidF = mAppUid; settingsButton.setOnClickListener( Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java +30 −0 Original line number Diff line number Diff line Loading @@ -286,6 +286,7 @@ public class NotificationGutsManagerTest extends SysuiTestCase { any(NotificationInfo.OnSettingsClickListener.class), any(NotificationInfo.OnAppSettingsClickListener.class), eq(false), eq(false), eq(true) /* isForBlockingHelper */, eq(true) /* isUserSentimentNegative */); } Loading @@ -312,6 +313,35 @@ public class NotificationGutsManagerTest extends SysuiTestCase { any(NotificationInfo.OnSettingsClickListener.class), any(NotificationInfo.OnAppSettingsClickListener.class), eq(false), eq(false), eq(false) /* isForBlockingHelper */, eq(true) /* isUserSentimentNegative */); } @Test public void testInitializeNotificationInfoView_PassesAlongProvisionedState() throws Exception { NotificationInfo notificationInfoView = mock(NotificationInfo.class); ExpandableNotificationRow row = spy(mHelper.createRow()); row.setBlockingHelperShowing(false); row.getEntry().userSentiment = USER_SENTIMENT_NEGATIVE; when(row.getIsNonblockable()).thenReturn(false); StatusBarNotification statusBarNotification = row.getStatusBarNotification(); when(mPresenter.isDeviceProvisioned()).thenReturn(true); mGutsManager.initializeNotificationInfo(row, notificationInfoView); verify(notificationInfoView).bindNotification( any(PackageManager.class), any(INotificationManager.class), eq(statusBarNotification.getPackageName()), any(NotificationChannel.class), anyInt(), eq(statusBarNotification), any(NotificationInfo.CheckSaveListener.class), any(NotificationInfo.OnSettingsClickListener.class), any(NotificationInfo.OnAppSettingsClickListener.class), eq(true), eq(false), eq(false) /* isForBlockingHelper */, eq(true) /* isUserSentimentNegative */); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java +69 −51 File changed.Preview size limit exceeded, changes collapsed. Show changes