Fixed a crash with the heads up manager

Bug: 25693389
Change-Id: Id852e342000bff6de0ce19f442eb53b21e935b7b
This commit is contained in:
Selim Cinek
2015-11-06 11:33:20 -08:00
parent 9ae30e69ad
commit ba9e8586e3

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);