Merge "Dispose HideNavInputEventReceiver on PhoneWindowManager's handler" into nyc-dev
This commit is contained in:
@@ -716,6 +716,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
private static final int MSG_REQUEST_TRANSIENT_BARS = 16;
|
private static final int MSG_REQUEST_TRANSIENT_BARS = 16;
|
||||||
private static final int MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU = 17;
|
private static final int MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU = 17;
|
||||||
private static final int MSG_BACK_LONG_PRESS = 18;
|
private static final int MSG_BACK_LONG_PRESS = 18;
|
||||||
|
private static final int MSG_DISPOSE_INPUT_CONSUMER = 19;
|
||||||
|
|
||||||
private static final int MSG_REQUEST_TRANSIENT_BARS_ARG_STATUS = 0;
|
private static final int MSG_REQUEST_TRANSIENT_BARS_ARG_STATUS = 0;
|
||||||
private static final int MSG_REQUEST_TRANSIENT_BARS_ARG_NAVIGATION = 1;
|
private static final int MSG_REQUEST_TRANSIENT_BARS_ARG_NAVIGATION = 1;
|
||||||
@@ -783,6 +784,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
case MSG_BACK_LONG_PRESS:
|
case MSG_BACK_LONG_PRESS:
|
||||||
backLongPress();
|
backLongPress();
|
||||||
break;
|
break;
|
||||||
|
case MSG_DISPOSE_INPUT_CONSUMER:
|
||||||
|
disposeInputConsumer((InputConsumer) msg.obj);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1260,6 +1264,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void disposeInputConsumer(InputConsumer inputConsumer) {
|
||||||
|
if (inputConsumer != null) {
|
||||||
|
inputConsumer.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void sleepPress(long eventTime) {
|
private void sleepPress(long eventTime) {
|
||||||
if (mShortPressOnSleepBehavior == SHORT_PRESS_SLEEP_GO_TO_SLEEP_AND_GO_HOME) {
|
if (mShortPressOnSleepBehavior == SHORT_PRESS_SLEEP_GO_TO_SLEEP_AND_GO_HOME) {
|
||||||
launchHomeFromHotKey(false /* awakenDreams */, true /*respectKeyguard*/);
|
launchHomeFromHotKey(false /* awakenDreams */, true /*respectKeyguard*/);
|
||||||
@@ -3738,6 +3748,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
// When the user taps down, we re-show the nav bar.
|
// When the user taps down, we re-show the nav bar.
|
||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
synchronized (mWindowManagerFuncs.getWindowManagerLock()) {
|
synchronized (mWindowManagerFuncs.getWindowManagerLock()) {
|
||||||
|
if (mInputConsumer == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Any user activity always causes us to show the
|
// Any user activity always causes us to show the
|
||||||
// navigation controls, if they had been hidden.
|
// navigation controls, if they had been hidden.
|
||||||
// We also clear the low profile and only content
|
// We also clear the low profile and only content
|
||||||
@@ -3991,7 +4004,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
// bar and ensure the application doesn't see the event.
|
// bar and ensure the application doesn't see the event.
|
||||||
if (navVisible || navAllowedHidden) {
|
if (navVisible || navAllowedHidden) {
|
||||||
if (mInputConsumer != null) {
|
if (mInputConsumer != null) {
|
||||||
mInputConsumer.dismiss();
|
mHandler.sendMessage(
|
||||||
|
mHandler.obtainMessage(MSG_DISPOSE_INPUT_CONSUMER, mInputConsumer));
|
||||||
mInputConsumer = null;
|
mInputConsumer = null;
|
||||||
}
|
}
|
||||||
} else if (mInputConsumer == null) {
|
} else if (mInputConsumer == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user