Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 333cfbf5 authored by Reema Bajwa's avatar Reema Bajwa
Browse files

Rename API as per API Council review

Bug: 326419480
Test: Cts

Change-Id: I113c2712400be6b7966bc32a31fc995fdecbe74a
parent 85457f97
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -52446,8 +52446,8 @@ package android.view {
    method public final void cancelPendingInputEvents();
    method public boolean checkInputConnectionProxy(android.view.View);
    method public void clearAnimation();
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void clearCredentialManagerRequest();
    method public void clearFocus();
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void clearPendingCredentialRequest();
    method public void clearViewTranslationCallback();
    method public static int combineMeasuredStates(int, int);
    method protected int computeHorizontalScrollExtent();
@@ -52556,8 +52556,6 @@ package android.view {
    method @FlaggedApi("android.view.flags.sensitive_content_app_protection_api") public final int getContentSensitivity();
    method @UiContext public final android.content.Context getContext();
    method protected android.view.ContextMenu.ContextMenuInfo getContextMenuInfo();
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public final android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException> getCredentialManagerCallback();
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public final android.credentials.GetCredentialRequest getCredentialManagerRequest();
    method public final boolean getDefaultFocusHighlightEnabled();
    method public static int getDefaultSize(int, int);
    method public android.view.Display getDisplay();
@@ -52642,6 +52640,8 @@ package android.view {
    method public int getPaddingTop();
    method public final android.view.ViewParent getParent();
    method public android.view.ViewParent getParentForAccessibility();
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public final android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException> getPendingCredentialCallback();
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public final android.credentials.GetCredentialRequest getPendingCredentialRequest();
    method public float getPivotX();
    method public float getPivotY();
    method public android.view.PointerIcon getPointerIcon();
@@ -52942,7 +52942,6 @@ package android.view {
    method public void setContentDescription(CharSequence);
    method @FlaggedApi("android.view.flags.sensitive_content_app_protection_api") public final void setContentSensitivity(int);
    method public void setContextClickable(boolean);
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void setCredentialManagerRequest(@NonNull android.credentials.GetCredentialRequest, @NonNull android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>);
    method public void setDefaultFocusHighlightEnabled(boolean);
    method @Deprecated public void setDrawingCacheBackgroundColor(@ColorInt int);
    method @Deprecated public void setDrawingCacheEnabled(boolean);
@@ -53021,6 +53020,7 @@ package android.view {
    method public void setOverScrollMode(int);
    method public void setPadding(int, int, int, int);
    method public void setPaddingRelative(int, int, int, int);
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void setPendingCredentialRequest(@NonNull android.credentials.GetCredentialRequest, @NonNull android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>);
    method public void setPivotX(float);
    method public void setPivotY(float);
    method public void setPointerIcon(android.view.PointerIcon);
@@ -53824,10 +53824,10 @@ package android.view {
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void clearCredentialManagerRequest();
    method @Nullable public abstract android.view.autofill.AutofillId getAutofillId();
    method public abstract int getChildCount();
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException> getCredentialManagerCallback();
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public android.credentials.GetCredentialRequest getCredentialManagerRequest();
    method public abstract android.os.Bundle getExtras();
    method public abstract CharSequence getHint();
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException> getPendingCredentialCallback();
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public android.credentials.GetCredentialRequest getPendingCredentialRequest();
    method public abstract CharSequence getText();
    method public abstract int getTextSelectionEnd();
    method public abstract int getTextSelectionStart();
@@ -53850,7 +53850,6 @@ package android.view {
    method public abstract void setClickable(boolean);
    method public abstract void setContentDescription(CharSequence);
    method public abstract void setContextClickable(boolean);
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void setCredentialManagerRequest(@NonNull android.credentials.GetCredentialRequest, @NonNull android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>);
    method public abstract void setDataIsSensitive(boolean);
    method public abstract void setDimens(int, int, int, int, int, int);
    method public abstract void setElevation(float);
@@ -53869,6 +53868,7 @@ package android.view {
    method public void setMaxTextLength(int);
    method public void setMinTextEms(int);
    method public abstract void setOpaque(boolean);
    method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void setPendingCredentialRequest(@NonNull android.credentials.GetCredentialRequest, @NonNull android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>);
    method public void setReceiveContentMimeTypes(@Nullable String[]);
    method public abstract void setSelected(boolean);
    method public abstract void setText(CharSequence);
+6 −6
Original line number Diff line number Diff line
@@ -1297,7 +1297,7 @@ public class AssistStructure implements Parcelable {
         */
        @FlaggedApi(FLAG_AUTOFILL_CREDMAN_DEV_INTEGRATION)
        @Nullable
        public GetCredentialRequest getCredentialManagerRequest() {
        public GetCredentialRequest getPendingCredentialRequest() {
            return mGetCredentialRequest;
        }

@@ -1306,7 +1306,7 @@ public class AssistStructure implements Parcelable {
         */
        @FlaggedApi(FLAG_AUTOFILL_CREDMAN_DEV_INTEGRATION)
        @Nullable
        public ResultReceiver getCredentialManagerCallback() {
        public ResultReceiver getPendingCredentialCallback() {
            return mGetCredentialResultReceiver;
        }

@@ -2191,14 +2191,14 @@ public class AssistStructure implements Parcelable {

        @Nullable
        @Override
        public GetCredentialRequest getCredentialManagerRequest() {
        public GetCredentialRequest getPendingCredentialRequest() {
            return mNode.mGetCredentialRequest;
        }

        @Nullable
        @Override
        public OutcomeReceiver<
                GetCredentialResponse, GetCredentialException> getCredentialManagerCallback() {
                GetCredentialResponse, GetCredentialException> getPendingCredentialCallback() {
            return mNode.mGetCredentialCallback;
        }

@@ -2267,7 +2267,7 @@ public class AssistStructure implements Parcelable {
        }

        @Override
        public void setCredentialManagerRequest(@NonNull GetCredentialRequest request,
        public void setPendingCredentialRequest(@NonNull GetCredentialRequest request,
                @NonNull OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {
            mNode.mGetCredentialRequest = request;
            mNode.mGetCredentialCallback = callback;
@@ -2654,7 +2654,7 @@ public class AssistStructure implements Parcelable {
                    + ", isCredential=" + node.isCredential()
            );
        }
        GetCredentialRequest getCredentialRequest = node.getCredentialManagerRequest();
        GetCredentialRequest getCredentialRequest = node.getPendingCredentialRequest();
        if (getCredentialRequest == null) {
            Log.i(TAG, prefix + " No Credential Manager Request");
        } else {
+16 −16
Original line number Diff line number Diff line
@@ -7057,16 +7057,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    /**
     * Clears the request and callback previously set
     * through {@link View#setCredentialManagerRequest}.
     * through {@link View#setPendingCredentialRequest}.
     * Once this API is invoked, there will be no request fired to {@link CredentialManager}
     * on future view focus events.
     *
     * @see #setCredentialManagerRequest
     * @see #setPendingCredentialRequest
     */
    @FlaggedApi(FLAG_AUTOFILL_CREDMAN_DEV_INTEGRATION)
    public void clearCredentialManagerRequest() {
    public void clearPendingCredentialRequest() {
        if (Log.isLoggable(AUTOFILL_LOG_TAG, Log.VERBOSE)) {
            Log.v(AUTOFILL_LOG_TAG, "clearCredentialManagerRequest called");
            Log.v(AUTOFILL_LOG_TAG, "clearPendingCredentialRequest called");
        }
        mViewCredentialHandler = null;
    }
@@ -7096,7 +7096,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *                 propagated for the given view
     */
    @FlaggedApi(FLAG_AUTOFILL_CREDMAN_DEV_INTEGRATION)
    public void setCredentialManagerRequest(@NonNull GetCredentialRequest request,
    public void setPendingCredentialRequest(@NonNull GetCredentialRequest request,
            @NonNull OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {
        Preconditions.checkNotNull(request, "request must not be null");
        Preconditions.checkNotNull(callback, "request must not be null");
@@ -9590,7 +9590,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                structure.setIsCredential(isCredential());
            }
            if (getViewCredentialHandler() != null) {
                structure.setCredentialManagerRequest(
                structure.setPendingCredentialRequest(
                        getViewCredentialHandler().getRequest(),
                        getViewCredentialHandler().getCallback());
            }
@@ -9995,22 +9995,22 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @hide
     */
    public void onGetCredentialResponse(GetCredentialResponse response) {
        if (getCredentialManagerCallback() == null) {
        if (getPendingCredentialCallback() == null) {
            Log.w(AUTOFILL_LOG_TAG, "onGetCredentialResponse called but no callback found");
            return;
        }
        getCredentialManagerCallback().onResult(response);
        getPendingCredentialCallback().onResult(response);
    }
    /**
     * @hide
     */
    public void onGetCredentialException(String errorType, String errorMsg) {
        if (getCredentialManagerCallback() == null) {
        if (getPendingCredentialCallback() == null) {
            Log.w(AUTOFILL_LOG_TAG, "onGetCredentialException called but no callback found");
            return;
        }
        getCredentialManagerCallback().onError(new GetCredentialException(errorType, errorMsg));
        getPendingCredentialCallback().onError(new GetCredentialException(errorType, errorMsg));
    }
    /**
@@ -10041,13 +10041,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * the active {@link android.service.autofill.AutofillService} on
     * the device.
     *
     * <p>See {@link #setCredentialManagerRequest} for more info.
     * <p>See {@link #setPendingCredentialRequest} for more info.
     *
     * @return The credential request associated with this View.
     */
    @FlaggedApi(FLAG_AUTOFILL_CREDMAN_DEV_INTEGRATION)
    @Nullable
    public final GetCredentialRequest getCredentialManagerRequest() {
    public final GetCredentialRequest getPendingCredentialRequest() {
        if (mViewCredentialHandler == null) {
            return null;
        }
@@ -10057,14 +10057,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    /**
     * Returns the callback that has previously been set up on this view through
     * the {@link #setCredentialManagerRequest} API.
     * the {@link #setPendingCredentialRequest} API.
     * If the return value is null, that means no callback, or request, has been set
     * on the view and no {@link CredentialManager} flow will be invoked
     * when this view is focused. Traditioanl autofill flows will still
     * work, and autofillable content will still be returned through the
     * {@link #autofill(AutofillValue)} )} API.
     *
     * <p>See {@link #setCredentialManagerRequest} for more info.
     * <p>See {@link #setPendingCredentialRequest} for more info.
     *
     * @return The callback associated with this view that will be invoked on a response from
     * {@link CredentialManager} .
@@ -10072,7 +10072,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    @FlaggedApi(FLAG_AUTOFILL_CREDMAN_DEV_INTEGRATION)
    @Nullable
    public final OutcomeReceiver<GetCredentialResponse,
            GetCredentialException> getCredentialManagerCallback() {
            GetCredentialException> getPendingCredentialCallback() {
        if (mViewCredentialHandler == null) {
            return null;
        }
@@ -11002,7 +11002,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                    AccessibilityNodeInfo.getVirtualDescendantId(info.getSourceNodeId())));
        }
        if (getViewCredentialHandler() != null) {
            structure.setCredentialManagerRequest(
            structure.setPendingCredentialRequest(
                    getViewCredentialHandler().getRequest(),
                    getViewCredentialHandler().getCallback());
        }
+6 −6
Original line number Diff line number Diff line
@@ -361,11 +361,11 @@ public abstract class ViewStructure {
     * {@link android.credentials.CredentialManager} request will be fired when this
     * node is focused.
     * <p> For details on how a request and callback can be set, see
     * {@link ViewStructure#setCredentialManagerRequest(GetCredentialRequest, OutcomeReceiver)}
     * {@link ViewStructure#setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)}
     */
    @Nullable
    @FlaggedApi(FLAG_AUTOFILL_CREDMAN_DEV_INTEGRATION)
    public GetCredentialRequest getCredentialManagerRequest() {
    public GetCredentialRequest getPendingCredentialRequest() {
        return null;
    }

@@ -376,12 +376,12 @@ public abstract class ViewStructure {
     * {@link android.credentials.CredentialManager} request will be fired when this
     * node is focused.
     * <p> For details on how a request and callback can be set, see
     * {@link ViewStructure#setCredentialManagerRequest(GetCredentialRequest, OutcomeReceiver)}
     * {@link ViewStructure#setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)}
     */
    @Nullable
    @FlaggedApi(FLAG_AUTOFILL_CREDMAN_DEV_INTEGRATION)
    public OutcomeReceiver<
            GetCredentialResponse, GetCredentialException> getCredentialManagerCallback() {
            GetCredentialResponse, GetCredentialException> getPendingCredentialCallback() {
        return null;
    }

@@ -555,12 +555,12 @@ public abstract class ViewStructure {
     * @param callback the callback where the response or exception, is returned
     */
    @FlaggedApi(FLAG_AUTOFILL_CREDMAN_DEV_INTEGRATION)
    public void setCredentialManagerRequest(@NonNull GetCredentialRequest request,
    public void setPendingCredentialRequest(@NonNull GetCredentialRequest request,
            @NonNull OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback) {}

    /**
     * Clears the credential request previously set through
     * {@link ViewStructure#setCredentialManagerRequest(GetCredentialRequest, OutcomeReceiver)}
     * {@link ViewStructure#setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)}
     */
    @FlaggedApi(FLAG_AUTOFILL_CREDMAN_DEV_INTEGRATION)
    public void clearCredentialManagerRequest() {}
+15 −12
Original line number Diff line number Diff line
@@ -266,8 +266,8 @@ public class AssistStructureTest {
        assertThat(view.getViewRootImpl()).isNotNull();
        ViewNodeBuilder viewStructure = new ViewNodeBuilder();
        viewStructure.setAutofillId(view.getAutofillId());
        viewStructure.setCredentialManagerRequest(view.getCredentialManagerRequest(),
                view.getCredentialManagerCallback());
        viewStructure.setPendingCredentialRequest(view.getPendingCredentialRequest(),
                view.getPendingCredentialCallback());
        view.onProvideAutofillStructure(viewStructure, /* flags= */ 0);
        ViewNodeParcelable viewNodeParcelable = new ViewNodeParcelable(viewStructure.getViewNode());

@@ -289,17 +289,20 @@ public class AssistStructureTest {

        assertThat(view.getViewRootImpl()).isNotNull();
        ViewNodeBuilder viewStructure = new ViewNodeBuilder();
        viewStructure.setCredentialManagerRequest(view.getCredentialManagerRequest(),
                view.getCredentialManagerCallback());
        if (view.getPendingCredentialRequest() != null
                && view.getPendingCredentialCallback() != null) {
            viewStructure.setPendingCredentialRequest(view.getPendingCredentialRequest(),
                    view.getPendingCredentialCallback());
        }

        assertEquals(viewStructure.getCredentialManagerRequest(), GET_CREDENTIAL_REQUEST);
        assertEquals(viewStructure.getCredentialManagerCallback(),
        assertEquals(viewStructure.getPendingCredentialRequest(), GET_CREDENTIAL_REQUEST);
        assertEquals(viewStructure.getPendingCredentialCallback(),
                GET_CREDENTIAL_REQUEST_CALLBACK);

        viewStructure.clearCredentialManagerRequest();

        assertNull(viewStructure.getCredentialManagerRequest());
        assertNull(viewStructure.getCredentialManagerCallback());
        assertNull(viewStructure.getPendingCredentialRequest());
        assertNull(viewStructure.getPendingCredentialCallback());
    }

    @Test
@@ -386,14 +389,14 @@ public class AssistStructureTest {
        EditText view = new EditText(mContext);
        view.setText("Big Hint in Little View");
        view.setAutofillHints(BIG_STRING);
        view.setCredentialManagerRequest(GET_CREDENTIAL_REQUEST, GET_CREDENTIAL_REQUEST_CALLBACK);
        view.setPendingCredentialRequest(GET_CREDENTIAL_REQUEST, GET_CREDENTIAL_REQUEST_CALLBACK);
        return view;
    }

    private EditText newCredentialView() {
        EditText view = new EditText(mContext);
        view.setText("Credential Request");
        view.setCredentialManagerRequest(GET_CREDENTIAL_REQUEST, GET_CREDENTIAL_REQUEST_CALLBACK);
        view.setPendingCredentialRequest(GET_CREDENTIAL_REQUEST, GET_CREDENTIAL_REQUEST_CALLBACK);
        return view;
    }

@@ -421,8 +424,8 @@ public class AssistStructureTest {
        assertThat(view.getAutofillId()).isNotNull();
        assertThat(view.getText().toString()).isEqualTo("Big Hint in Little View");

        assertThat(view.getCredentialManagerRequest()).isEqualTo(GET_CREDENTIAL_REQUEST);
        assertThat(view.getCredentialManagerCallback()).isEqualTo(GET_CREDENTIAL_REQUEST_CALLBACK);
        assertThat(view.getPendingCredentialRequest()).isEqualTo(GET_CREDENTIAL_REQUEST);
        assertThat(view.getPendingCredentialCallback()).isEqualTo(GET_CREDENTIAL_REQUEST_CALLBACK);
    }

    /**
Loading