Merge "Hide ime switcher when the screen is turned off." into ics-mr1

This commit is contained in:
satok
2011-10-28 18:25:28 -07:00
committed by Android (Google) Code Review

View File

@ -374,6 +374,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
mScreenOn = true; mScreenOn = true;
} else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { } else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
mScreenOn = false; mScreenOn = false;
setImeWindowVisibilityStatusHiddenLocked();
} else if (intent.getAction().equals(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) { } else if (intent.getAction().equals(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) {
hideInputMethodMenu(); hideInputMethodMenu();
return; return;
@ -468,8 +469,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
// Uh oh, current input method is no longer around! // Uh oh, current input method is no longer around!
// Pick another one... // Pick another one...
Slog.i(TAG, "Current input method removed: " + curInputMethodId); Slog.i(TAG, "Current input method removed: " + curInputMethodId);
mImeWindowVis = 0; setImeWindowVisibilityStatusHiddenLocked();
updateImeWindowStatusLocked();
if (!chooseNewDefaultIMELocked()) { if (!chooseNewDefaultIMELocked()) {
changed = true; changed = true;
curIm = null; curIm = null;
@ -625,7 +625,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
} }
} }
void updateImeWindowStatusLocked() { private void setImeWindowVisibilityStatusHiddenLocked() {
mImeWindowVis = 0;
updateImeWindowStatusLocked();
}
private void updateImeWindowStatusLocked() {
setImeWindowStatus(mCurToken, mImeWindowVis, mBackDisposition); setImeWindowStatus(mCurToken, mImeWindowVis, mBackDisposition);
} }
@ -999,8 +1004,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
sessionState.session.finishSession(); sessionState.session.finishSession();
} catch (RemoteException e) { } catch (RemoteException e) {
Slog.w(TAG, "Session failed to close due to remote exception", e); Slog.w(TAG, "Session failed to close due to remote exception", e);
mImeWindowVis = 0; setImeWindowVisibilityStatusHiddenLocked();
updateImeWindowStatusLocked();
} }
} }
} }
@ -1395,13 +1399,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
if (!mIWindowManager.inputMethodClientHasFocus(client)) { if (!mIWindowManager.inputMethodClientHasFocus(client)) {
if (DEBUG) Slog.w(TAG, "Ignoring hideSoftInput of uid " if (DEBUG) Slog.w(TAG, "Ignoring hideSoftInput of uid "
+ uid + ": " + client); + uid + ": " + client);
mImeWindowVis = 0; setImeWindowVisibilityStatusHiddenLocked();
updateImeWindowStatusLocked();
return false; return false;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
mImeWindowVis = 0; setImeWindowVisibilityStatusHiddenLocked();
updateImeWindowStatusLocked();
return false; return false;
} }
} }