Merge "Fixed a crash with the heads up manager" into mnc-dr1.5-dev

am: d23f1eb0cd

* commit 'd23f1eb0cd9893395573a4059be195e8fdb1007a':
  Fixed a crash with the heads up manager
This commit is contained in:
Selim Cinek
2016-01-13 23:10:20 +00:00
committed by android-build-merger

View File

@@ -453,7 +453,10 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL
mReleaseOnExpandFinish = false;
} else {
for (NotificationData.Entry entry : mEntriesToRemoveAfterExpand) {
removeHeadsUpEntry(entry);
if (isHeadsUp(entry.key)) {
// Maybe the heads-up was removed already
removeHeadsUpEntry(entry);
}
}
}
mEntriesToRemoveAfterExpand.clear();
@@ -572,6 +575,9 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL
earliestRemovaltime = currentTime + mMinimumDisplayTime;
postTime = Math.max(postTime, currentTime);
removeAutoRemovalCallbacks();
if (mEntriesToRemoveAfterExpand.contains(entry)) {
mEntriesToRemoveAfterExpand.remove(entry);
}
if (!hasFullScreenIntent(entry)) {
long finishTime = postTime + mHeadsUpNotificationDecay;
long removeDelay = Math.max(finishTime - currentTime, mMinimumDisplayTime);