Move clearing current method to controller

Bug: 205676419
Test: make
Change-Id: I11641791abbc4f24d97e2d371900a912c9b6ba41
This commit is contained in:
Nikolas Havrikov
2021-11-18 17:37:44 +01:00
parent 0dc20ab2a0
commit a1a9ae5392
2 changed files with 8 additions and 19 deletions

View File

@@ -231,10 +231,6 @@ final class InputMethodBindingController {
return mCurMethod;
}
void setCurMethod(@Nullable IInputMethod curMethod) {
mCurMethod = curMethod;
}
/**
* If not {@link Process#INVALID_UID}, then the UID of {@link #getCurIntent()}.
*/
@@ -242,10 +238,6 @@ final class InputMethodBindingController {
return mCurMethodUid;
}
void setCurMethodUid(int curMethodUid) {
mCurMethodUid = curMethodUid;
}
/**
* Indicates whether {@link #getVisibleConnection} is currently in use.
*/
@@ -369,6 +361,12 @@ final class InputMethodBindingController {
mService.clearClientSessionsLocked();
}
@GuardedBy("mMethodMap")
void clearCurMethodLocked() {
mCurMethod = null;
mCurMethodUid = Process.INVALID_UID;
}
@GuardedBy("mMethodMap")
private void removeCurrentTokenLocked() {
int curTokenDisplayId = mService.getCurTokenDisplayId();

View File

@@ -606,10 +606,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
return mBindingController.getCurMethod();
}
private void setCurMethod(@Nullable IInputMethod curMethod) {
mBindingController.setCurMethod(curMethod);
}
/**
* If not {@link Process#INVALID_UID}, then the UID of {@link #getCurIntent()}.
*/
@@ -617,10 +613,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
return mBindingController.getCurMethodUid();
}
private void setCurMethodUid(int curMethodUid) {
mBindingController.setCurMethodUid(curMethodUid);
}
/**
* Time that we last initiated a bind to the input method, to determine
* if we should try to disconnect and reconnect to it.
@@ -2598,9 +2590,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
finishSessionLocked(mEnabledSession);
mEnabledSession = null;
setCurMethod(null);
setCurMethodUid(Process.INVALID_UID);
scheduleNotifyImeUidToAudioService(getCurMethodUid());
mBindingController.clearCurMethodLocked();
scheduleNotifyImeUidToAudioService(Process.INVALID_UID);
}
hideStatusBarIconLocked();
mInFullscreenMode = false;