Refactor auto-fill
* Fix a layering issue where auto-fill manager which is in view
depended on activity which is in app
* Moved auto-fill classes to view or service based on their
purpose and removed dependecy on the classes in view to the
classes in service
* Push state to local auto-fill manager whether auto-fill is
enabled to avoid making IPC for every focus transition if
the user did not enable the feature
* Remove unnecessary offload to messages when handling calls
to auto-fill manager service as these are made over a oneway
interface and in general they do almost no work and typically
we do these on the binder thread
* Removed id from data set and fill response as the provider
can embed everything it needs to id them in the auth pending
intent
* Enforce the auth UI to be only an activity as this will work
with multi-window, recents, and back and also does not require
draw on top of other app special permission
* Authentication also no longer requires passing a remotable
callback to the auth activity but the activity handles the
request as if called for a result
* Handling stopping of a user to clean up in-memory state as
well as handling when a user gets unlocked as a provider may
be non-direct boot aware
* User the correct context when creating an auto-fill manager
* Move the receiver that listens for requests to hide system
windows to the manager service as the UI is a singleton and
no need every per-user state to register its own
* Removed extras from dataset as the only case a provider needs
to associate state with a dataset is for auth and the provider
can embed this data in the auth pending intent
Test: manual and CTS
Change-Id: I4bc54c13cf779d7f6fdb3ab894637f9fac73f603
diff --git a/core/java/android/service/autofill/FillCallback.java b/core/java/android/service/autofill/FillCallback.java
index a306809..69c9904 100644
--- a/core/java/android/service/autofill/FillCallback.java
+++ b/core/java/android/service/autofill/FillCallback.java
@@ -19,16 +19,13 @@
import android.annotation.Nullable;
import android.app.Activity;
import android.os.Bundle;
-import android.os.Parcel;
-import android.os.Parcelable;
import android.os.RemoteException;
-import android.view.autofill.FillResponse;
/**
* Handles auto-fill requests from the {@link AutoFillService} into the {@link Activity} being
* auto-filled.
*/
-public final class FillCallback implements Parcelable {
+public final class FillCallback {
private final IFillCallback mCallback;
private boolean mCalled;
@@ -37,11 +34,6 @@
mCallback = callback;
}
- /** @hide */
- private FillCallback(Parcel parcel) {
- mCallback = IFillCallback.Stub.asInterface(parcel.readStrongBinder());
- }
-
/**
* Notifies the Android System that an
* {@link AutoFillService#onFillRequest(android.app.assist.AssistStructure, Bundle,
@@ -79,33 +71,9 @@
}
}
- /** @hide */
- @Override
- public int describeContents() {
- return 0;
- }
-
- /** @hide */
- @Override
- public void writeToParcel(Parcel parcel, int flags) {
- parcel.writeStrongBinder(mCallback.asBinder());
- }
-
private void assertNotCalled() {
if (mCalled) {
throw new IllegalStateException("Already called");
}
}
-
- public static final Creator<FillCallback> CREATOR = new Creator<FillCallback>() {
- @Override
- public FillCallback createFromParcel(Parcel parcel) {
- return new FillCallback(parcel);
- }
-
- @Override
- public FillCallback[] newArray(int size) {
- return new FillCallback[size];
- }
- };
}