Merge "Fix IME callback not being re-registered on screen off / on." into tm-dev
This commit is contained in:
@@ -1625,7 +1625,6 @@ public class InputMethodService extends AbstractInputMethodService {
|
|||||||
// when IME developers are doing something unsupported.
|
// when IME developers are doing something unsupported.
|
||||||
InputMethodPrivilegedOperationsRegistry.remove(mToken);
|
InputMethodPrivilegedOperationsRegistry.remove(mToken);
|
||||||
}
|
}
|
||||||
unregisterCompatOnBackInvokedCallback();
|
|
||||||
mImeDispatcher = null;
|
mImeDispatcher = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2788,6 +2787,11 @@ public class InputMethodService extends AbstractInputMethodService {
|
|||||||
if (mInkWindow != null) {
|
if (mInkWindow != null) {
|
||||||
finishStylusHandwriting();
|
finishStylusHandwriting();
|
||||||
}
|
}
|
||||||
|
// Back callback is typically unregistered in {@link #hideWindow()}, but it's possible
|
||||||
|
// for {@link #doFinishInput()} to be called without {@link #hideWindow()} so we also
|
||||||
|
// unregister here.
|
||||||
|
// TODO(b/232341407): Add CTS to verify back behavior after screen on / off.
|
||||||
|
unregisterCompatOnBackInvokedCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
void doStartInput(InputConnection ic, EditorInfo attribute, boolean restarting) {
|
void doStartInput(InputConnection ic, EditorInfo attribute, boolean restarting) {
|
||||||
|
|||||||
@@ -158,6 +158,12 @@ public class ImeOnBackInvokedDispatcher implements OnBackInvokedDispatcher, Parc
|
|||||||
|
|
||||||
/** Clears all registered callbacks on the instance. */
|
/** Clears all registered callbacks on the instance. */
|
||||||
public void clear() {
|
public void clear() {
|
||||||
|
// Unregister previously registered callbacks if there's any.
|
||||||
|
if (getReceivingDispatcher() != null) {
|
||||||
|
for (OnBackInvokedCallback callback : mImeCallbackMap.values()) {
|
||||||
|
getReceivingDispatcher().unregisterOnBackInvokedCallback(callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
mImeCallbackMap.clear();
|
mImeCallbackMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user