Merge "Fix deadlock when updating rotation" into mnc-dr-dev

This commit is contained in:
Chong Zhang
2015-08-28 19:57:57 +00:00
committed by Android (Google) Code Review

View File

@@ -762,6 +762,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
class MyOrientationListener extends WindowOrientationListener {
private final Runnable mUpdateRotationRunnable = new Runnable() {
@Override
public void run() {
updateRotation(false);
}
};
MyOrientationListener(Context context, Handler handler) {
super(context, handler);
}
@@ -769,7 +776,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
@Override
public void onProposedRotationChanged(int rotation) {
if (localLOGV) Slog.v(TAG, "onProposedRotationChanged, rotation=" + rotation);
updateRotation(false);
mHandler.post(mUpdateRotationRunnable);
}
}
MyOrientationListener mOrientationListener;