Merge "Fixed a racecondition where the camera would not launch" into mnc-dr-dev

This commit is contained in:
Selim Cinek
2015-09-09 22:07:02 +00:00
committed by Android (Google) Code Review

View File

@@ -289,6 +289,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
private DozeServiceHost mDozeServiceHost; private DozeServiceHost mDozeServiceHost;
private boolean mWakeUpComingFromTouch; private boolean mWakeUpComingFromTouch;
private PointF mWakeUpTouchLocation; private PointF mWakeUpTouchLocation;
private boolean mScreenTurningOn;
int mPixelFormat; int mPixelFormat;
Object mQueueLock = new Object(); Object mQueueLock = new Object();
@@ -3921,6 +3922,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
} }
public void onScreenTurningOn() { public void onScreenTurningOn() {
mScreenTurningOn = true;
mNotificationPanel.onScreenTurningOn(); mNotificationPanel.onScreenTurningOn();
if (mLaunchCameraOnScreenTurningOn) { if (mLaunchCameraOnScreenTurningOn) {
mNotificationPanel.launchCamera(false); mNotificationPanel.launchCamera(false);
@@ -3933,6 +3935,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
} }
public void onScreenTurnedOn() { public void onScreenTurnedOn() {
mScreenTurningOn = false;
mDozeScrimController.onScreenTurnedOn(); mDozeScrimController.onScreenTurnedOn();
} }
@@ -4108,7 +4111,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mScrimController.dontAnimateBouncerChangesUntilNextFrame(); mScrimController.dontAnimateBouncerChangesUntilNextFrame();
mGestureWakeLock.acquire(LAUNCH_TRANSITION_TIMEOUT_MS + 1000L); mGestureWakeLock.acquire(LAUNCH_TRANSITION_TIMEOUT_MS + 1000L);
} }
if (mStatusBarKeyguardViewManager.isScreenTurnedOn()) { if (mScreenTurningOn || mStatusBarKeyguardViewManager.isScreenTurnedOn()) {
mNotificationPanel.launchCamera(mDeviceInteractive /* animate */); mNotificationPanel.launchCamera(mDeviceInteractive /* animate */);
} else { } else {
// We need to defer the camera launch until the screen comes on, since otherwise // We need to defer the camera launch until the screen comes on, since otherwise