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

Commit 7a6df3b7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Move API for disabling an autofill service to the manager" into oc-dev

parents 068b429c f20a037b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -273,7 +273,6 @@ LOCAL_SRC_FILES += \
	core/java/android/security/IKeystoreService.aidl \
	core/java/android/security/keymaster/IKeyAttestationApplicationIdProvider.aidl \
	core/java/android/service/autofill/IAutoFillService.aidl \
	core/java/android/service/autofill/IAutoFillServiceConnection.aidl \
	core/java/android/service/autofill/IFillCallback.aidl \
	core/java/android/service/autofill/ISaveCallback.aidl \
	core/java/android/service/carrier/ICarrierService.aidl \
+1 −1
Original line number Diff line number Diff line
@@ -36986,7 +36986,6 @@ package android.service.autofill {
  public abstract class AutofillService extends android.app.Service {
    ctor public AutofillService();
    method public final void disableSelf();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public void onConnected();
    method public void onDisconnected();
@@ -47732,6 +47731,7 @@ package android.view.autofill {
  public final class AutofillManager {
    method public void cancel();
    method public void commit();
    method public void disableOwnedAutofillServices();
    method public boolean isEnabled();
    method public void notifyValueChanged(android.view.View);
    method public void notifyValueChanged(android.view.View, int, android.view.autofill.AutofillValue);
+1 −1
Original line number Diff line number Diff line
@@ -40082,7 +40082,6 @@ package android.service.autofill {
  public abstract class AutofillService extends android.app.Service {
    ctor public AutofillService();
    method public final void disableSelf();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public void onConnected();
    method public void onDisconnected();
@@ -51284,6 +51283,7 @@ package android.view.autofill {
  public final class AutofillManager {
    method public void cancel();
    method public void commit();
    method public void disableOwnedAutofillServices();
    method public boolean isEnabled();
    method public void notifyValueChanged(android.view.View);
    method public void notifyValueChanged(android.view.View, int, android.view.autofill.AutofillValue);
+1 −1
Original line number Diff line number Diff line
@@ -37144,7 +37144,6 @@ package android.service.autofill {
  public abstract class AutofillService extends android.app.Service {
    ctor public AutofillService();
    method public final void disableSelf();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public void onConnected();
    method public void onDisconnected();
@@ -48114,6 +48113,7 @@ package android.view.autofill {
  public final class AutofillManager {
    method public void cancel();
    method public void commit();
    method public void disableOwnedAutofillServices();
    method public boolean isEnabled();
    method public void notifyValueChanged(android.view.View);
    method public void notifyValueChanged(android.view.View, int, android.view.autofill.AutofillValue);
+6 −22
Original line number Diff line number Diff line
@@ -94,9 +94,9 @@ public abstract class AutofillService extends Service {

    private final IAutoFillService mInterface = new IAutoFillService.Stub() {
        @Override
        public void onInit(IAutoFillServiceConnection connection) {
            if (connection != null) {
                mHandlerCaller.obtainMessageO(MSG_CONNECT, connection).sendToTarget();
        public void onConnectedStateChanged(boolean connected) {
            if (connected) {
                mHandlerCaller.obtainMessage(MSG_CONNECT).sendToTarget();
            } else {
                mHandlerCaller.obtainMessage(MSG_DISCONNECT).sendToTarget();
            }
@@ -127,7 +127,6 @@ public abstract class AutofillService extends Service {
    private final HandlerCaller.Callback mHandlerCallback = (msg) -> {
        switch (msg.what) {
            case MSG_CONNECT: {
                mConnection = (IAutoFillServiceConnection) msg.obj;
                onConnected();
                break;
            } case MSG_ON_FILL_REQUEST: {
@@ -152,7 +151,6 @@ public abstract class AutofillService extends Service {
                break;
            } case MSG_DISCONNECT: {
                onDisconnected();
                mConnection = null;
                break;
            } default: {
                Log.w(TAG, "MyCallbacks received invalid message type: " + msg);
@@ -162,8 +160,6 @@ public abstract class AutofillService extends Service {

    private HandlerCaller mHandlerCaller;

    private IAutoFillServiceConnection mConnection;

    /**
     * {@inheritDoc}
     *
@@ -246,21 +242,9 @@ public abstract class AutofillService extends Service {
    public void onDisconnected() {
    }

    /**
     * Disables the service. After calling this method, the service will
     * be disabled and settings will show that it is turned off.
     *
     * <p>You should call this method only after a call to {@link #onConnected()}
     * and before the corresponding call to {@link #onDisconnected()}. In other words
     * you can disable your service only while the system is connected to it.</p>
     */
    /** @hide */
    public final void disableSelf() {
        if (mConnection != null) {
            try {
                mConnection.disableSelf();
            } catch (RemoteException re) {
                throw re.rethrowFromSystemServer();
            }
        }
        // TODO(b/33197203): Remove when GCore has migrated off this API
        getSystemService(AutofillManager.class).disableOwnedAutofillServices();
    }
}
Loading