diff options
| author | Yohei Yukawa <yukawa@google.com> | 2021-05-04 11:50:46 -0700 |
|---|---|---|
| committer | Yohei Yukawa <yukawa@google.com> | 2021-05-21 18:13:17 +0000 |
| commit | 44c499d853e3fd2619b05d21f9fbdd50802e9b6f (patch) | |
| tree | fe06905e5867689b521d58cd2a4b7196d4ed6ee5 /core/java/android | |
| parent | ea1518faf14a57b58da5f0648810b26b770e638b (diff) | |
Remove InputMethodManager#reportActivityView()
This CL logically reverts my previous CL [1], which re-enabled
CursorAnchorInfo API for ActivityView since ActivityView is finally
removed [2].
There should be no user/developer impact in this CL as
InputMethodManager#reportActivityView()
is called nowhere.
[1]: Id0411a80456182111bb5b681c6d1230b58e7ec2e
b4f328a2f30d425ecb3950064c3e2e26af8b7a35
[2]: Ic66f3740819634366edb20a34a7c8177af258c2f
5456990f7efec0d4707e13d6e0cd3beb728d7b8b
Bug: 115693908
Bug: 179161778
Test: atest CtsInputMethodTestCases
Test: atest CtsWindowManagerDeviceTestCases:ActivityViewTest
Change-Id: Idd60d96a39f827197d189beb5de016446576d9cd
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/inputmethod/InputMethodManager.java | 93 |
1 files changed, 1 insertions, 92 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 7eb840047c9f..b572d0871f12 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -49,7 +49,6 @@ import android.content.ComponentName; import android.content.ContentResolver; import android.content.Context; import android.content.pm.PackageManager; -import android.graphics.Matrix; import android.graphics.Rect; import android.inputmethodservice.InputMethodService; import android.os.Binder; @@ -443,17 +442,6 @@ public final class InputMethodManager { private CursorAnchorInfo mCursorAnchorInfo = null; /** - * A special {@link Matrix} that can be provided by the system when this instance is running - * inside a virtual display that is managed by {@link android.app.ActivityView}. - * - * <p>If this is non-{@code null}, {@link #updateCursorAnchorInfo(View, CursorAnchorInfo)} - * should be adjusted with this {@link Matrix}.</p> - * - * <p>{@code null} when not used.</p> - */ - private Matrix mActivityViewToScreenMatrix = null; - - /** * As reported by {@link InputBindResult}. This value is determined by * {@link com.android.internal.R.styleable#InputMethod_suppressesSpellChecking}. */ @@ -520,7 +508,6 @@ public final class InputMethodManager { static final int MSG_TIMEOUT_INPUT_EVENT = 6; static final int MSG_FLUSH_INPUT_EVENT = 7; static final int MSG_REPORT_FULLSCREEN_MODE = 10; - static final int MSG_UPDATE_ACTIVITY_VIEW_TO_SCREEN_MATRIX = 30; private static boolean isAutofillUIShowing(View servedView) { AutofillManager afm = servedView.getContext().getSystemService(AutofillManager.class); @@ -895,7 +882,6 @@ public final class InputMethodManager { InputMethodSessionWrapper.createOrNull(res.method); mCurId = res.id; mBindSequence = res.sequence; - mActivityViewToScreenMatrix = res.getActivityViewToScreenMatrix(); mIsInputMethodSuppressingSpellChecker = res.isInputMethodSuppressingSpellChecker; } @@ -1002,45 +988,6 @@ public final class InputMethodManager { } return; } - case MSG_UPDATE_ACTIVITY_VIEW_TO_SCREEN_MATRIX: { - final float[] matrixValues = (float[]) msg.obj; - final int bindSequence = msg.arg1; - synchronized (mH) { - if (mBindSequence != bindSequence) { - return; - } - if (matrixValues == null || mActivityViewToScreenMatrix == null) { - // Either InputBoundResult#mActivityViewToScreenMatrixValues is null - // OR this app is unbound from the parent ActivityView. In this case, - // calling updateCursorAnchorInfo() isn't safe. Only clear the matrix. - mActivityViewToScreenMatrix = null; - return; - } - - final float[] currentValues = new float[9]; - mActivityViewToScreenMatrix.getValues(currentValues); - if (Arrays.equals(currentValues, matrixValues)) { - return; - } - mActivityViewToScreenMatrix.setValues(matrixValues); - - if (mCursorAnchorInfo == null || mCurrentInputMethodSession == null - || mServedInputConnectionWrapper == null) { - return; - } - final boolean isMonitoring = (mRequestUpdateCursorAnchorInfoMonitorMode - & InputConnection.CURSOR_UPDATE_MONITOR) != 0; - if (!isMonitoring) { - return; - } - // Since the host ActivityView is moved, we need to issue - // IMS#updateCursorAnchorInfo() again. - mCurrentInputMethodSession.updateCursorAnchorInfo( - CursorAnchorInfo.createForAdditionalParentMatrix( - mCursorAnchorInfo, mActivityViewToScreenMatrix)); - } - return; - } } } } @@ -1096,12 +1043,6 @@ public final class InputMethodManager { } @Override - public void updateActivityViewToScreenMatrix(int bindSequence, float[] matrixValues) { - mH.obtainMessage(MSG_UPDATE_ACTIVITY_VIEW_TO_SCREEN_MATRIX, bindSequence, 0, - matrixValues).sendToTarget(); - } - - @Override public void setImeTraceEnabled(boolean enabled) { ImeTracing.getInstance().setEnabled(enabled); } @@ -1557,7 +1498,6 @@ public final class InputMethodManager { */ @UnsupportedAppUsage void finishInputLocked() { - mActivityViewToScreenMatrix = null; mIsInputMethodSuppressingSpellChecker = false; setNextServedViewLocked(null); if (getServedViewLocked() != null) { @@ -2110,7 +2050,6 @@ public final class InputMethodManager { + InputMethodDebug.startInputFlagsToString(startInputFlags)); return false; } - mActivityViewToScreenMatrix = res.getActivityViewToScreenMatrix(); mIsInputMethodSuppressingSpellChecker = res.isInputMethodSuppressingSpellChecker; if (res.id != null) { setInputChannelLocked(res.channel); @@ -2499,13 +2438,7 @@ public final class InputMethodManager { return; } if (DEBUG) Log.v(TAG, "updateCursorAnchorInfo: " + cursorAnchorInfo); - if (mActivityViewToScreenMatrix != null) { - mCurrentInputMethodSession.updateCursorAnchorInfo( - CursorAnchorInfo.createForAdditionalParentMatrix( - cursorAnchorInfo, mActivityViewToScreenMatrix)); - } else { - mCurrentInputMethodSession.updateCursorAnchorInfo(cursorAnchorInfo); - } + mCurrentInputMethodSession.updateCursorAnchorInfo(cursorAnchorInfo); mCursorAnchorInfo = cursorAnchorInfo; // Clear immediate bit (if any). mRequestUpdateCursorAnchorInfoMonitorMode &= ~InputConnection.CURSOR_UPDATE_IMMEDIATE; @@ -3097,30 +3030,6 @@ public final class InputMethodManager { } /** - * An internal API for {@link android.app.ActivityView} to report where its embedded virtual - * display is placed. - * - * @param childDisplayId Display ID of the embedded virtual display. - * @param matrix {@link Matrix} to convert virtual display screen coordinates to - * the host screen coordinates. {@code null} to clear the relationship. - * @hide - */ - public void reportActivityView(int childDisplayId, @Nullable Matrix matrix) { - try { - final float[] matrixValues; - if (matrix == null) { - matrixValues = null; - } else { - matrixValues = new float[9]; - matrix.getValues(matrixValues); - } - mService.reportActivityViewAsync(mClient, childDisplayId, matrixValues); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } - } - - /** * Force switch to the last used input method and subtype. If the last input method didn't have * any subtypes, the framework will simply switch to the last input method with no subtype * specified. |
