Merge "AOD: Finish pulse when notification is removed" into oc-dr1-dev
am: 7bed78952e
Change-Id: Id8761920bb2beca8bdf96f69d6915548836594b3
This commit is contained in:
@@ -54,6 +54,7 @@ public class DozeScrimController {
|
||||
private float mBehindTarget;
|
||||
private boolean mDozingAborted;
|
||||
private boolean mWakeAndUnlocking;
|
||||
private boolean mFullyPulsing;
|
||||
|
||||
public DozeScrimController(ScrimController scrimController, Context context) {
|
||||
mContext = context;
|
||||
@@ -136,6 +137,12 @@ public class DozeScrimController {
|
||||
abortPulsing();
|
||||
}
|
||||
|
||||
public void pulseOutNow() {
|
||||
if (mPulseCallback != null && mFullyPulsing) {
|
||||
mPulseOut.run();
|
||||
}
|
||||
}
|
||||
|
||||
public void onScreenTurnedOn() {
|
||||
if (isPulsing()) {
|
||||
final boolean pickupOrDoubleTap = mPulseReason == DozeLog.PULSE_REASON_SENSOR_PICKUP
|
||||
@@ -163,6 +170,7 @@ public class DozeScrimController {
|
||||
if (DEBUG) Log.d(TAG, "Cancel pulsing");
|
||||
|
||||
if (mPulseCallback != null) {
|
||||
mFullyPulsing = false;
|
||||
mHandler.removeCallbacks(mPulseIn);
|
||||
mHandler.removeCallbacks(mPulseOut);
|
||||
mHandler.removeCallbacks(mPulseOutExtended);
|
||||
@@ -297,6 +305,7 @@ public class DozeScrimController {
|
||||
mHandler.postDelayed(mPulseOut, mDozeParameters.getPulseVisibleDuration());
|
||||
mHandler.postDelayed(mPulseOutExtended,
|
||||
mDozeParameters.getPulseVisibleDurationExtended());
|
||||
mFullyPulsing = true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -311,6 +320,8 @@ public class DozeScrimController {
|
||||
private final Runnable mPulseOut = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mFullyPulsing = false;
|
||||
mHandler.removeCallbacks(mPulseOut);
|
||||
mHandler.removeCallbacks(mPulseOutExtended);
|
||||
if (DEBUG) Log.d(TAG, "Pulse out, mDozing=" + mDozing);
|
||||
if (!mDozing) return;
|
||||
|
||||
@@ -1885,6 +1885,11 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
} catch (RemoteException ex) {
|
||||
// system process is dead if we're here.
|
||||
}
|
||||
if (mStackScroller.hasPulsingNotifications() && mHeadsUpManager.getAllEntries().isEmpty()) {
|
||||
// We were showing a pulse for a notification, but no notifications are pulsing anymore.
|
||||
// Finish the pulse.
|
||||
mDozeScrimController.pulseOutNow();
|
||||
}
|
||||
// end old BaseStatusBar.performRemoveNotification.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user