Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +21 −4 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.app.Notification.MessagingStyle.Message; import android.app.NotificationChannel; import android.app.NotificationManager.Policy; import android.app.Person; import android.app.RemoteInput; import android.app.RemoteInputHistoryItem; import android.content.Context; import android.content.pm.ShortcutInfo; Loading Loading @@ -69,6 +70,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableNotificationRowController; import com.android.systemui.statusbar.notification.row.NotificationGuts; import com.android.systemui.statusbar.notification.stack.PriorityBucket; import com.android.systemui.statusbar.phone.NotificationGroupManager; import java.util.ArrayList; import java.util.List; Loading Loading @@ -132,7 +134,7 @@ public final class NotificationEntry extends ListEntry { private ShortcutInfo mShortcutInfo; /** * If {@link android.app.RemoteInput#getEditChoicesBeforeSending} is enabled, and the user is * If {@link RemoteInput#getEditChoicesBeforeSending} is enabled, and the user is * currently editing a choice (smart reply), then this field contains the information about the * suggestion being edited. Otherwise <code>null</code>. */ Loading Loading @@ -174,6 +176,8 @@ public final class NotificationEntry extends ListEntry { private boolean mPulseSupressed; private boolean mAllowFgsDismissal; private int mBucket = BUCKET_ALERTING; @Nullable private Long mPendingAnimationDuration; private boolean mIsMarkedForUserTriggeredMovement; /** * @param sbn the StatusBarNotification from system server Loading @@ -193,7 +197,7 @@ public final class NotificationEntry extends ListEntry { boolean allowFgsDismissal, long creationTime ) { super(requireNonNull(Objects.requireNonNull(sbn).getKey())); super(requireNonNull(requireNonNull(sbn).getKey())); requireNonNull(ranking); Loading Loading @@ -441,7 +445,7 @@ public final class NotificationEntry extends ListEntry { * Get the children that are actually attached to this notification's row. * * TODO: Seems like most callers here should probably be using * {@link com.android.systemui.statusbar.phone.NotificationGroupManager#getChildren} * {@link NotificationGroupManager#getChildren} */ public @Nullable List<NotificationEntry> getAttachedNotifChildren() { if (row == null) { Loading Loading @@ -809,7 +813,7 @@ public final class NotificationEntry extends ListEntry { } if ((mSbn.getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) { & FLAG_FOREGROUND_SERVICE) != 0) { return true; } if (mSbn.getNotification().isMediaNotification()) { Loading Loading @@ -942,6 +946,19 @@ public final class NotificationEntry extends ListEntry { mPulseSupressed = suppressed; } /** Whether or not this entry has been marked for a user-triggered movement. */ public boolean isMarkedForUserTriggeredMovement() { return mIsMarkedForUserTriggeredMovement; } /** * Mark this entry for movement triggered by a user action (ex: changing the priorirty of a * conversation). This can then be used for custom animations. */ public void markForUserTriggeredMovement(boolean marked) { mIsMarkedForUserTriggeredMovement = marked; } /** Information about a suggestion that is being edited. */ public static class EditedSuggestionInfo { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java +3 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.view.accessibility.AccessibilityManager; import com.android.internal.logging.MetricsLogger; import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.plugins.statusbar.StatusBarStateController; Loading Loading @@ -105,6 +106,7 @@ public interface NotificationsModule { VisualStabilityManager visualStabilityManager, Lazy<StatusBar> statusBarLazy, @Main Handler mainHandler, @Background Handler bgHandler, AccessibilityManager accessibilityManager, HighPriorityProvider highPriorityProvider, INotificationManager notificationManager, Loading @@ -118,6 +120,7 @@ public interface NotificationsModule { visualStabilityManager, statusBarLazy, mainHandler, bgHandler, accessibilityManager, highPriorityProvider, notificationManager, Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java +18 −11 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.notification.row; import static android.app.Notification.EXTRA_IS_GROUP_CONVERSATION; import static android.app.NotificationManager.BUBBLE_PREFERENCE_ALL; import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE; import static android.app.NotificationManager.BUBBLE_PREFERENCE_SELECTED; Loading @@ -43,9 +42,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ShortcutInfo; import android.content.pm.ShortcutManager; import android.graphics.drawable.Icon; import android.os.Handler; import android.os.Parcelable; import android.os.RemoteException; import android.provider.Settings; import android.service.notification.StatusBarNotification; Loading @@ -65,15 +62,16 @@ import android.widget.TextView; import com.android.internal.annotations.VisibleForTesting; import com.android.settingslib.notification.ConversationIconFactory; import com.android.systemui.Dependency; import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.statusbar.notification.NotificationChannelHelper; import com.android.systemui.statusbar.notification.VisualStabilityManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import java.lang.annotation.Retention; import java.util.List; import javax.inject.Provider; Loading @@ -86,10 +84,12 @@ public class NotificationConversationInfo extends LinearLayout implements private INotificationManager mINotificationManager; ShortcutManager mShortcutManager; private ShortcutManager mShortcutManager; private PackageManager mPm; private ConversationIconFactory mIconFactory; private VisualStabilityManager mVisualStabilityManager; private Handler mMainHandler; private Handler mBgHandler; private String mPackageName; private String mAppName; Loading @@ -97,6 +97,7 @@ public class NotificationConversationInfo extends LinearLayout implements private String mDelegatePkg; private NotificationChannel mNotificationChannel; private ShortcutInfo mShortcutInfo; private NotificationEntry mEntry; private StatusBarNotification mSbn; @Nullable private Notification.BubbleMetadata mBubbleMetadata; private Context mUserContext; Loading Loading @@ -213,11 +214,14 @@ public class NotificationConversationInfo extends LinearLayout implements ConversationIconFactory conversationIconFactory, Context userContext, Provider<PriorityOnboardingDialogController.Builder> builderProvider, boolean isDeviceProvisioned) { boolean isDeviceProvisioned, @Main Handler mainHandler, @Background Handler bgHandler) { mSelectedAction = -1; mINotificationManager = iNotificationManager; mVisualStabilityManager = visualStabilityManager; mPackageName = pkg; mEntry = entry; mSbn = entry.getSbn(); mPm = pm; mAppName = mPackageName; Loading @@ -231,7 +235,8 @@ public class NotificationConversationInfo extends LinearLayout implements mUserContext = userContext; mBubbleMetadata = bubbleMetadata; mBuilderProvider = builderProvider; mMainHandler = mainHandler; mBgHandler = bgHandler; mShortcutManager = shortcutManager; mShortcutInfo = entry.getRanking().getShortcutInfo(); if (mShortcutInfo == null) { Loading Loading @@ -494,11 +499,13 @@ public class NotificationConversationInfo extends LinearLayout implements } private void updateChannel() { Handler bgHandler = new Handler(Dependency.get(Dependency.BG_LOOPER)); bgHandler.post( mBgHandler.post( new UpdateChannelRunnable(mINotificationManager, mPackageName, mAppUid, mSelectedAction, mNotificationChannel)); mMainHandler.postDelayed(() -> { mEntry.markForUserTriggeredMovement(true); mVisualStabilityManager.temporarilyAllowReordering(); }, StackStateAnimator.ANIMATION_DURATION_STANDARD); } private boolean shouldShowPriorityOnboarding() { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java +7 −2 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import com.android.settingslib.notification.ConversationIconFactory; import com.android.systemui.Dependency; import com.android.systemui.Dumpable; import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin; import com.android.systemui.plugins.statusbar.StatusBarStateController; Loading Loading @@ -111,6 +112,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx private final Lazy<StatusBar> mStatusBarLazy; private final Handler mMainHandler; private final Handler mBgHandler; private Runnable mOpenRunnable; private final INotificationManager mNotificationManager; private final LauncherApps mLauncherApps; Loading @@ -122,7 +124,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx * Injected constructor. See {@link NotificationsModule}. */ public NotificationGutsManager(Context context, VisualStabilityManager visualStabilityManager, Lazy<StatusBar> statusBarLazy, @Main Handler mainHandler, Lazy<StatusBar> statusBarLazy, @Main Handler mainHandler, @Background Handler bgHandler, AccessibilityManager accessibilityManager, HighPriorityProvider highPriorityProvider, INotificationManager notificationManager, Loading @@ -135,6 +137,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx mVisualStabilityManager = visualStabilityManager; mStatusBarLazy = statusBarLazy; mMainHandler = mainHandler; mBgHandler = bgHandler; mAccessibilityManager = accessibilityManager; mHighPriorityProvider = highPriorityProvider; mNotificationManager = notificationManager; Loading Loading @@ -463,7 +466,9 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx iconFactoryLoader, mContextTracker.getCurrentUserContext(), mBuilderProvider, mDeviceProvisionedController.isDeviceProvisioned()); mDeviceProvisionedController.isDeviceProvisioned(), mMainHandler, mBgHandler); } /** Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +13 −2 Original line number Diff line number Diff line Loading @@ -3655,8 +3655,19 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) private void generatePositionChangeEvents() { for (ExpandableView child : mChildrenChangingPositions) { mAnimationEvents.add(new AnimationEvent(child, AnimationEvent.ANIMATION_TYPE_CHANGE_POSITION)); Integer duration = null; if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; if (row.getEntry().isMarkedForUserTriggeredMovement()) { duration = StackStateAnimator.ANIMATION_DURATION_PRIORITY_CHANGE; row.getEntry().markForUserTriggeredMovement(false); } } AnimationEvent animEvent = duration == null ? new AnimationEvent(child, AnimationEvent.ANIMATION_TYPE_CHANGE_POSITION) : new AnimationEvent( child, AnimationEvent.ANIMATION_TYPE_CHANGE_POSITION, duration); mAnimationEvents.add(animEvent); } mChildrenChangingPositions.clear(); if (mGenerateChildOrderChangedEvent) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +21 −4 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.app.Notification.MessagingStyle.Message; import android.app.NotificationChannel; import android.app.NotificationManager.Policy; import android.app.Person; import android.app.RemoteInput; import android.app.RemoteInputHistoryItem; import android.content.Context; import android.content.pm.ShortcutInfo; Loading Loading @@ -69,6 +70,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableNotificationRowController; import com.android.systemui.statusbar.notification.row.NotificationGuts; import com.android.systemui.statusbar.notification.stack.PriorityBucket; import com.android.systemui.statusbar.phone.NotificationGroupManager; import java.util.ArrayList; import java.util.List; Loading Loading @@ -132,7 +134,7 @@ public final class NotificationEntry extends ListEntry { private ShortcutInfo mShortcutInfo; /** * If {@link android.app.RemoteInput#getEditChoicesBeforeSending} is enabled, and the user is * If {@link RemoteInput#getEditChoicesBeforeSending} is enabled, and the user is * currently editing a choice (smart reply), then this field contains the information about the * suggestion being edited. Otherwise <code>null</code>. */ Loading Loading @@ -174,6 +176,8 @@ public final class NotificationEntry extends ListEntry { private boolean mPulseSupressed; private boolean mAllowFgsDismissal; private int mBucket = BUCKET_ALERTING; @Nullable private Long mPendingAnimationDuration; private boolean mIsMarkedForUserTriggeredMovement; /** * @param sbn the StatusBarNotification from system server Loading @@ -193,7 +197,7 @@ public final class NotificationEntry extends ListEntry { boolean allowFgsDismissal, long creationTime ) { super(requireNonNull(Objects.requireNonNull(sbn).getKey())); super(requireNonNull(requireNonNull(sbn).getKey())); requireNonNull(ranking); Loading Loading @@ -441,7 +445,7 @@ public final class NotificationEntry extends ListEntry { * Get the children that are actually attached to this notification's row. * * TODO: Seems like most callers here should probably be using * {@link com.android.systemui.statusbar.phone.NotificationGroupManager#getChildren} * {@link NotificationGroupManager#getChildren} */ public @Nullable List<NotificationEntry> getAttachedNotifChildren() { if (row == null) { Loading Loading @@ -809,7 +813,7 @@ public final class NotificationEntry extends ListEntry { } if ((mSbn.getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) { & FLAG_FOREGROUND_SERVICE) != 0) { return true; } if (mSbn.getNotification().isMediaNotification()) { Loading Loading @@ -942,6 +946,19 @@ public final class NotificationEntry extends ListEntry { mPulseSupressed = suppressed; } /** Whether or not this entry has been marked for a user-triggered movement. */ public boolean isMarkedForUserTriggeredMovement() { return mIsMarkedForUserTriggeredMovement; } /** * Mark this entry for movement triggered by a user action (ex: changing the priorirty of a * conversation). This can then be used for custom animations. */ public void markForUserTriggeredMovement(boolean marked) { mIsMarkedForUserTriggeredMovement = marked; } /** Information about a suggestion that is being edited. */ public static class EditedSuggestionInfo { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java +3 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.view.accessibility.AccessibilityManager; import com.android.internal.logging.MetricsLogger; import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.plugins.statusbar.StatusBarStateController; Loading Loading @@ -105,6 +106,7 @@ public interface NotificationsModule { VisualStabilityManager visualStabilityManager, Lazy<StatusBar> statusBarLazy, @Main Handler mainHandler, @Background Handler bgHandler, AccessibilityManager accessibilityManager, HighPriorityProvider highPriorityProvider, INotificationManager notificationManager, Loading @@ -118,6 +120,7 @@ public interface NotificationsModule { visualStabilityManager, statusBarLazy, mainHandler, bgHandler, accessibilityManager, highPriorityProvider, notificationManager, Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java +18 −11 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.notification.row; import static android.app.Notification.EXTRA_IS_GROUP_CONVERSATION; import static android.app.NotificationManager.BUBBLE_PREFERENCE_ALL; import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE; import static android.app.NotificationManager.BUBBLE_PREFERENCE_SELECTED; Loading @@ -43,9 +42,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ShortcutInfo; import android.content.pm.ShortcutManager; import android.graphics.drawable.Icon; import android.os.Handler; import android.os.Parcelable; import android.os.RemoteException; import android.provider.Settings; import android.service.notification.StatusBarNotification; Loading @@ -65,15 +62,16 @@ import android.widget.TextView; import com.android.internal.annotations.VisibleForTesting; import com.android.settingslib.notification.ConversationIconFactory; import com.android.systemui.Dependency; import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.statusbar.notification.NotificationChannelHelper; import com.android.systemui.statusbar.notification.VisualStabilityManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import java.lang.annotation.Retention; import java.util.List; import javax.inject.Provider; Loading @@ -86,10 +84,12 @@ public class NotificationConversationInfo extends LinearLayout implements private INotificationManager mINotificationManager; ShortcutManager mShortcutManager; private ShortcutManager mShortcutManager; private PackageManager mPm; private ConversationIconFactory mIconFactory; private VisualStabilityManager mVisualStabilityManager; private Handler mMainHandler; private Handler mBgHandler; private String mPackageName; private String mAppName; Loading @@ -97,6 +97,7 @@ public class NotificationConversationInfo extends LinearLayout implements private String mDelegatePkg; private NotificationChannel mNotificationChannel; private ShortcutInfo mShortcutInfo; private NotificationEntry mEntry; private StatusBarNotification mSbn; @Nullable private Notification.BubbleMetadata mBubbleMetadata; private Context mUserContext; Loading Loading @@ -213,11 +214,14 @@ public class NotificationConversationInfo extends LinearLayout implements ConversationIconFactory conversationIconFactory, Context userContext, Provider<PriorityOnboardingDialogController.Builder> builderProvider, boolean isDeviceProvisioned) { boolean isDeviceProvisioned, @Main Handler mainHandler, @Background Handler bgHandler) { mSelectedAction = -1; mINotificationManager = iNotificationManager; mVisualStabilityManager = visualStabilityManager; mPackageName = pkg; mEntry = entry; mSbn = entry.getSbn(); mPm = pm; mAppName = mPackageName; Loading @@ -231,7 +235,8 @@ public class NotificationConversationInfo extends LinearLayout implements mUserContext = userContext; mBubbleMetadata = bubbleMetadata; mBuilderProvider = builderProvider; mMainHandler = mainHandler; mBgHandler = bgHandler; mShortcutManager = shortcutManager; mShortcutInfo = entry.getRanking().getShortcutInfo(); if (mShortcutInfo == null) { Loading Loading @@ -494,11 +499,13 @@ public class NotificationConversationInfo extends LinearLayout implements } private void updateChannel() { Handler bgHandler = new Handler(Dependency.get(Dependency.BG_LOOPER)); bgHandler.post( mBgHandler.post( new UpdateChannelRunnable(mINotificationManager, mPackageName, mAppUid, mSelectedAction, mNotificationChannel)); mMainHandler.postDelayed(() -> { mEntry.markForUserTriggeredMovement(true); mVisualStabilityManager.temporarilyAllowReordering(); }, StackStateAnimator.ANIMATION_DURATION_STANDARD); } private boolean shouldShowPriorityOnboarding() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java +7 −2 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import com.android.settingslib.notification.ConversationIconFactory; import com.android.systemui.Dependency; import com.android.systemui.Dumpable; import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin; import com.android.systemui.plugins.statusbar.StatusBarStateController; Loading Loading @@ -111,6 +112,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx private final Lazy<StatusBar> mStatusBarLazy; private final Handler mMainHandler; private final Handler mBgHandler; private Runnable mOpenRunnable; private final INotificationManager mNotificationManager; private final LauncherApps mLauncherApps; Loading @@ -122,7 +124,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx * Injected constructor. See {@link NotificationsModule}. */ public NotificationGutsManager(Context context, VisualStabilityManager visualStabilityManager, Lazy<StatusBar> statusBarLazy, @Main Handler mainHandler, Lazy<StatusBar> statusBarLazy, @Main Handler mainHandler, @Background Handler bgHandler, AccessibilityManager accessibilityManager, HighPriorityProvider highPriorityProvider, INotificationManager notificationManager, Loading @@ -135,6 +137,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx mVisualStabilityManager = visualStabilityManager; mStatusBarLazy = statusBarLazy; mMainHandler = mainHandler; mBgHandler = bgHandler; mAccessibilityManager = accessibilityManager; mHighPriorityProvider = highPriorityProvider; mNotificationManager = notificationManager; Loading Loading @@ -463,7 +466,9 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx iconFactoryLoader, mContextTracker.getCurrentUserContext(), mBuilderProvider, mDeviceProvisionedController.isDeviceProvisioned()); mDeviceProvisionedController.isDeviceProvisioned(), mMainHandler, mBgHandler); } /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +13 −2 Original line number Diff line number Diff line Loading @@ -3655,8 +3655,19 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) private void generatePositionChangeEvents() { for (ExpandableView child : mChildrenChangingPositions) { mAnimationEvents.add(new AnimationEvent(child, AnimationEvent.ANIMATION_TYPE_CHANGE_POSITION)); Integer duration = null; if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; if (row.getEntry().isMarkedForUserTriggeredMovement()) { duration = StackStateAnimator.ANIMATION_DURATION_PRIORITY_CHANGE; row.getEntry().markForUserTriggeredMovement(false); } } AnimationEvent animEvent = duration == null ? new AnimationEvent(child, AnimationEvent.ANIMATION_TYPE_CHANGE_POSITION) : new AnimationEvent( child, AnimationEvent.ANIMATION_TYPE_CHANGE_POSITION, duration); mAnimationEvents.add(animEvent); } mChildrenChangingPositions.clear(); if (mGenerateChildOrderChangedEvent) { Loading