Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +5 −2 Original line number Diff line number Diff line Loading @@ -1902,7 +1902,7 @@ public abstract class BaseStatusBar extends SystemUI implements logUpdate(entry, n); } boolean applyInPlace = shouldApplyInPlace(entry, n); boolean shouldInterrupt = shouldInterrupt(notification); boolean shouldInterrupt = shouldInterrupt(entry); boolean alertAgain = alertAgain(entry, n); entry.notification = notification; Loading Loading @@ -2073,7 +2073,8 @@ public abstract class BaseStatusBar extends SystemUI implements || (newNotification.flags & Notification.FLAG_ONLY_ALERT_ONCE) == 0; } protected boolean shouldInterrupt(StatusBarNotification sbn) { protected boolean shouldInterrupt(Entry entry) { StatusBarNotification sbn = entry.notification; if (mNotificationData.shouldFilterOut(sbn)) { if (DEBUG) { Log.d(TAG, "Skipping HUN check for " + sbn.getKey() + " since it's filtered out."); Loading @@ -2098,10 +2099,12 @@ public abstract class BaseStatusBar extends SystemUI implements Notification.HEADS_UP_ALLOWED) != Notification.HEADS_UP_NEVER; boolean accessibilityForcesLaunch = isFullscreen && mAccessibilityManager.isTouchExplorationEnabled(); boolean justLaunchedFullScreenIntent = entry.hasJustLaunchedFullScreenIntent(); boolean interrupt = (isFullscreen || (isHighPriority && (isNoisy || hasTicker))) && isAllowed && !accessibilityForcesLaunch && !justLaunchedFullScreenIntent && mPowerManager.isScreenOn() && (!mStatusBarKeyguardViewManager.isShowing() || mStatusBarKeyguardViewManager.isOccluded()) Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +13 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar; import android.app.Notification; import android.os.SystemClock; import android.service.notification.NotificationListenerService; import android.service.notification.NotificationListenerService.Ranking; import android.service.notification.NotificationListenerService.RankingMap; Loading @@ -41,6 +42,8 @@ public class NotificationData { private HeadsUpManager mHeadsUpManager; public static final class Entry { private static final long LAUNCH_COOLDOWN = 2000; private static final long NOT_LAUNCHED_YET = -LAUNCH_COOLDOWN; public String key; public StatusBarNotification notification; public StatusBarIconView icon; Loading @@ -49,6 +52,7 @@ public class NotificationData { public boolean autoRedacted; // whether the redacted notification was generated by us public boolean legacy; // whether the notification has a legacy, dark background public int targetSdk; private long lastFullScreenIntentLaunchTime = NOT_LAUNCHED_YET; public Entry(StatusBarNotification n, StatusBarIconView ic) { this.key = n.getKey(); Loading @@ -72,6 +76,7 @@ public class NotificationData { // We should fix this at some point. autoRedacted = false; legacy = false; lastFullScreenIntentLaunchTime = NOT_LAUNCHED_YET; if (row != null) { row.reset(); } Loading @@ -92,6 +97,14 @@ public class NotificationData { public View getPublicContentView() { return row.getPublicLayout().getContractedChild(); } public void notifyFullScreenIntentLaunched() { lastFullScreenIntentLaunchTime = SystemClock.elapsedRealtime(); } public boolean hasJustLaunchedFullScreenIntent() { return SystemClock.elapsedRealtime() < lastFullScreenIntentLaunchTime + LAUNCH_COOLDOWN; } } private final ArrayMap<String, Entry> mEntries = new ArrayMap<>(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +3 −1 Original line number Diff line number Diff line Loading @@ -1153,7 +1153,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (shadeEntry == null) { return; } boolean isHeadsUped = mUseHeadsUp && shouldInterrupt(notification); boolean isHeadsUped = mUseHeadsUp && shouldInterrupt(shadeEntry); if (isHeadsUped) { mHeadsUpManager.showNotification(shadeEntry); // Mark as seen immediately Loading @@ -1171,6 +1171,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION, notification.getKey()); notification.getNotification().fullScreenIntent.send(); shadeEntry.notifyFullScreenIntentLaunched(); } catch (PendingIntent.CanceledException e) { } } Loading Loading @@ -2045,6 +2046,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION, sbn.getKey()); notification.fullScreenIntent.send(); entry.entry.notifyFullScreenIntentLaunched(); } catch (PendingIntent.CanceledException e) { } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +5 −2 Original line number Diff line number Diff line Loading @@ -1902,7 +1902,7 @@ public abstract class BaseStatusBar extends SystemUI implements logUpdate(entry, n); } boolean applyInPlace = shouldApplyInPlace(entry, n); boolean shouldInterrupt = shouldInterrupt(notification); boolean shouldInterrupt = shouldInterrupt(entry); boolean alertAgain = alertAgain(entry, n); entry.notification = notification; Loading Loading @@ -2073,7 +2073,8 @@ public abstract class BaseStatusBar extends SystemUI implements || (newNotification.flags & Notification.FLAG_ONLY_ALERT_ONCE) == 0; } protected boolean shouldInterrupt(StatusBarNotification sbn) { protected boolean shouldInterrupt(Entry entry) { StatusBarNotification sbn = entry.notification; if (mNotificationData.shouldFilterOut(sbn)) { if (DEBUG) { Log.d(TAG, "Skipping HUN check for " + sbn.getKey() + " since it's filtered out."); Loading @@ -2098,10 +2099,12 @@ public abstract class BaseStatusBar extends SystemUI implements Notification.HEADS_UP_ALLOWED) != Notification.HEADS_UP_NEVER; boolean accessibilityForcesLaunch = isFullscreen && mAccessibilityManager.isTouchExplorationEnabled(); boolean justLaunchedFullScreenIntent = entry.hasJustLaunchedFullScreenIntent(); boolean interrupt = (isFullscreen || (isHighPriority && (isNoisy || hasTicker))) && isAllowed && !accessibilityForcesLaunch && !justLaunchedFullScreenIntent && mPowerManager.isScreenOn() && (!mStatusBarKeyguardViewManager.isShowing() || mStatusBarKeyguardViewManager.isOccluded()) Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +13 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar; import android.app.Notification; import android.os.SystemClock; import android.service.notification.NotificationListenerService; import android.service.notification.NotificationListenerService.Ranking; import android.service.notification.NotificationListenerService.RankingMap; Loading @@ -41,6 +42,8 @@ public class NotificationData { private HeadsUpManager mHeadsUpManager; public static final class Entry { private static final long LAUNCH_COOLDOWN = 2000; private static final long NOT_LAUNCHED_YET = -LAUNCH_COOLDOWN; public String key; public StatusBarNotification notification; public StatusBarIconView icon; Loading @@ -49,6 +52,7 @@ public class NotificationData { public boolean autoRedacted; // whether the redacted notification was generated by us public boolean legacy; // whether the notification has a legacy, dark background public int targetSdk; private long lastFullScreenIntentLaunchTime = NOT_LAUNCHED_YET; public Entry(StatusBarNotification n, StatusBarIconView ic) { this.key = n.getKey(); Loading @@ -72,6 +76,7 @@ public class NotificationData { // We should fix this at some point. autoRedacted = false; legacy = false; lastFullScreenIntentLaunchTime = NOT_LAUNCHED_YET; if (row != null) { row.reset(); } Loading @@ -92,6 +97,14 @@ public class NotificationData { public View getPublicContentView() { return row.getPublicLayout().getContractedChild(); } public void notifyFullScreenIntentLaunched() { lastFullScreenIntentLaunchTime = SystemClock.elapsedRealtime(); } public boolean hasJustLaunchedFullScreenIntent() { return SystemClock.elapsedRealtime() < lastFullScreenIntentLaunchTime + LAUNCH_COOLDOWN; } } private final ArrayMap<String, Entry> mEntries = new ArrayMap<>(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +3 −1 Original line number Diff line number Diff line Loading @@ -1153,7 +1153,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (shadeEntry == null) { return; } boolean isHeadsUped = mUseHeadsUp && shouldInterrupt(notification); boolean isHeadsUped = mUseHeadsUp && shouldInterrupt(shadeEntry); if (isHeadsUped) { mHeadsUpManager.showNotification(shadeEntry); // Mark as seen immediately Loading @@ -1171,6 +1171,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION, notification.getKey()); notification.getNotification().fullScreenIntent.send(); shadeEntry.notifyFullScreenIntentLaunched(); } catch (PendingIntent.CanceledException e) { } } Loading Loading @@ -2045,6 +2046,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION, sbn.getKey()); notification.fullScreenIntent.send(); entry.entry.notifyFullScreenIntentLaunched(); } catch (PendingIntent.CanceledException e) { } } Loading