Merge "Add IME {insets control, IME-WM} target to History" into rvc-dev am: fde28a6f47 am: ecb85a1a60
Change-Id: I6e79ce13d3cf20d7723b3592f827af3345e228cd
This commit is contained in:
@@ -820,10 +820,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
final EditorInfo mEditorInfo;
|
||||
@NonNull
|
||||
final String mRequestWindowName;
|
||||
@Nullable
|
||||
final String mImeControlTargetName;
|
||||
@Nullable
|
||||
final String mImeTargetNameFromWm;
|
||||
|
||||
Entry(ClientState client, EditorInfo editorInfo, String focusedWindowName,
|
||||
@SoftInputModeFlags int softInputMode, @SoftInputShowHideReason int reason,
|
||||
boolean inFullscreenMode, String requestWindowName) {
|
||||
boolean inFullscreenMode, String requestWindowName,
|
||||
@Nullable String imeControlTargetName, @Nullable String imeTargetName) {
|
||||
mClientState = client;
|
||||
mEditorInfo = editorInfo;
|
||||
mFocusedWindowName = focusedWindowName;
|
||||
@@ -833,6 +838,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
mWallTime = System.currentTimeMillis();
|
||||
mInFullscreenMode = inFullscreenMode;
|
||||
mRequestWindowName = requestWindowName;
|
||||
mImeControlTargetName = imeControlTargetName;
|
||||
mImeTargetNameFromWm = imeTargetName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -872,6 +879,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
pw.print(prefix);
|
||||
pw.println(" requestWindowName=" + entry.mRequestWindowName);
|
||||
|
||||
pw.print(prefix);
|
||||
pw.println(" imeControlTargetName=" + entry.mImeControlTargetName);
|
||||
|
||||
pw.print(prefix);
|
||||
pw.println(" imeTargetNameFromWm=" + entry.mImeTargetNameFromWm);
|
||||
|
||||
pw.print(prefix);
|
||||
pw.print(" editorInfo: ");
|
||||
pw.print(" inputType=" + entry.mEditorInfo.inputType);
|
||||
@@ -4123,7 +4136,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
mWindowManagerInternal.getWindowName(mCurFocusedWindow),
|
||||
mCurFocusedWindowSoftInputMode, reason, mInFullscreenMode,
|
||||
mWindowManagerInternal.getWindowName(
|
||||
mShowRequestWindowMap.get(args.arg3))));
|
||||
mShowRequestWindowMap.get(args.arg3)),
|
||||
mWindowManagerInternal.getImeControlTargetNameForLogging(
|
||||
mCurTokenDisplayId),
|
||||
mWindowManagerInternal.getImeTargetNameForLogging(
|
||||
mCurTokenDisplayId)));
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
args.recycle();
|
||||
@@ -4142,7 +4159,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
mWindowManagerInternal.getWindowName(mCurFocusedWindow),
|
||||
mCurFocusedWindowSoftInputMode, reason, mInFullscreenMode,
|
||||
mWindowManagerInternal.getWindowName(
|
||||
mHideRequestWindowMap.get(args.arg3))));
|
||||
mHideRequestWindowMap.get(args.arg3)),
|
||||
mWindowManagerInternal.getImeControlTargetNameForLogging(
|
||||
mCurTokenDisplayId),
|
||||
mWindowManagerInternal.getImeTargetNameForLogging(
|
||||
mCurTokenDisplayId)));
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
args.recycle();
|
||||
|
||||
@@ -576,4 +576,24 @@ public abstract class WindowManagerInternal {
|
||||
* @return The corresponding {@link WindowState#getName()}
|
||||
*/
|
||||
public abstract String getWindowName(@NonNull IBinder binder);
|
||||
|
||||
/**
|
||||
* Return the window name of IME Insets control target.
|
||||
*
|
||||
* @param displayId The ID of the display which input method is currently focused.
|
||||
* @return The corresponding {@link WindowState#getName()}
|
||||
*/
|
||||
public abstract @Nullable String getImeControlTargetNameForLogging(int displayId);
|
||||
|
||||
/**
|
||||
* Return the current window name of the input method is on top of.
|
||||
*
|
||||
* Note that the concept of this window is only reparent the target window behind the input
|
||||
* method window, it may different with the window which reported by
|
||||
* {@code InputMethodManagerService#reportStartInput} which has input connection.
|
||||
*
|
||||
* @param displayId The ID of the display which input method is currently focused.
|
||||
* @return The corresponding {@link WindowState#getName()}
|
||||
*/
|
||||
public abstract @Nullable String getImeTargetNameForLogging(int displayId);
|
||||
}
|
||||
|
||||
@@ -7755,6 +7755,33 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
return w != null ? w.getName() : null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getImeControlTargetNameForLogging(int displayId) {
|
||||
synchronized (mGlobalLock) {
|
||||
final DisplayContent dc = mRoot.getDisplayContent(displayId);
|
||||
if (dc == null) {
|
||||
return null;
|
||||
}
|
||||
final InsetsControlTarget target = dc.mInputMethodControlTarget;
|
||||
if (target == null) {
|
||||
return null;
|
||||
}
|
||||
final WindowState win = target.getWindow();
|
||||
return win != null ? win.getName() : target.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getImeTargetNameForLogging(int displayId) {
|
||||
synchronized (mGlobalLock) {
|
||||
final DisplayContent dc = mRoot.getDisplayContent(displayId);
|
||||
if (dc == null) {
|
||||
return null;
|
||||
}
|
||||
return dc.mInputMethodTarget != null ? dc.mInputMethodTarget.getName() : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void registerAppFreezeListener(AppFreezeListener listener) {
|
||||
|
||||
Reference in New Issue
Block a user