am 1a3c051b: Merge "Hide/show ime switch icon properly" into ics-mr1
* commit '1a3c051bcc787363d9154da4a8e8e562dda32926': Hide/show ime switch icon properly
This commit is contained in:
@@ -382,6 +382,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
|
if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
|
||||||
mScreenOn = true;
|
mScreenOn = true;
|
||||||
|
refreshImeWindowVisibilityLocked();
|
||||||
} else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
|
} else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
|
||||||
mScreenOn = false;
|
mScreenOn = false;
|
||||||
setImeWindowVisibilityStatusHiddenLocked();
|
setImeWindowVisibilityStatusHiddenLocked();
|
||||||
@@ -640,6 +641,21 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
updateImeWindowStatusLocked();
|
updateImeWindowStatusLocked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void refreshImeWindowVisibilityLocked() {
|
||||||
|
final Configuration conf = mRes.getConfiguration();
|
||||||
|
final boolean haveHardKeyboard = conf.keyboard
|
||||||
|
!= Configuration.KEYBOARD_NOKEYS;
|
||||||
|
final boolean hardKeyShown = haveHardKeyboard
|
||||||
|
&& conf.hardKeyboardHidden
|
||||||
|
!= Configuration.HARDKEYBOARDHIDDEN_YES;
|
||||||
|
final boolean isScreenLocked = mKeyguardManager != null
|
||||||
|
&& mKeyguardManager.isKeyguardLocked()
|
||||||
|
&& mKeyguardManager.isKeyguardSecure();
|
||||||
|
mImeWindowVis = (!isScreenLocked && (mInputShown || hardKeyShown)) ?
|
||||||
|
(InputMethodService.IME_ACTIVE | InputMethodService.IME_VISIBLE) : 0;
|
||||||
|
updateImeWindowStatusLocked();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateImeWindowStatusLocked() {
|
private void updateImeWindowStatusLocked() {
|
||||||
setImeWindowStatus(mCurToken, mImeWindowVis, mBackDisposition);
|
setImeWindowStatus(mCurToken, mImeWindowVis, mBackDisposition);
|
||||||
}
|
}
|
||||||
@@ -1285,16 +1301,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
}
|
}
|
||||||
if (mCurMethod != null) {
|
if (mCurMethod != null) {
|
||||||
try {
|
try {
|
||||||
final Configuration conf = mRes.getConfiguration();
|
refreshImeWindowVisibilityLocked();
|
||||||
final boolean haveHardKeyboard = conf.keyboard
|
|
||||||
!= Configuration.KEYBOARD_NOKEYS;
|
|
||||||
final boolean hardKeyShown = haveHardKeyboard
|
|
||||||
&& conf.hardKeyboardHidden
|
|
||||||
!= Configuration.HARDKEYBOARDHIDDEN_YES;
|
|
||||||
mImeWindowVis = (mInputShown || hardKeyShown) ? (
|
|
||||||
InputMethodService.IME_ACTIVE | InputMethodService.IME_VISIBLE)
|
|
||||||
: 0;
|
|
||||||
updateImeWindowStatusLocked();
|
|
||||||
// If subtype is null, try to find the most applicable one from
|
// If subtype is null, try to find the most applicable one from
|
||||||
// getCurrentInputMethodSubtype.
|
// getCurrentInputMethodSubtype.
|
||||||
if (subtype == null) {
|
if (subtype == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user