Merge "Removed deprecated APIs." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4b91fe8699
@@ -19,6 +19,7 @@ import android.os.PooledStringWriter;
|
|||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.service.autofill.FillContext;
|
import android.service.autofill.FillContext;
|
||||||
|
import android.service.autofill.FillRequest;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
@@ -494,7 +495,7 @@ public class AssistStructure implements Parcelable {
|
|||||||
ViewNodeBuilder builder = new ViewNodeBuilder(assist, mRoot, false);
|
ViewNodeBuilder builder = new ViewNodeBuilder(assist, mRoot, false);
|
||||||
if ((root.getWindowFlags() & WindowManager.LayoutParams.FLAG_SECURE) != 0) {
|
if ((root.getWindowFlags() & WindowManager.LayoutParams.FLAG_SECURE) != 0) {
|
||||||
if (forAutoFill) {
|
if (forAutoFill) {
|
||||||
final int autofillFlags = (flags & AutofillManager.FLAG_MANUAL_REQUEST) != 0
|
final int autofillFlags = (flags & FillRequest.FLAG_MANUAL_REQUEST) != 0
|
||||||
? View.AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS : 0;
|
? View.AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS : 0;
|
||||||
view.onProvideAutofillStructure(builder, autofillFlags);
|
view.onProvideAutofillStructure(builder, autofillFlags);
|
||||||
} else {
|
} else {
|
||||||
@@ -506,7 +507,7 @@ public class AssistStructure implements Parcelable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (forAutoFill) {
|
if (forAutoFill) {
|
||||||
final int autofillFlags = (flags & AutofillManager.FLAG_MANUAL_REQUEST) != 0
|
final int autofillFlags = (flags & FillRequest.FLAG_MANUAL_REQUEST) != 0
|
||||||
? View.AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS : 0;
|
? View.AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS : 0;
|
||||||
view.dispatchProvideAutofillStructure(builder, autofillFlags);
|
view.dispatchProvideAutofillStructure(builder, autofillFlags);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -116,15 +116,7 @@ public abstract class AutofillService extends Service {
|
|||||||
final IFillCallback callback = (IFillCallback) args.arg3;
|
final IFillCallback callback = (IFillCallback) args.arg3;
|
||||||
final FillCallback fillCallback = new FillCallback(callback, request.getId());
|
final FillCallback fillCallback = new FillCallback(callback, request.getId());
|
||||||
args.recycle();
|
args.recycle();
|
||||||
// TODO(b/37563972): temporary try-catch hack to support old method
|
onFillRequest(request, cancellation, fillCallback);
|
||||||
try {
|
|
||||||
onFillRequest(request, cancellation, fillCallback);
|
|
||||||
} catch (AbstractMethodError e) {
|
|
||||||
final List<FillContext> contexts = request.getFillContexts();
|
|
||||||
onFillRequest(contexts.get(contexts.size() - 1).getStructure(),
|
|
||||||
request.getClientState(), request.getFlags(), cancellation,
|
|
||||||
fillCallback);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
} case MSG_ON_SAVE_REQUEST: {
|
} case MSG_ON_SAVE_REQUEST: {
|
||||||
final SomeArgs args = (SomeArgs) msg.obj;
|
final SomeArgs args = (SomeArgs) msg.obj;
|
||||||
@@ -132,14 +124,7 @@ public abstract class AutofillService extends Service {
|
|||||||
final ISaveCallback callback = (ISaveCallback) args.arg2;
|
final ISaveCallback callback = (ISaveCallback) args.arg2;
|
||||||
final SaveCallback saveCallback = new SaveCallback(callback);
|
final SaveCallback saveCallback = new SaveCallback(callback);
|
||||||
args.recycle();
|
args.recycle();
|
||||||
// TODO(b/37563972): temporary try-catch hack to support old method
|
onSaveRequest(request, saveCallback);
|
||||||
try {
|
|
||||||
onSaveRequest(request, saveCallback);
|
|
||||||
} catch (AbstractMethodError e) {
|
|
||||||
final List<FillContext> contexts = request.getFillContexts();
|
|
||||||
onSaveRequest(contexts.get(contexts.size() - 1).getStructure(),
|
|
||||||
request.getClientState(), saveCallback);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
} case MSG_DISCONNECT: {
|
} case MSG_DISCONNECT: {
|
||||||
onDisconnected();
|
onDisconnected();
|
||||||
@@ -200,37 +185,6 @@ public abstract class AutofillService extends Service {
|
|||||||
public abstract void onFillRequest(@NonNull FillRequest request,
|
public abstract void onFillRequest(@NonNull FillRequest request,
|
||||||
@NonNull CancellationSignal cancellationSignal, @NonNull FillCallback callback);
|
@NonNull CancellationSignal cancellationSignal, @NonNull FillCallback callback);
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by the Android system do decide if an {@link Activity} can be autofilled by the
|
|
||||||
* service.
|
|
||||||
*
|
|
||||||
* <p>Service must call one of the {@link FillCallback} methods (like
|
|
||||||
* {@link FillCallback#onSuccess(FillResponse)}
|
|
||||||
* or {@link FillCallback#onFailure(CharSequence)})
|
|
||||||
* to notify the result of the request.
|
|
||||||
*
|
|
||||||
* @param structure {@link Activity}'s view structure.
|
|
||||||
* @param data bundle containing data passed by the service in a last call to
|
|
||||||
* {@link FillResponse.Builder#setExtras(Bundle)}, if any. This bundle allows your
|
|
||||||
* service to keep state between fill and save requests as well as when filling different
|
|
||||||
* sections of the UI as the system will try to aggressively unbind from the service to
|
|
||||||
* conserve resources.
|
|
||||||
* See {@link FillResponse} for examples of multiple-sections requests.
|
|
||||||
* @param flags either {@code 0} or {@link AutofillManager#FLAG_MANUAL_REQUEST}.
|
|
||||||
* @param cancellationSignal signal for observing cancellation requests. The system will use
|
|
||||||
* this to notify you that the fill result is no longer needed and you should stop
|
|
||||||
* handling this fill request in order to save resources.
|
|
||||||
* @param callback object used to notify the result of the request.
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void onFillRequest(@NonNull AssistStructure structure, @Nullable Bundle data,
|
|
||||||
int flags, @NonNull CancellationSignal cancellationSignal,
|
|
||||||
@NonNull FillCallback callback) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when user requests service to save the fields of an {@link Activity}.
|
* Called when user requests service to save the fields of an {@link Activity}.
|
||||||
*
|
*
|
||||||
@@ -245,30 +199,6 @@ public abstract class AutofillService extends Service {
|
|||||||
public abstract void onSaveRequest(@NonNull SaveRequest request,
|
public abstract void onSaveRequest(@NonNull SaveRequest request,
|
||||||
@NonNull SaveCallback callback);
|
@NonNull SaveCallback callback);
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when user requests service to save the fields of an {@link Activity}.
|
|
||||||
*
|
|
||||||
* <p>Service must call one of the {@link SaveCallback} methods (like
|
|
||||||
* {@link SaveCallback#onSuccess()} or {@link SaveCallback#onFailure(CharSequence)})
|
|
||||||
* to notify the result of the request.
|
|
||||||
*
|
|
||||||
* @param structure {@link Activity}'s view structure.
|
|
||||||
* @param data bundle containing data passed by the service in a last call to
|
|
||||||
* {@link FillResponse.Builder#setExtras(Bundle)}, if any. This bundle allows your
|
|
||||||
* service to keep state between fill and save requests as well as when filling different
|
|
||||||
* sections of the UI as the system will try to aggressively unbind from the service to
|
|
||||||
* conserve resources.
|
|
||||||
* See {@link FillResponse} for examples of multiple-sections requests.
|
|
||||||
* @param callback object used to notify the result of the request.
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void onSaveRequest(@NonNull AssistStructure structure, @Nullable Bundle data,
|
|
||||||
@NonNull SaveCallback callback) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the Android system disconnects from the service.
|
* Called when the Android system disconnects from the service.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -326,15 +326,6 @@ public final class SaveInfo implements Parcelable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
|
||||||
// TODO (b/37563972): Remove when callers migrate
|
|
||||||
public @NonNull Builder setNegativeAction(@Nullable CharSequence title,
|
|
||||||
@Nullable IntentSender listener) {
|
|
||||||
throwIfDestroyed();
|
|
||||||
setNegativeAction(NEGATIVE_BUTTON_STYLE_CANCEL, listener);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the style and listener for the negative save action.
|
* Sets the style and listener for the negative save action.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.view.autofill;
|
package android.view.autofill;
|
||||||
|
|
||||||
|
import static android.service.autofill.FillRequest.FLAG_MANUAL_REQUEST;
|
||||||
import static android.view.autofill.Helper.sDebug;
|
import static android.view.autofill.Helper.sDebug;
|
||||||
import static android.view.autofill.Helper.sVerbose;
|
import static android.view.autofill.Helper.sVerbose;
|
||||||
|
|
||||||
@@ -99,14 +100,6 @@ public final class AutofillManager {
|
|||||||
static final String SESSION_ID_TAG = "android:sessionId";
|
static final String SESSION_ID_TAG = "android:sessionId";
|
||||||
static final String LAST_AUTOFILLED_DATA_TAG = "android:lastAutoFilledData";
|
static final String LAST_AUTOFILLED_DATA_TAG = "android:lastAutoFilledData";
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link android.service.autofill.FillRequest#FLAG_MANUAL_REQUEST}
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
// TODO(b/37563972): remove (and change value of private flags)
|
|
||||||
@Deprecated
|
|
||||||
public static final int FLAG_MANUAL_REQUEST = 0x1;
|
|
||||||
|
|
||||||
/** @hide */ public static final int ACTION_START_SESSION = 1;
|
/** @hide */ public static final int ACTION_START_SESSION = 1;
|
||||||
/** @hide */ public static final int ACTION_VIEW_ENTERED = 2;
|
/** @hide */ public static final int ACTION_VIEW_ENTERED = 2;
|
||||||
/** @hide */ public static final int ACTION_VIEW_EXITED = 3;
|
/** @hide */ public static final int ACTION_VIEW_EXITED = 3;
|
||||||
|
|||||||
Reference in New Issue
Block a user