Merge "Removed deprecated APIs." into oc-dev

am: 4b91fe8699

Change-Id: Ib53e3dff14e748d5715dcf112e828fb0f80b87a2
This commit is contained in:
Felipe Leme
2017-05-12 20:19:32 +00:00
committed by android-build-merger
4 changed files with 6 additions and 91 deletions

View File

@@ -19,6 +19,7 @@ import android.os.PooledStringWriter;
import android.os.RemoteException;
import android.os.SystemClock;
import android.service.autofill.FillContext;
import android.service.autofill.FillRequest;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
@@ -494,7 +495,7 @@ public class AssistStructure implements Parcelable {
ViewNodeBuilder builder = new ViewNodeBuilder(assist, mRoot, false);
if ((root.getWindowFlags() & WindowManager.LayoutParams.FLAG_SECURE) != 0) {
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.onProvideAutofillStructure(builder, autofillFlags);
} else {
@@ -506,7 +507,7 @@ public class AssistStructure implements Parcelable {
}
}
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.dispatchProvideAutofillStructure(builder, autofillFlags);
} else {

View File

@@ -116,15 +116,7 @@ public abstract class AutofillService extends Service {
final IFillCallback callback = (IFillCallback) args.arg3;
final FillCallback fillCallback = new FillCallback(callback, request.getId());
args.recycle();
// TODO(b/37563972): temporary try-catch hack to support old method
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);
}
onFillRequest(request, cancellation, fillCallback);
break;
} case MSG_ON_SAVE_REQUEST: {
final SomeArgs args = (SomeArgs) msg.obj;
@@ -132,14 +124,7 @@ public abstract class AutofillService extends Service {
final ISaveCallback callback = (ISaveCallback) args.arg2;
final SaveCallback saveCallback = new SaveCallback(callback);
args.recycle();
// TODO(b/37563972): temporary try-catch hack to support old method
try {
onSaveRequest(request, saveCallback);
} catch (AbstractMethodError e) {
final List<FillContext> contexts = request.getFillContexts();
onSaveRequest(contexts.get(contexts.size() - 1).getStructure(),
request.getClientState(), saveCallback);
}
onSaveRequest(request, saveCallback);
break;
} case MSG_DISCONNECT: {
onDisconnected();
@@ -200,37 +185,6 @@ public abstract class AutofillService extends Service {
public abstract void onFillRequest(@NonNull FillRequest request,
@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}.
*
@@ -245,30 +199,6 @@ public abstract class AutofillService extends Service {
public abstract void onSaveRequest(@NonNull SaveRequest request,
@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.
*

View File

@@ -326,15 +326,6 @@ public final class SaveInfo implements Parcelable {
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.
*

View File

@@ -16,6 +16,7 @@
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.sVerbose;
@@ -99,14 +100,6 @@ public final class AutofillManager {
static final String SESSION_ID_TAG = "android:sessionId";
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_VIEW_ENTERED = 2;
/** @hide */ public static final int ACTION_VIEW_EXITED = 3;