Loading Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,7 @@ 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 \ Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -36472,6 +36472,7 @@ 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(); api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -39395,6 +39395,7 @@ 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(); api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -36611,6 +36611,7 @@ 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(); core/java/android/service/autofill/AutoFillService.java +34 −10 Original line number Diff line number Diff line Loading @@ -15,9 +15,12 @@ */ package android.service.autofill; import android.accessibilityservice.IAccessibilityServiceConnection; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Message; import android.os.RemoteException; import android.view.accessibility.AccessibilityInteractionClient; import com.android.internal.os.HandlerCaller; import android.annotation.SdkConstant; import android.app.Activity; Loading Loading @@ -78,6 +81,15 @@ public abstract class AutoFillService extends Service { private static final int MSG_ON_SAVE_REQUEST = 4; private final IAutoFillService mInterface = new IAutoFillService.Stub() { @Override public void onInit(IAutoFillServiceConnection connection) { if (connection != null) { mHandlerCaller.obtainMessageO(MSG_CONNECT, connection).sendToTarget(); } else { mHandlerCaller.obtainMessage(MSG_DISCONNECT).sendToTarget(); } } @Override public void onFillRequest(AssistStructure structure, Bundle extras, IFillCallback callback) { Loading @@ -98,21 +110,12 @@ public abstract class AutoFillService extends Service { mHandlerCaller.obtainMessageOOO(MSG_ON_SAVE_REQUEST, structure, extras, callback).sendToTarget(); } @Override public void onConnected() { mHandlerCaller.sendMessage(mHandlerCaller.obtainMessage(MSG_CONNECT)); } @Override public void onDisconnected() { mHandlerCaller.sendMessage(mHandlerCaller.obtainMessage(MSG_DISCONNECT)); } }; private final HandlerCaller.Callback mHandlerCallback = (msg) -> { switch (msg.what) { case MSG_CONNECT: { mConnection = (IAutoFillServiceConnection) msg.obj; onConnected(); break; } case MSG_ON_FILL_REQUEST: { Loading @@ -136,6 +139,7 @@ public abstract class AutoFillService extends Service { break; } case MSG_DISCONNECT: { onDisconnected(); mConnection = null; break; } default: { Log.w(TAG, "MyCallbacks received invalid message type: " + msg); Loading @@ -145,6 +149,8 @@ public abstract class AutoFillService extends Service { private HandlerCaller mHandlerCaller; private IAutoFillServiceConnection mConnection; /** * {@inheritDoc} * Loading Loading @@ -223,4 +229,22 @@ public abstract class AutoFillService extends Service { public void onDisconnected() { //TODO(b/33197203): is not called anymore, fix it! } /** * 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> */ public final void disableSelf() { if (mConnection != null) { try { mConnection.disableSelf(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } } } Loading
Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,7 @@ 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 \ Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -36472,6 +36472,7 @@ 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();
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -39395,6 +39395,7 @@ 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();
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -36611,6 +36611,7 @@ 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();
core/java/android/service/autofill/AutoFillService.java +34 −10 Original line number Diff line number Diff line Loading @@ -15,9 +15,12 @@ */ package android.service.autofill; import android.accessibilityservice.IAccessibilityServiceConnection; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Message; import android.os.RemoteException; import android.view.accessibility.AccessibilityInteractionClient; import com.android.internal.os.HandlerCaller; import android.annotation.SdkConstant; import android.app.Activity; Loading Loading @@ -78,6 +81,15 @@ public abstract class AutoFillService extends Service { private static final int MSG_ON_SAVE_REQUEST = 4; private final IAutoFillService mInterface = new IAutoFillService.Stub() { @Override public void onInit(IAutoFillServiceConnection connection) { if (connection != null) { mHandlerCaller.obtainMessageO(MSG_CONNECT, connection).sendToTarget(); } else { mHandlerCaller.obtainMessage(MSG_DISCONNECT).sendToTarget(); } } @Override public void onFillRequest(AssistStructure structure, Bundle extras, IFillCallback callback) { Loading @@ -98,21 +110,12 @@ public abstract class AutoFillService extends Service { mHandlerCaller.obtainMessageOOO(MSG_ON_SAVE_REQUEST, structure, extras, callback).sendToTarget(); } @Override public void onConnected() { mHandlerCaller.sendMessage(mHandlerCaller.obtainMessage(MSG_CONNECT)); } @Override public void onDisconnected() { mHandlerCaller.sendMessage(mHandlerCaller.obtainMessage(MSG_DISCONNECT)); } }; private final HandlerCaller.Callback mHandlerCallback = (msg) -> { switch (msg.what) { case MSG_CONNECT: { mConnection = (IAutoFillServiceConnection) msg.obj; onConnected(); break; } case MSG_ON_FILL_REQUEST: { Loading @@ -136,6 +139,7 @@ public abstract class AutoFillService extends Service { break; } case MSG_DISCONNECT: { onDisconnected(); mConnection = null; break; } default: { Log.w(TAG, "MyCallbacks received invalid message type: " + msg); Loading @@ -145,6 +149,8 @@ public abstract class AutoFillService extends Service { private HandlerCaller mHandlerCaller; private IAutoFillServiceConnection mConnection; /** * {@inheritDoc} * Loading Loading @@ -223,4 +229,22 @@ public abstract class AutoFillService extends Service { public void onDisconnected() { //TODO(b/33197203): is not called anymore, fix it! } /** * 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> */ public final void disableSelf() { if (mConnection != null) { try { mConnection.disableSelf(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } } }