Move connectedness booleans into controller

This slightly changes the semantics of the call sites,
and thus warrants a more thorough review.

Bug: 205676419
Test: make
Change-Id: If494009ad161cd065de28550d241b6a2757ecdb1
This commit is contained in:
Nikolas Havrikov
2021-11-11 18:30:20 +01:00
parent 4deaaf588d
commit 713036b6e2
2 changed files with 4 additions and 16 deletions

View File

@@ -144,10 +144,6 @@ final class InputMethodBindingController {
return mHasConnection;
}
void setHasConnection(boolean hasConnection) {
mHasConnection = hasConnection;
}
/**
* Id obtained with {@link InputMethodInfo#getId()} for the input method that we are currently
* connected to or in the process of connecting to.
@@ -261,10 +257,6 @@ final class InputMethodBindingController {
return mVisibleBound;
}
void setVisibleBound(boolean visibleBound) {
mVisibleBound = visibleBound;
}
/**
* Used to bring IME service up to visible adjustment while it is being shown.
*/
@@ -405,14 +397,16 @@ final class InputMethodBindingController {
@GuardedBy("mMethodMap")
boolean bindCurrentInputMethodServiceVisibleConnectionLocked() {
return bindCurrentInputMethodServiceLocked(mVisibleConnection,
mVisibleBound = bindCurrentInputMethodServiceLocked(mVisibleConnection,
IME_VISIBLE_BIND_FLAGS);
return mVisibleBound;
}
@GuardedBy("mMethodMap")
boolean bindCurrentInputMethodServiceMainConnectionLocked() {
return bindCurrentInputMethodServiceLocked(mMainConnection,
mHasConnection = bindCurrentInputMethodServiceLocked(mMainConnection,
mImeConnectionBindFlags);
return mHasConnection;
}

View File

@@ -559,10 +559,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
return mBindingController.hasConnection();
}
private void setHasConnection(boolean hasConnection) {
mBindingController.setHasConnection(hasConnection);
}
boolean isShowRequested() {
return mShowRequested;
}
@@ -2531,7 +2527,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
Binder token = new Binder();
setCurToken(token);
setLastBindTime(SystemClock.uptimeMillis());
setHasConnection(true);
setCurId(methodId);
mCurTokenDisplayId = displayIdToShowIme;
try {
@@ -3152,7 +3147,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
mInputShown = true;
if (hasConnection() && !isVisibleBound()) {
mBindingController.bindCurrentInputMethodServiceVisibleConnectionLocked();
setVisibleBound(true);
}
res = true;
} else {