Extract isSelectedMethodBound method
Bug: 205676419 Test: make Change-Id: I0b08f54ee46422980ce8738c12c02cfe6ba29ad8
This commit is contained in:
@@ -2459,8 +2459,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
// Check if the input method is changing.
|
||||
// We expect the caller has already verified that the client is allowed to access this
|
||||
// display ID.
|
||||
if (getCurId() != null && getCurId().equals(getSelectedMethodId())
|
||||
&& displayIdToShowIme == mCurTokenDisplayId) {
|
||||
if (isSelectedMethodBound(displayIdToShowIme)) {
|
||||
if (cs.curSession != null) {
|
||||
// Fast case: if we are already connected to the input method,
|
||||
// then just return it.
|
||||
@@ -2495,6 +2494,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
return InputBindResult.IME_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
private boolean isSelectedMethodBound(int displayIdToShowIme) {
|
||||
String curId = getCurId();
|
||||
return curId != null && curId.equals(getSelectedMethodId())
|
||||
&& displayIdToShowIme == mCurTokenDisplayId;
|
||||
}
|
||||
|
||||
@GuardedBy("mMethodMap")
|
||||
private void prepareClientSwitchLocked(ClientState cs) {
|
||||
// If the client is changing, we need to switch over to the new
|
||||
|
||||
Reference in New Issue
Block a user