Loading core/java/com/android/internal/statusbar/IStatusBarService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ interface IStatusBarService int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv); void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys, in NotificationVisibility[] noLongerVisibleKeys); void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded); void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded, in int notificationLocation); void onNotificationDirectReplied(String key); void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount, boolean generatedByAsssistant); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java +4 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.statusbar.notification.stack.ExpandableViewState; import com.android.systemui.UiOffloadThread; import com.android.systemui.statusbar.NotificationListener; import com.android.systemui.statusbar.StatusBarStateController; Loading Loading @@ -460,7 +461,9 @@ public class NotificationLogger implements StateListener { mUiOffloadThread.submit(() -> { try { mBarService.onNotificationExpansionChanged( key, stateToBeLogged.mIsUserAction, stateToBeLogged.mIsExpanded); key, stateToBeLogged.mIsUserAction, stateToBeLogged.mIsExpanded, // TODO (b/120767764): fill in location ExpandableViewState.LOCATION_UNKNOWN /* notificationLocation */); } catch (RemoteException e) { Log.e(TAG, "Failed to call onNotificationExpansionChanged: ", e); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java +9 −7 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.notification.logging; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; Loading @@ -27,6 +28,7 @@ import android.testing.TestableLooper; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.statusbar.notification.stack.ExpandableViewState; import com.android.systemui.Dependency; import com.android.systemui.SysuiTestCase; import com.android.systemui.UiOffloadThread; Loading Loading @@ -66,7 +68,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService, Mockito.never()).onNotificationExpansionChanged( eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean()); eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean(), anyInt()); } @Test Loading @@ -75,7 +77,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService, Mockito.never()).onNotificationExpansionChanged( eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean()); eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean(), anyInt()); } @Test Loading @@ -87,7 +89,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService, Mockito.never()).onNotificationExpansionChanged( eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean()); eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean(), anyInt()); } @Test Loading @@ -99,7 +101,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService).onNotificationExpansionChanged( NOTIFICATION_KEY, true, true); NOTIFICATION_KEY, true, true, ExpandableViewState.LOCATION_UNKNOWN); } @Test Loading @@ -111,7 +113,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService).onNotificationExpansionChanged( NOTIFICATION_KEY, false, true); NOTIFICATION_KEY, false, true, ExpandableViewState.LOCATION_UNKNOWN); } @Test Loading @@ -123,7 +125,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService).onNotificationExpansionChanged( NOTIFICATION_KEY, false, true); NOTIFICATION_KEY, false, true, ExpandableViewState.LOCATION_UNKNOWN); } @Test Loading @@ -136,7 +138,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService).onNotificationExpansionChanged( NOTIFICATION_KEY, false, true); NOTIFICATION_KEY, false, true, ExpandableViewState.LOCATION_UNKNOWN); } private NotificationVisibility createNotificationVisibility(String key, boolean visibility) { Loading services/core/java/com/android/server/notification/NotificationDelegate.java +2 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,8 @@ public interface NotificationDelegate { void onNotificationVisibilityChanged( NotificationVisibility[] newlyVisibleKeys, NotificationVisibility[] noLongerVisibleKeys); void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded); void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded, int notificationLocation); void onNotificationDirectReplied(String key); void onNotificationSettingsViewed(String key); Loading services/core/java/com/android/server/notification/NotificationManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -868,7 +868,7 @@ public class NotificationManagerService extends SystemService { @Override public void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded) { boolean userAction, boolean expanded, int notificationLocation) { synchronized (mNotificationLock) { NotificationRecord r = mNotificationsByKey.get(key); if (r != null) { Loading Loading
core/java/com/android/internal/statusbar/IStatusBarService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ interface IStatusBarService int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv); void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys, in NotificationVisibility[] noLongerVisibleKeys); void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded); void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded, in int notificationLocation); void onNotificationDirectReplied(String key); void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount, boolean generatedByAsssistant); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java +4 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.statusbar.notification.stack.ExpandableViewState; import com.android.systemui.UiOffloadThread; import com.android.systemui.statusbar.NotificationListener; import com.android.systemui.statusbar.StatusBarStateController; Loading Loading @@ -460,7 +461,9 @@ public class NotificationLogger implements StateListener { mUiOffloadThread.submit(() -> { try { mBarService.onNotificationExpansionChanged( key, stateToBeLogged.mIsUserAction, stateToBeLogged.mIsExpanded); key, stateToBeLogged.mIsUserAction, stateToBeLogged.mIsExpanded, // TODO (b/120767764): fill in location ExpandableViewState.LOCATION_UNKNOWN /* notificationLocation */); } catch (RemoteException e) { Log.e(TAG, "Failed to call onNotificationExpansionChanged: ", e); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java +9 −7 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.notification.logging; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; Loading @@ -27,6 +28,7 @@ import android.testing.TestableLooper; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.statusbar.notification.stack.ExpandableViewState; import com.android.systemui.Dependency; import com.android.systemui.SysuiTestCase; import com.android.systemui.UiOffloadThread; Loading Loading @@ -66,7 +68,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService, Mockito.never()).onNotificationExpansionChanged( eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean()); eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean(), anyInt()); } @Test Loading @@ -75,7 +77,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService, Mockito.never()).onNotificationExpansionChanged( eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean()); eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean(), anyInt()); } @Test Loading @@ -87,7 +89,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService, Mockito.never()).onNotificationExpansionChanged( eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean()); eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean(), anyInt()); } @Test Loading @@ -99,7 +101,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService).onNotificationExpansionChanged( NOTIFICATION_KEY, true, true); NOTIFICATION_KEY, true, true, ExpandableViewState.LOCATION_UNKNOWN); } @Test Loading @@ -111,7 +113,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService).onNotificationExpansionChanged( NOTIFICATION_KEY, false, true); NOTIFICATION_KEY, false, true, ExpandableViewState.LOCATION_UNKNOWN); } @Test Loading @@ -123,7 +125,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService).onNotificationExpansionChanged( NOTIFICATION_KEY, false, true); NOTIFICATION_KEY, false, true, ExpandableViewState.LOCATION_UNKNOWN); } @Test Loading @@ -136,7 +138,7 @@ public class ExpansionStateLoggerTest extends SysuiTestCase { waitForUiOffloadThread(); verify(mBarService).onNotificationExpansionChanged( NOTIFICATION_KEY, false, true); NOTIFICATION_KEY, false, true, ExpandableViewState.LOCATION_UNKNOWN); } private NotificationVisibility createNotificationVisibility(String key, boolean visibility) { Loading
services/core/java/com/android/server/notification/NotificationDelegate.java +2 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,8 @@ public interface NotificationDelegate { void onNotificationVisibilityChanged( NotificationVisibility[] newlyVisibleKeys, NotificationVisibility[] noLongerVisibleKeys); void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded); void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded, int notificationLocation); void onNotificationDirectReplied(String key); void onNotificationSettingsViewed(String key); Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -868,7 +868,7 @@ public class NotificationManagerService extends SystemService { @Override public void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded) { boolean userAction, boolean expanded, int notificationLocation) { synchronized (mNotificationLock) { NotificationRecord r = mNotificationsByKey.get(key); if (r != null) { Loading