Remove InputMethodManagerDelegate#setCurrentRootView()
With this CL, InputMethodManagerDelegate#setCurrentRootView() will be removed. This is mechanical refactoring. There must be no observable behavior change. Bug: 234882948 Test: presubmit Change-Id: I3e596b4243f3223d1c9b8ba3571f91879ce0ecd4
This commit is contained in:
@@ -82,12 +82,10 @@ public final class ImeFocusController {
|
||||
|
||||
@UiThread
|
||||
void onPreWindowFocus(boolean hasWindowFocus, WindowManager.LayoutParams windowAttribute) {
|
||||
if (!mHasImeFocus || isInLocalFocusMode(windowAttribute)) {
|
||||
if (!hasWindowFocus || !mHasImeFocus || isInLocalFocusMode(windowAttribute)) {
|
||||
return;
|
||||
}
|
||||
if (hasWindowFocus) {
|
||||
getImmDelegate().setCurrentRootView(mViewRootImpl);
|
||||
}
|
||||
getImmDelegate().onPreWindowGainedFocus(mViewRootImpl);
|
||||
}
|
||||
|
||||
@UiThread
|
||||
@@ -113,7 +111,7 @@ public final class ImeFocusController {
|
||||
windowAttribute.softInputMode));
|
||||
}
|
||||
|
||||
getImmDelegate().onPostWindowFocus(viewForWindowFocus, windowAttribute);
|
||||
getImmDelegate().onPostWindowGainedFocus(viewForWindowFocus, windowAttribute);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,7 +185,8 @@ public final class ImeFocusController {
|
||||
* @hide
|
||||
*/
|
||||
public interface InputMethodManagerDelegate {
|
||||
void onPostWindowFocus(View viewForWindowFocus,
|
||||
void onPreWindowGainedFocus(ViewRootImpl viewRootImpl);
|
||||
void onPostWindowGainedFocus(View viewForWindowFocus,
|
||||
@NonNull WindowManager.LayoutParams windowAttribute);
|
||||
void onViewFocusChanged(@NonNull View view, boolean hasFocus);
|
||||
boolean checkFocus(boolean forceNewFocus, boolean startInput, ViewRootImpl viewRootImpl);
|
||||
@@ -195,7 +194,6 @@ public final class ImeFocusController {
|
||||
void onWindowDismissed(ViewRootImpl viewRootImpl);
|
||||
|
||||
void finishInputAndReportToIme();
|
||||
void setCurrentRootView(ViewRootImpl rootView);
|
||||
boolean isCurrentRootView(ViewRootImpl rootView);
|
||||
}
|
||||
|
||||
|
||||
@@ -759,7 +759,14 @@ public final class InputMethodManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostWindowFocus(View viewForWindowFocus,
|
||||
public void onPreWindowGainedFocus(ViewRootImpl viewRootImpl) {
|
||||
synchronized (mH) {
|
||||
setCurrentRootViewLocked(viewRootImpl);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostWindowGainedFocus(View viewForWindowFocus,
|
||||
@NonNull WindowManager.LayoutParams windowAttribute) {
|
||||
boolean forceFocus = false;
|
||||
synchronized (mH) {
|
||||
@@ -932,19 +939,14 @@ public final class InputMethodManager {
|
||||
if (mServedView != null) {
|
||||
finishInputLocked();
|
||||
}
|
||||
setCurrentRootView(null);
|
||||
setCurrentRootViewLocked(null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for {@link ImeFocusController} to set the current focused root view.
|
||||
*/
|
||||
@Override
|
||||
public void setCurrentRootView(ViewRootImpl rootView) {
|
||||
synchronized (mH) {
|
||||
mImeDispatcher.switchRootView(mCurRootView, rootView);
|
||||
mCurRootView = rootView;
|
||||
}
|
||||
@GuardedBy("mH")
|
||||
private void setCurrentRootViewLocked(ViewRootImpl rootView) {
|
||||
mImeDispatcher.switchRootView(mCurRootView, rootView);
|
||||
mCurRootView = rootView;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user