Loading packages/SystemUI/res/values/ids.xml +1 −0 Original line number Diff line number Diff line Loading @@ -49,5 +49,6 @@ <!-- For notification icons for which targetSdk < L, this caches whether the icon is grayscale --> <item type="id" name="icon_is_grayscale" /> <item type="id" name="is_clicked_heads_up_tag" /> </resources> packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +1 −0 Original line number Diff line number Diff line Loading @@ -1525,6 +1525,7 @@ public abstract class BaseStatusBar extends SystemUI implements // // In most cases, when FLAG_AUTO_CANCEL is set, the notification will // become canceled shortly by NoMan, but we can't assume that. HeadsUpManager.setIsClickedNotification(row, true); mHeadsUpManager.releaseImmediately(notificationKey); } new Thread() { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +7 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ import android.util.MathUtils; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; import android.view.ViewRootImpl; import android.view.ViewTreeObserver; import android.view.WindowInsets; import android.view.accessibility.AccessibilityEvent; Loading Loading @@ -203,10 +202,12 @@ public class NotificationPanelView extends PanelView implements private int mPositionMinSideMargin; private int mLastOrientation = -1; private boolean mClosingWithAlphaFadeOut; private boolean mHeadsUpAnimatingAway; private Runnable mHeadsUpExistenceChangedRunnable = new Runnable() { @Override public void run() { mHeadsUpAnimatingAway = false; notifyBarPanelExpansionChanged(); } }; Loading Loading @@ -2292,6 +2293,7 @@ public class NotificationPanelView extends PanelView implements mHeadsUpExistenceChangedRunnable.run(); updateNotificationTranslucency(); } else { mHeadsUpAnimatingAway = true; mNotificationStackScroller.runAfterAnimationFinished( mHeadsUpExistenceChangedRunnable); } Loading Loading @@ -2382,4 +2384,8 @@ public class NotificationPanelView extends PanelView implements public void clearNotificattonEffects() { mStatusBar.clearNotificationEffects(); } protected boolean isPanelVisibleBecauseOfHeadsUp() { return mHeadsUpManager.hasPinnedHeadsUp() || mHeadsUpAnimatingAway; } } packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +3 −1 Original line number Diff line number Diff line Loading @@ -1009,10 +1009,12 @@ public abstract class PanelView extends FrameLayout { protected void notifyBarPanelExpansionChanged() { mBar.panelExpansionChanged(this, mExpandedFraction, mExpandedFraction > 0f || mPeekPending || mPeekAnimator != null || mInstantExpanding || mHeadsUpManager.hasPinnedHeadsUp() || mPeekAnimator != null || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp() || mTracking || mHeightAnimator != null); } protected abstract boolean isPanelVisibleBecauseOfHeadsUp(); /** * Gets called when the user performs a click anywhere in the empty area of the panel. * Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java +10 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL private static final String TAG = "HeadsUpManager"; private static final boolean DEBUG = false; private static final String SETTING_HEADS_UP_SNOOZE_LENGTH_MS = "heads_up_snooze_length_ms"; private static final int TAG_CLICKED_NOTIFICATION = R.id.is_clicked_heads_up_tag; private final int mHeadsUpNotificationDecay; private final int mMinimumDisplayTime; Loading Loading @@ -526,6 +527,15 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL }); } public static void setIsClickedNotification(View child, boolean clicked) { child.setTag(TAG_CLICKED_NOTIFICATION, clicked ? true : null); } public static boolean isClickedHeadsUpNotification(View child) { Boolean clicked = (Boolean) child.getTag(TAG_CLICKED_NOTIFICATION); return clicked != null && clicked; } /** * This represents a notification and how long it is in a heads up mode. It also manages its * lifecycle automatically when created. Loading Loading
packages/SystemUI/res/values/ids.xml +1 −0 Original line number Diff line number Diff line Loading @@ -49,5 +49,6 @@ <!-- For notification icons for which targetSdk < L, this caches whether the icon is grayscale --> <item type="id" name="icon_is_grayscale" /> <item type="id" name="is_clicked_heads_up_tag" /> </resources>
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +1 −0 Original line number Diff line number Diff line Loading @@ -1525,6 +1525,7 @@ public abstract class BaseStatusBar extends SystemUI implements // // In most cases, when FLAG_AUTO_CANCEL is set, the notification will // become canceled shortly by NoMan, but we can't assume that. HeadsUpManager.setIsClickedNotification(row, true); mHeadsUpManager.releaseImmediately(notificationKey); } new Thread() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +7 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ import android.util.MathUtils; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; import android.view.ViewRootImpl; import android.view.ViewTreeObserver; import android.view.WindowInsets; import android.view.accessibility.AccessibilityEvent; Loading Loading @@ -203,10 +202,12 @@ public class NotificationPanelView extends PanelView implements private int mPositionMinSideMargin; private int mLastOrientation = -1; private boolean mClosingWithAlphaFadeOut; private boolean mHeadsUpAnimatingAway; private Runnable mHeadsUpExistenceChangedRunnable = new Runnable() { @Override public void run() { mHeadsUpAnimatingAway = false; notifyBarPanelExpansionChanged(); } }; Loading Loading @@ -2292,6 +2293,7 @@ public class NotificationPanelView extends PanelView implements mHeadsUpExistenceChangedRunnable.run(); updateNotificationTranslucency(); } else { mHeadsUpAnimatingAway = true; mNotificationStackScroller.runAfterAnimationFinished( mHeadsUpExistenceChangedRunnable); } Loading Loading @@ -2382,4 +2384,8 @@ public class NotificationPanelView extends PanelView implements public void clearNotificattonEffects() { mStatusBar.clearNotificationEffects(); } protected boolean isPanelVisibleBecauseOfHeadsUp() { return mHeadsUpManager.hasPinnedHeadsUp() || mHeadsUpAnimatingAway; } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +3 −1 Original line number Diff line number Diff line Loading @@ -1009,10 +1009,12 @@ public abstract class PanelView extends FrameLayout { protected void notifyBarPanelExpansionChanged() { mBar.panelExpansionChanged(this, mExpandedFraction, mExpandedFraction > 0f || mPeekPending || mPeekAnimator != null || mInstantExpanding || mHeadsUpManager.hasPinnedHeadsUp() || mPeekAnimator != null || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp() || mTracking || mHeightAnimator != null); } protected abstract boolean isPanelVisibleBecauseOfHeadsUp(); /** * Gets called when the user performs a click anywhere in the empty area of the panel. * Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java +10 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL private static final String TAG = "HeadsUpManager"; private static final boolean DEBUG = false; private static final String SETTING_HEADS_UP_SNOOZE_LENGTH_MS = "heads_up_snooze_length_ms"; private static final int TAG_CLICKED_NOTIFICATION = R.id.is_clicked_heads_up_tag; private final int mHeadsUpNotificationDecay; private final int mMinimumDisplayTime; Loading Loading @@ -526,6 +527,15 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL }); } public static void setIsClickedNotification(View child, boolean clicked) { child.setTag(TAG_CLICKED_NOTIFICATION, clicked ? true : null); } public static boolean isClickedHeadsUpNotification(View child) { Boolean clicked = (Boolean) child.getTag(TAG_CLICKED_NOTIFICATION); return clicked != null && clicked; } /** * This represents a notification and how long it is in a heads up mode. It also manages its * lifecycle automatically when created. Loading