Merge "Fix SysUI when an app started from the affordances crashes" into lmp-mr1-dev
This commit is contained in:
@@ -1629,6 +1629,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
} else {
|
} else {
|
||||||
mSecureCameraLaunchManager.startSecureCameraLaunch();
|
mSecureCameraLaunchManager.startSecureCameraLaunch();
|
||||||
}
|
}
|
||||||
|
mStatusBar.startLaunchTransitionTimeout();
|
||||||
mBlockTouches = true;
|
mBlockTouches = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -203,8 +203,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
private static final int MSG_OPEN_NOTIFICATION_PANEL = 1000;
|
private static final int MSG_OPEN_NOTIFICATION_PANEL = 1000;
|
||||||
private static final int MSG_CLOSE_PANELS = 1001;
|
private static final int MSG_CLOSE_PANELS = 1001;
|
||||||
private static final int MSG_OPEN_SETTINGS_PANEL = 1002;
|
private static final int MSG_OPEN_SETTINGS_PANEL = 1002;
|
||||||
|
private static final int MSG_LAUNCH_TRANSITION_TIMEOUT = 1003;
|
||||||
// 1020-1040 reserved for BaseStatusBar
|
// 1020-1040 reserved for BaseStatusBar
|
||||||
|
|
||||||
|
// Time after we abort the launch transition.
|
||||||
|
private static final long LAUNCH_TRANSITION_TIMEOUT_MS = 5000;
|
||||||
|
|
||||||
private static final boolean CLOSE_PANEL_WHEN_EMPTIED = true;
|
private static final boolean CLOSE_PANEL_WHEN_EMPTIED = true;
|
||||||
|
|
||||||
private static final int NOTIFICATION_PRIORITY_MULTIPLIER = 10; // see NotificationManagerService
|
private static final int NOTIFICATION_PRIORITY_MULTIPLIER = 10; // see NotificationManagerService
|
||||||
@@ -2196,6 +2200,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
escalateHeadsUp();
|
escalateHeadsUp();
|
||||||
setHeadsUpVisibility(false);
|
setHeadsUpVisibility(false);
|
||||||
break;
|
break;
|
||||||
|
case MSG_LAUNCH_TRANSITION_TIMEOUT:
|
||||||
|
onLaunchTransitionTimeout();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3528,12 +3535,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
if (mLaunchTransitionFadingAway) {
|
if (mLaunchTransitionFadingAway) {
|
||||||
mNotificationPanel.animate().cancel();
|
mNotificationPanel.animate().cancel();
|
||||||
mNotificationPanel.setAlpha(1f);
|
mNotificationPanel.setAlpha(1f);
|
||||||
if (mLaunchTransitionEndRunnable != null) {
|
runLaunchTransitionEndRunnable();
|
||||||
mLaunchTransitionEndRunnable.run();
|
|
||||||
}
|
|
||||||
mLaunchTransitionEndRunnable = null;
|
|
||||||
mLaunchTransitionFadingAway = false;
|
mLaunchTransitionFadingAway = false;
|
||||||
}
|
}
|
||||||
|
mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
|
||||||
setBarState(StatusBarState.KEYGUARD);
|
setBarState(StatusBarState.KEYGUARD);
|
||||||
updateKeyguardState(false /* goingToFullShade */, false /* fromShadeLocked */);
|
updateKeyguardState(false /* goingToFullShade */, false /* fromShadeLocked */);
|
||||||
if (!mScreenOnFromKeyguard) {
|
if (!mScreenOnFromKeyguard) {
|
||||||
@@ -3574,6 +3579,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
*/
|
*/
|
||||||
public void fadeKeyguardAfterLaunchTransition(final Runnable beforeFading,
|
public void fadeKeyguardAfterLaunchTransition(final Runnable beforeFading,
|
||||||
Runnable endRunnable) {
|
Runnable endRunnable) {
|
||||||
|
mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
|
||||||
mLaunchTransitionEndRunnable = endRunnable;
|
mLaunchTransitionEndRunnable = endRunnable;
|
||||||
Runnable hideRunnable = new Runnable() {
|
Runnable hideRunnable = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -3592,10 +3598,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mNotificationPanel.setAlpha(1);
|
mNotificationPanel.setAlpha(1);
|
||||||
if (mLaunchTransitionEndRunnable != null) {
|
runLaunchTransitionEndRunnable();
|
||||||
mLaunchTransitionEndRunnable.run();
|
|
||||||
}
|
|
||||||
mLaunchTransitionEndRunnable = null;
|
|
||||||
mLaunchTransitionFadingAway = false;
|
mLaunchTransitionFadingAway = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -3608,6 +3611,32 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts the timeout when we try to start the affordances on Keyguard. We usually rely that
|
||||||
|
* Keyguard goes away via fadeKeyguardAfterLaunchTransition, however, that might not happen
|
||||||
|
* because the launched app crashed or something else went wrong.
|
||||||
|
*/
|
||||||
|
public void startLaunchTransitionTimeout() {
|
||||||
|
mHandler.sendEmptyMessageDelayed(MSG_LAUNCH_TRANSITION_TIMEOUT,
|
||||||
|
LAUNCH_TRANSITION_TIMEOUT_MS);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onLaunchTransitionTimeout() {
|
||||||
|
Log.w(TAG, "Launch transition: Timeout!");
|
||||||
|
mNotificationPanel.resetViews();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void runLaunchTransitionEndRunnable() {
|
||||||
|
if (mLaunchTransitionEndRunnable != null) {
|
||||||
|
Runnable r = mLaunchTransitionEndRunnable;
|
||||||
|
|
||||||
|
// mLaunchTransitionEndRunnable might call showKeyguard, which would execute it again,
|
||||||
|
// which would lead to infinite recursion. Protect against it.
|
||||||
|
mLaunchTransitionEndRunnable = null;
|
||||||
|
r.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if we would like to stay in the shade, false if it should go away entirely
|
* @return true if we would like to stay in the shade, false if it should go away entirely
|
||||||
*/
|
*/
|
||||||
@@ -3631,6 +3660,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
if (mQSPanel != null) {
|
if (mQSPanel != null) {
|
||||||
mQSPanel.refreshAllTiles();
|
mQSPanel.refreshAllTiles();
|
||||||
}
|
}
|
||||||
|
mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
|
||||||
return staying;
|
return staying;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ public class StatusBarKeyguardViewManager {
|
|||||||
new Runnable() {
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mStatusBarWindowManager.setKeyguardOccluded(true);
|
mStatusBarWindowManager.setKeyguardOccluded(mOccluded);
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user