Loading packages/SystemUI/src/com/android/systemui/statusbar/AlertingNotificationManager.java +9 −8 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ public abstract class AlertingNotificationManager { alertEntry.mEntry.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); if (alert) { alertEntry.updateEntry(true /* updatePostTime */); alertEntry.updateEntry(true /* updatePostTime */, "updateNotification"); } } Loading Loading @@ -273,15 +273,15 @@ public abstract class AlertingNotificationManager { mRemoveAlertRunnable = removeAlertRunnable; mPostTime = calculatePostTime(); updateEntry(true /* updatePostTime */); updateEntry(true /* updatePostTime */, "setEntry"); } /** * Updates an entry's removal time. * @param updatePostTime whether or not to refresh the post time */ public void updateEntry(boolean updatePostTime) { mLogger.logUpdateEntry(mEntry, updatePostTime); public void updateEntry(boolean updatePostTime, @Nullable String reason) { mLogger.logUpdateEntry(mEntry, updatePostTime, reason); final long now = mClock.currentTimeMillis(); mEarliestRemovaltime = now + mMinimumDisplayTime; Loading @@ -289,7 +289,7 @@ public abstract class AlertingNotificationManager { if (updatePostTime) { mPostTime = Math.max(mPostTime, now); } removeAutoRemovalCallbacks(); removeAutoRemovalCallbacks("updateEntry (will be rescheduled)"); if (!isSticky()) { final long finishTime = calculateFinishTime(); Loading Loading @@ -330,15 +330,16 @@ public abstract class AlertingNotificationManager { public void reset() { mEntry = null; removeAutoRemovalCallbacks(); removeAutoRemovalCallbacks("reset()"); mRemoveAlertRunnable = null; } /** * Clear any pending removal runnables. */ public void removeAutoRemovalCallbacks() { public void removeAutoRemovalCallbacks(@Nullable String reason) { if (mRemoveAlertRunnable != null) { mLogger.logAutoRemoveCanceled(mEntry, reason); mHandler.removeCallbacks(mRemoveAlertRunnable); } } Loading @@ -348,7 +349,7 @@ public abstract class AlertingNotificationManager { */ public void removeAsSoonAsPossible() { if (mRemoveAlertRunnable != null) { removeAutoRemovalCallbacks(); removeAutoRemovalCallbacks("removeAsSoonAsPossible (will be rescheduled)"); final long timeLeft = mEarliestRemovaltime - mClock.currentTimeMillis(); mHandler.postDelayed(mRemoveAlertRunnable, timeLeft); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java +10 −10 Original line number Diff line number Diff line Loading @@ -263,9 +263,9 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, if (headsUpEntry != null && headsUpEntry.remoteInputActive != remoteInputActive) { headsUpEntry.remoteInputActive = remoteInputActive; if (remoteInputActive) { headsUpEntry.removeAutoRemovalCallbacks(); headsUpEntry.removeAutoRemovalCallbacks("setRemoteInputActive(true)"); } else { headsUpEntry.updateEntry(false /* updatePostTime */); headsUpEntry.updateEntry(false /* updatePostTime */, "setRemoteInputActive(false)"); } } } Loading Loading @@ -446,8 +446,8 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, } @Override public void updateEntry(boolean updatePostTime) { super.updateEntry(updatePostTime); public void updateEntry(boolean updatePostTime, String reason) { super.updateEntry(updatePostTime, reason); if (mEntriesToRemoveAfterExpand.contains(mEntry)) { mEntriesToRemoveAfterExpand.remove(mEntry); Loading @@ -465,9 +465,9 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, this.expanded = expanded; if (expanded) { removeAutoRemovalCallbacks(); removeAutoRemovalCallbacks("setExpanded(true)"); } else { updateEntry(false /* updatePostTime */); updateEntry(false /* updatePostTime */, "setExpanded(false)"); } } Loading @@ -478,9 +478,9 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, mGutsShownPinned = gutsShownPinned; if (gutsShownPinned) { removeAutoRemovalCallbacks(); removeAutoRemovalCallbacks("setGutsShownPinned(true)"); } else { updateEntry(false /* updatePostTime */); updateEntry(false /* updatePostTime */, "setGutsShownPinned(false)"); } } Loading @@ -494,7 +494,7 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, private void extendPulse() { if (!extended) { extended = true; updateEntry(false); updateEntry(false, "extendPulse()"); } } Loading Loading @@ -544,7 +544,7 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, // Let's make sure all huns we got while dozing time out within the normal timeout // duration. Otherwise they could get stuck for a very long time for (AlertEntry entry : mAlertEntries.values()) { entry.updateEntry(true /* updatePostTime */); entry.updateEntry(true /* updatePostTime */, "onDozingChanged(false)"); } } } Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -343,7 +343,7 @@ public abstract class HeadsUpManager extends AlertingNotificationManager { HeadsUpEntry entry = getHeadsUpEntry(key); setEntryPinned(entry, false /* isPinned */); // maybe it got un sticky entry.updateEntry(false /* updatePostTime */); entry.updateEntry(false /* updatePostTime */, "unpinAll"); // when the user unpinned all of HUNs by moving one HUN, all of HUNs should not stay // on the screen. Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManagerLogger.kt +13 −3 Original line number Diff line number Diff line Loading @@ -66,6 +66,15 @@ class HeadsUpManagerLogger @Inject constructor( }) } fun logAutoRemoveCanceled(entry: NotificationEntry, reason: String?) { buffer.log(TAG, INFO, { str1 = entry.logKey str2 = reason ?: "unknown" }, { "cancel auto remove of $str1 reason: $str2" }) } fun logRemoveNotification(key: String, releaseImmediately: Boolean) { buffer.log(TAG, INFO, { str1 = logKey(key) Loading @@ -89,16 +98,17 @@ class HeadsUpManagerLogger @Inject constructor( bool1 = alert bool2 = hasEntry }, { "update notification $str1 alert: $bool1 hasEntry: $bool2" "update notification $str1 alert: $bool1 hasEntry: $bool2 reason: $str2" }) } fun logUpdateEntry(entry: NotificationEntry, updatePostTime: Boolean) { fun logUpdateEntry(entry: NotificationEntry, updatePostTime: Boolean, reason: String?) { buffer.log(TAG, INFO, { str1 = entry.logKey bool1 = updatePostTime str2 = reason ?: "unknown" }, { "update entry $str1 updatePostTime: $bool1" "update entry $str1 updatePostTime: $bool1 reason: $str2" }) } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/AlertingNotificationManager.java +9 −8 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ public abstract class AlertingNotificationManager { alertEntry.mEntry.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); if (alert) { alertEntry.updateEntry(true /* updatePostTime */); alertEntry.updateEntry(true /* updatePostTime */, "updateNotification"); } } Loading Loading @@ -273,15 +273,15 @@ public abstract class AlertingNotificationManager { mRemoveAlertRunnable = removeAlertRunnable; mPostTime = calculatePostTime(); updateEntry(true /* updatePostTime */); updateEntry(true /* updatePostTime */, "setEntry"); } /** * Updates an entry's removal time. * @param updatePostTime whether or not to refresh the post time */ public void updateEntry(boolean updatePostTime) { mLogger.logUpdateEntry(mEntry, updatePostTime); public void updateEntry(boolean updatePostTime, @Nullable String reason) { mLogger.logUpdateEntry(mEntry, updatePostTime, reason); final long now = mClock.currentTimeMillis(); mEarliestRemovaltime = now + mMinimumDisplayTime; Loading @@ -289,7 +289,7 @@ public abstract class AlertingNotificationManager { if (updatePostTime) { mPostTime = Math.max(mPostTime, now); } removeAutoRemovalCallbacks(); removeAutoRemovalCallbacks("updateEntry (will be rescheduled)"); if (!isSticky()) { final long finishTime = calculateFinishTime(); Loading Loading @@ -330,15 +330,16 @@ public abstract class AlertingNotificationManager { public void reset() { mEntry = null; removeAutoRemovalCallbacks(); removeAutoRemovalCallbacks("reset()"); mRemoveAlertRunnable = null; } /** * Clear any pending removal runnables. */ public void removeAutoRemovalCallbacks() { public void removeAutoRemovalCallbacks(@Nullable String reason) { if (mRemoveAlertRunnable != null) { mLogger.logAutoRemoveCanceled(mEntry, reason); mHandler.removeCallbacks(mRemoveAlertRunnable); } } Loading @@ -348,7 +349,7 @@ public abstract class AlertingNotificationManager { */ public void removeAsSoonAsPossible() { if (mRemoveAlertRunnable != null) { removeAutoRemovalCallbacks(); removeAutoRemovalCallbacks("removeAsSoonAsPossible (will be rescheduled)"); final long timeLeft = mEarliestRemovaltime - mClock.currentTimeMillis(); mHandler.postDelayed(mRemoveAlertRunnable, timeLeft); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java +10 −10 Original line number Diff line number Diff line Loading @@ -263,9 +263,9 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, if (headsUpEntry != null && headsUpEntry.remoteInputActive != remoteInputActive) { headsUpEntry.remoteInputActive = remoteInputActive; if (remoteInputActive) { headsUpEntry.removeAutoRemovalCallbacks(); headsUpEntry.removeAutoRemovalCallbacks("setRemoteInputActive(true)"); } else { headsUpEntry.updateEntry(false /* updatePostTime */); headsUpEntry.updateEntry(false /* updatePostTime */, "setRemoteInputActive(false)"); } } } Loading Loading @@ -446,8 +446,8 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, } @Override public void updateEntry(boolean updatePostTime) { super.updateEntry(updatePostTime); public void updateEntry(boolean updatePostTime, String reason) { super.updateEntry(updatePostTime, reason); if (mEntriesToRemoveAfterExpand.contains(mEntry)) { mEntriesToRemoveAfterExpand.remove(mEntry); Loading @@ -465,9 +465,9 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, this.expanded = expanded; if (expanded) { removeAutoRemovalCallbacks(); removeAutoRemovalCallbacks("setExpanded(true)"); } else { updateEntry(false /* updatePostTime */); updateEntry(false /* updatePostTime */, "setExpanded(false)"); } } Loading @@ -478,9 +478,9 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, mGutsShownPinned = gutsShownPinned; if (gutsShownPinned) { removeAutoRemovalCallbacks(); removeAutoRemovalCallbacks("setGutsShownPinned(true)"); } else { updateEntry(false /* updatePostTime */); updateEntry(false /* updatePostTime */, "setGutsShownPinned(false)"); } } Loading @@ -494,7 +494,7 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, private void extendPulse() { if (!extended) { extended = true; updateEntry(false); updateEntry(false, "extendPulse()"); } } Loading Loading @@ -544,7 +544,7 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, // Let's make sure all huns we got while dozing time out within the normal timeout // duration. Otherwise they could get stuck for a very long time for (AlertEntry entry : mAlertEntries.values()) { entry.updateEntry(true /* updatePostTime */); entry.updateEntry(true /* updatePostTime */, "onDozingChanged(false)"); } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -343,7 +343,7 @@ public abstract class HeadsUpManager extends AlertingNotificationManager { HeadsUpEntry entry = getHeadsUpEntry(key); setEntryPinned(entry, false /* isPinned */); // maybe it got un sticky entry.updateEntry(false /* updatePostTime */); entry.updateEntry(false /* updatePostTime */, "unpinAll"); // when the user unpinned all of HUNs by moving one HUN, all of HUNs should not stay // on the screen. Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManagerLogger.kt +13 −3 Original line number Diff line number Diff line Loading @@ -66,6 +66,15 @@ class HeadsUpManagerLogger @Inject constructor( }) } fun logAutoRemoveCanceled(entry: NotificationEntry, reason: String?) { buffer.log(TAG, INFO, { str1 = entry.logKey str2 = reason ?: "unknown" }, { "cancel auto remove of $str1 reason: $str2" }) } fun logRemoveNotification(key: String, releaseImmediately: Boolean) { buffer.log(TAG, INFO, { str1 = logKey(key) Loading @@ -89,16 +98,17 @@ class HeadsUpManagerLogger @Inject constructor( bool1 = alert bool2 = hasEntry }, { "update notification $str1 alert: $bool1 hasEntry: $bool2" "update notification $str1 alert: $bool1 hasEntry: $bool2 reason: $str2" }) } fun logUpdateEntry(entry: NotificationEntry, updatePostTime: Boolean) { fun logUpdateEntry(entry: NotificationEntry, updatePostTime: Boolean, reason: String?) { buffer.log(TAG, INFO, { str1 = entry.logKey bool1 = updatePostTime str2 = reason ?: "unknown" }, { "update entry $str1 updatePostTime: $bool1" "update entry $str1 updatePostTime: $bool1 reason: $str2" }) } Loading