diff options
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java index 6e30803..98bbe7c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java @@ -552,6 +552,7 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL } public void updateEntry() { + mSortedEntries.remove(HeadsUpEntry.this); long currentTime = mClock.currentTimeMillis(); earliestRemovaltime = currentTime + mMinimumDisplayTime; postTime = Math.max(postTime, currentTime); @@ -561,13 +562,13 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL long removeDelay = Math.max(finishTime - currentTime, mMinimumDisplayTime); mHandler.postDelayed(mRemoveHeadsUpRunnable, removeDelay); } - updateSortOrder(HeadsUpEntry.this); + mSortedEntries.add(HeadsUpEntry.this); } @Override public int compareTo(HeadsUpEntry o) { return postTime < o.postTime ? 1 - : postTime == o.postTime ? 0 + : postTime == o.postTime ? entry.key.compareTo(o.entry.key) : -1; } @@ -592,16 +593,6 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL } } - /** - * Update the sorted heads up order. - * - * @param headsUpEntry the headsUp that changed - */ - private void updateSortOrder(HeadsUpEntry headsUpEntry) { - mSortedEntries.remove(headsUpEntry); - mSortedEntries.add(headsUpEntry); - } - public static class Clock { public long currentTimeMillis() { return SystemClock.elapsedRealtime(); |