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

Commit e6623e5b authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Added APIs that let AutofillService implementations set themselves as...

Merge "Added APIs that let AutofillService implementations set themselves as such." into oc-dev am: fc513f98
am: 535422c8

Change-Id: I978f429f100af65df6483364a90e29fc26ae0379
parents 5c5b6dae 535422c8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -34944,6 +34944,7 @@ package android.provider {
    field public static final java.lang.String ACTION_PRIVACY_SETTINGS = "android.settings.PRIVACY_SETTINGS";
    field public static final java.lang.String ACTION_QUICK_LAUNCH_SETTINGS = "android.settings.QUICK_LAUNCH_SETTINGS";
    field public static final java.lang.String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
    field public static final java.lang.String ACTION_REQUEST_SET_AUTOFILL_SERVICE = "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
    field public static final java.lang.String ACTION_SEARCH_SETTINGS = "android.search.action.SEARCH_SETTINGS";
    field public static final java.lang.String ACTION_SECURITY_SETTINGS = "android.settings.SECURITY_SETTINGS";
    field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";
@@ -47844,6 +47845,8 @@ package android.view.autofill {
    method public void cancel();
    method public void commit();
    method public void disableOwnedAutofillServices();
    method public boolean hasEnabledAutofillServices();
    method public boolean isAutofillSupported();
    method public boolean isEnabled();
    method public void notifyValueChanged(android.view.View);
    method public void notifyValueChanged(android.view.View, int, android.view.autofill.AutofillValue);
+3 −0
Original line number Diff line number Diff line
@@ -38037,6 +38037,7 @@ package android.provider {
    field public static final java.lang.String ACTION_PRIVACY_SETTINGS = "android.settings.PRIVACY_SETTINGS";
    field public static final java.lang.String ACTION_QUICK_LAUNCH_SETTINGS = "android.settings.QUICK_LAUNCH_SETTINGS";
    field public static final java.lang.String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
    field public static final java.lang.String ACTION_REQUEST_SET_AUTOFILL_SERVICE = "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
    field public static final java.lang.String ACTION_SEARCH_SETTINGS = "android.search.action.SEARCH_SETTINGS";
    field public static final java.lang.String ACTION_SECURITY_SETTINGS = "android.settings.SECURITY_SETTINGS";
    field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";
@@ -51429,6 +51430,8 @@ package android.view.autofill {
    method public void cancel();
    method public void commit();
    method public void disableOwnedAutofillServices();
    method public boolean hasEnabledAutofillServices();
    method public boolean isAutofillSupported();
    method public boolean isEnabled();
    method public void notifyValueChanged(android.view.View);
    method public void notifyValueChanged(android.view.View, int, android.view.autofill.AutofillValue);
+3 −0
Original line number Diff line number Diff line
@@ -35081,6 +35081,7 @@ package android.provider {
    field public static final java.lang.String ACTION_PRIVACY_SETTINGS = "android.settings.PRIVACY_SETTINGS";
    field public static final java.lang.String ACTION_QUICK_LAUNCH_SETTINGS = "android.settings.QUICK_LAUNCH_SETTINGS";
    field public static final java.lang.String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
    field public static final java.lang.String ACTION_REQUEST_SET_AUTOFILL_SERVICE = "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
    field public static final java.lang.String ACTION_SEARCH_SETTINGS = "android.search.action.SEARCH_SETTINGS";
    field public static final java.lang.String ACTION_SECURITY_SETTINGS = "android.settings.SECURITY_SETTINGS";
    field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";
@@ -48239,6 +48240,8 @@ package android.view.autofill {
    method public void cancel();
    method public void commit();
    method public void disableOwnedAutofillServices();
    method public boolean hasEnabledAutofillServices();
    method public boolean isAutofillSupported();
    method public boolean isEnabled();
    method public void notifyValueChanged(android.view.View);
    method public void notifyValueChanged(android.view.View, int, android.view.autofill.AutofillValue);
+20 −0
Original line number Diff line number Diff line
@@ -1398,6 +1398,26 @@ public final class Settings {
    public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
            = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";

    /**
     * Activity Action: Show screen that let user select its Autofill Service.
     * <p>
     * Input: Intent's data URI set with an application name, using the
     * "package" schema (like "package:com.my.app").
     *
     * <p>
     * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
     * to the caller package.
     *
     * <p>
     * <b>NOTE: </b> applications should call
     * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
     * {@link android.view.autofill.AutofillManager#isAutofillSupported()} first, and only
     * broadcast this intent if they return {@code false} and {@code true} respectively.
     */
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
            "android.settings.REQUEST_SET_AUTOFILL_SERVICE";

    // End of Intent actions for Settings

    /**
+33 −0
Original line number Diff line number Diff line
@@ -659,6 +659,39 @@ public final class AutofillManager {
        }
    }

    /**
     * Returns {@code true} if the calling application provides a {@link AutofillService} that is
     * enabled for the current user, or {@code false} otherwise.
     */
    public boolean hasEnabledAutofillServices() {
        if (mService == null) return false;

        try {
            return mService.isServiceEnabled(mContext.getUserId(), mContext.getPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Returns {@code true} if Autofill is supported for this user.
     *
     * <p>Autofill is typically supported, but it could be unsupported in cases like:
     * <ol>
     *     <li>Low-end devices.
     *     <li>Device policy rules that forbid its usage.
     * </ol>
     */
    public boolean isAutofillSupported() {
        if (mService == null) return false;

        try {
            return mService.isServiceSupported(mContext.getUserId());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    private AutofillClient getClientLocked() {
        if (mContext instanceof AutofillClient) {
            return (AutofillClient) mContext;
Loading