diff options
23 files changed, 45 insertions, 141 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index e4d2d132fced..2843dc226416 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -696,9 +696,6 @@ public class Activity extends ContextThemeWrapper private static final String TAG = "Activity"; private static final boolean DEBUG_LIFECYCLE = false; - // TODO(b/33197203): set to false once stable - private static final boolean DEBUG_AUTO_FILL = true; - /** Standard activity result: operation canceled. */ public static final int RESULT_CANCELED = 0; /** Standard activity result: operation succeeded. */ diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 5022d7d9622b..46ce94f36341 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -3004,7 +3004,7 @@ public final class ActivityThread { // - it needs an IAutoFillCallback boolean forAutofill = cmd.requestType == ActivityManager.ASSIST_CONTEXT_AUTOFILL; - // TODO(b/33197203): decide if lastSessionId logic applies to autofill sessions + // TODO: decide if lastSessionId logic applies to autofill sessions if (mLastSessionId != cmd.sessionId) { // Clear the existing structures mLastSessionId = cmd.sessionId; @@ -3032,8 +3032,6 @@ public final class ActivityThread { if (cmd.requestType == ActivityManager.ASSIST_CONTEXT_FULL || forAutofill) { structure = new AssistStructure(r.activity, forAutofill); Intent activityIntent = r.activity.getIntent(); - // TODO(b/33197203): re-evaluate conditions below for autofill. In particular, - // FLAG_SECURE might be allowed on AUTO_FILL but not on AUTO_FILL_SAVE) boolean notSecure = r.window == null || (r.window.getAttributes().flags & WindowManager.LayoutParams.FLAG_SECURE) == 0; @@ -3059,7 +3057,7 @@ public final class ActivityThread { structure = new AssistStructure(); } - // TODO(b/33197203): decide if lastSessionId logic applies to autofill sessions + // TODO: decide if lastSessionId logic applies to autofill sessions structure.setAcquisitionStartTime(startTime); structure.setAcquisitionEndTime(SystemClock.uptimeMillis()); diff --git a/core/java/android/app/assist/AssistStructure.java b/core/java/android/app/assist/AssistStructure.java index 7c1bcf08ad63..d757f3edd892 100644 --- a/core/java/android/app/assist/AssistStructure.java +++ b/core/java/android/app/assist/AssistStructure.java @@ -600,7 +600,7 @@ public class AssistStructure implements Parcelable { String mIdType; String mIdEntry; - // TODO(b/33197203): once we have more flags, it might be better to store the individual + // TODO: once we have more flags, it might be better to store the individual // fields (viewId and childId) of the field. AutofillId mAutofillId; @View.AutofillType int mAutofillType = View.AUTOFILL_TYPE_NONE; @@ -639,7 +639,7 @@ public class AssistStructure implements Parcelable { static final int FLAGS_CONTEXT_CLICKABLE = 0x00004000; static final int FLAGS_OPAQUE = 0x00008000; - // TODO(b/33197203): autofill data is made of many fields and ideally we should verify + // TODO: autofill data is made of many fields and ideally we should verify // one-by-one to optimize what's sent over, but there isn't enough flag bits for that, we'd // need to create a 'flags2' or 'autoFillFlags' field and add these flags there. // So, to keep thinkg simpler for now, let's just use on flag for all of them... @@ -1043,8 +1043,6 @@ public class AssistStructure implements Parcelable { */ public void updateAutofillValue(AutofillValue value) { mAutofillValue = value; - // TODO(b/33197203, b/33802548): decide whether to set text as well (so it would work - // with "legacy" views) or just the autofill value if (value.isText()) { mText.mText = value.getTextValue(); } diff --git a/core/java/android/service/autofill/AutofillService.java b/core/java/android/service/autofill/AutofillService.java index 813c54f53db9..503617803cf0 100644 --- a/core/java/android/service/autofill/AutofillService.java +++ b/core/java/android/service/autofill/AutofillService.java @@ -36,9 +36,6 @@ import com.android.internal.os.SomeArgs; import java.util.List; -//TODO(b/33197203): improve javadoc (of both class and methods); in particular, make sure the -//life-cycle (and how state could be maintained on server-side) is well documented. - /** * Top-level service of the current autofill service for a given user. * @@ -50,19 +47,6 @@ public abstract class AutofillService extends Service { /** * The {@link Intent} that must be declared as handled by the service. * To be supported, the service must also require the - * {@link android.Manifest.permission#BIND_AUTO_FILL} permission so - * that other applications can not abuse it. - * - * @hide - * @deprecated TODO(b/35956626): remove once clients use AutofillService - */ - @Deprecated - @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION) - public static final String OLD_SERVICE_INTERFACE = "android.service.autofill.AutoFillService"; - - /** - * The {@link Intent} that must be declared as handled by the service. - * To be supported, the service must also require the * {@link android.Manifest.permission#BIND_AUTOFILL} permission so * that other applications can not abuse it. */ @@ -92,8 +76,6 @@ public abstract class AutofillService extends Service { private static final int MSG_ON_FILL_REQUEST = 3; private static final int MSG_ON_SAVE_REQUEST = 4; - private static final int UNUSED_ARG = -1; - private final IAutoFillService mInterface = new IAutoFillService.Stub() { @Override public void onConnectedStateChanged(boolean connected) { @@ -170,8 +152,7 @@ public abstract class AutofillService extends Service { @Override public final IBinder onBind(Intent intent) { - if (SERVICE_INTERFACE.equals(intent.getAction()) - || OLD_SERVICE_INTERFACE.equals(intent.getAction())) { + if (SERVICE_INTERFACE.equals(intent.getAction())) { return mInterface.asBinder(); } Log.w(TAG, "Tried to bind to wrong intent: " + intent); @@ -282,7 +263,6 @@ public abstract class AutofillService extends Service { @Deprecated public final void disableSelf() { - // TODO(b/33197203): Remove when GCore has migrated off this API getSystemService(AutofillManager.class).disableOwnedAutofillServices(); } diff --git a/core/java/android/service/autofill/FillResponse.java b/core/java/android/service/autofill/FillResponse.java index 68ce0b52c070..0e74ca4047e8 100644 --- a/core/java/android/service/autofill/FillResponse.java +++ b/core/java/android/service/autofill/FillResponse.java @@ -242,7 +242,7 @@ public final class FillResponse implements Parcelable { public @NonNull Builder setAuthentication(@NonNull AutofillId[] ids, @Nullable IntentSender authentication, @Nullable RemoteViews presentation) { throwIfDestroyed(); - // TODO(b/33197203): assert ids is not null nor empty once old version is removed + // TODO(b/37424539): assert ids is not null nor empty once old version is removed if (authentication == null ^ presentation == null) { throw new IllegalArgumentException("authentication and presentation" + " must be both non-null or null"); @@ -254,7 +254,7 @@ public final class FillResponse implements Parcelable { } /** - * TODO(b/33197203): will be removed once clients use the version that takes ids + * TODO(b/37424539): will be removed once clients use the version that takes ids * @hide * @deprecated */ diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index bcf0b9060ed7..d42c6db106fd 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -7381,17 +7381,20 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * optimal implementation providing this data. */ public void onProvideVirtualStructure(ViewStructure structure) { - onProvideVirtualStructureForAssistOrAutofill(structure, false); + AccessibilityNodeProvider provider = getAccessibilityNodeProvider(); + if (provider != null) { + AccessibilityNodeInfo info = createAccessibilityNodeInfo(); + structure.setChildCount(1); + ViewStructure root = structure.newChild(0); + populateVirtualStructure(root, provider, info); + info.recycle(); + } } /** * Called when assist structure is being retrieved from a view as part of an autofill request * to generate additional virtual structure under this view. * - * <p>The default implementation uses {@link #getAccessibilityNodeProvider()} to try to - * generate this from the view's virtual accessibility nodes, if any. You can override this - * for a more optimal implementation providing this data. - * * <p>When implementing this method, subclasses must follow the rules below: * * <ol> @@ -7415,27 +7418,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param flags optional flags (currently {@code 0}). */ public void onProvideAutofillVirtualStructure(ViewStructure structure, int flags) { - onProvideVirtualStructureForAssistOrAutofill(structure, true); - } - - private void onProvideVirtualStructureForAssistOrAutofill(ViewStructure structure, - boolean forAutofill) { - if (forAutofill) { - setAutofillId(structure); - } - // NOTE: currently flags are only used for AutoFill; if they're used for Assist as well, - // this method should take a boolean with the type of request. - AccessibilityNodeProvider provider = getAccessibilityNodeProvider(); - if (provider != null) { - AccessibilityNodeInfo info = createAccessibilityNodeInfo(); - structure.setChildCount(1); - ViewStructure root = structure.newChild(0); - if (forAutofill) { - setAutofillId(root); - } - populateVirtualStructure(root, provider, info, forAutofill); - info.recycle(); - } + // TODO(b/36171235): need a way to let apps set the ViewStructure without forcing them + // to call super() (in case they override both this method and dispatchProvide.... + // Perhaps the best solution would simply make setAutofillId(ViewStructure) public. + setAutofillId(structure); } /** @@ -7652,7 +7638,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } private void populateVirtualStructure(ViewStructure structure, - AccessibilityNodeProvider provider, AccessibilityNodeInfo info, boolean forAutofill) { + AccessibilityNodeProvider provider, AccessibilityNodeInfo info) { structure.setId(AccessibilityNodeInfo.getVirtualDescendantId(info.getSourceNodeId()), null, null, null); Rect rect = structure.getTempRect(); @@ -7690,10 +7676,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, CharSequence cname = info.getClassName(); structure.setClassName(cname != null ? cname.toString() : null); structure.setContentDescription(info.getContentDescription()); - if (!forAutofill && (info.getText() != null || info.getError() != null)) { - // TODO(b/33197203) (b/33269702): when sanitized, try to use the Accessibility API to - // just set sanitized values (like text coming from resource files), rather than not - // setting it at all. + if ((info.getText() != null || info.getError() != null)) { structure.setText(info.getText(), info.getTextSelectionStart(), info.getTextSelectionEnd()); } @@ -7704,12 +7687,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, AccessibilityNodeInfo cinfo = provider.createAccessibilityNodeInfo( AccessibilityNodeInfo.getVirtualDescendantId(info.getChildId(i))); ViewStructure child = structure.newChild(i); - if (forAutofill) { - // TODO(b/33197203): add CTS test to autofill virtual children based on - // Accessibility API. - child.setAutofillId(structure, i); - } - populateVirtualStructure(child, provider, cinfo, forAutofill); + populateVirtualStructure(child, provider, cinfo); cinfo.recycle(); } } @@ -9598,13 +9576,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * @return Returns {@code false} if assist data collection for autofill is not blocked, * else {@code true}. - * - * TODO(b/33197203): update / remove javadoc tags below - * @see #setAssistBlocked(boolean) - * @attr ref android.R.styleable#View_assistBlocked */ public boolean isAutofillBlocked() { - return false; // TODO(b/33197203): properly implement it + // TODO(b/36171235): properly implement it using isImportantForAutofill() + return false; } /** diff --git a/core/java/android/view/autofill/AutofillId.java b/core/java/android/view/autofill/AutofillId.java index d678015b36f9..268f7f3557d1 100644 --- a/core/java/android/view/autofill/AutofillId.java +++ b/core/java/android/view/autofill/AutofillId.java @@ -30,7 +30,6 @@ public final class AutofillId implements Parcelable { private final boolean mVirtual; private final int mVirtualId; - // TODO(b/33197203): use factory and cache values, since they're immutable /** @hide */ public AutofillId(int id) { mVirtual = false; diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java index 981be21f4f61..b9d42f68c6d1 100644 --- a/core/java/android/view/autofill/AutofillManager.java +++ b/core/java/android/view/autofill/AutofillManager.java @@ -51,12 +51,10 @@ import java.util.List; import java.util.Objects; /** - * App entry point to the AutoFill Framework. + * App entry point to the Autofill Framework. * * <p>It is safe to call into this from any thread. */ -// TODO(b/33197203): improve this javadoc -//TODO(b/33197203): restrict manager calls to activity public final class AutofillManager { private static final String TAG = "AutofillManager"; @@ -107,7 +105,7 @@ public final class AutofillManager { * * @deprecated Use {@link android.service.autofill.FillRequest#FLAG_MANUAL_REQUEST} */ - // TODO(b/33197203): remove (and change value of private flags) + // TODO(b/37563972): remove (and change value of private flags) @Deprecated public static final int FLAG_MANUAL_REQUEST = 0x1; @@ -675,7 +673,7 @@ public final class AutofillManager { if (!hasAutofillFeature()) { return; } - // TODO(b/33197203): the result code is being ignored, so this method is not reliably + // TODO: the result code is being ignored, so this method is not reliably // handling the cases where it's not RESULT_OK: it works fine if the service does not // set the EXTRA_AUTHENTICATION_RESULT extra, but it could cause weird results if the // service set the extra and returned RESULT_CANCELED... @@ -1323,8 +1321,6 @@ public final class AutofillManager { @Override public void autofill(int sessionId, IBinder windowToken, List<AutofillId> ids, List<AutofillValue> values) { - // TODO(b/33197203): must keep the dataset so subsequent calls pass the same - // dataset.extras to service final AutofillManager afm = mAfm.get(); if (afm != null) { afm.mContext.getMainThreadHandler().post( diff --git a/core/java/android/view/autofill/AutofillValue.java b/core/java/android/view/autofill/AutofillValue.java index e2dd7fe9eeaa..b1a9d90cc4ca 100644 --- a/core/java/android/view/autofill/AutofillValue.java +++ b/core/java/android/view/autofill/AutofillValue.java @@ -252,7 +252,6 @@ public final class AutofillValue implements Parcelable { * * <p>See {@link View#AUTOFILL_TYPE_TEXT} for more info. */ - // TODO(b/33197203): use cache public static AutofillValue forText(@Nullable CharSequence value) { return value == null ? null : new AutofillValue(AUTOFILL_TYPE_TEXT, value); } diff --git a/core/java/android/view/autofill/Helper.java b/core/java/android/view/autofill/Helper.java index aa94de0bf693..2b25ae7aa5e8 100644 --- a/core/java/android/view/autofill/Helper.java +++ b/core/java/android/view/autofill/Helper.java @@ -25,7 +25,8 @@ import java.util.Set; /** @hide */ public final class Helper { - public static final boolean DEBUG = true; // TODO(b/33197203): set to false when stable + // TODO(b/36141126): set to false and remove guard from places that should always be on + public static final boolean DEBUG = true; public static final boolean VERBOSE = false; public static final String REDACTED = "[REDACTED]"; diff --git a/core/java/android/widget/AbsSpinner.java b/core/java/android/widget/AbsSpinner.java index f80c9e667935..816c9499e292 100644 --- a/core/java/android/widget/AbsSpinner.java +++ b/core/java/android/widget/AbsSpinner.java @@ -491,8 +491,6 @@ public abstract class AbsSpinner extends AdapterView<SpinnerAdapter> { return AbsSpinner.class.getName(); } - // TODO(b/33197203): add unit/CTS tests for auto-fill methods (and make sure they handle enable) - @Override public void autofill(AutofillValue value) { if (!isEnabled()) return; diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java index c7ba7b5d5a48..0762b15626f7 100644 --- a/core/java/android/widget/CompoundButton.java +++ b/core/java/android/widget/CompoundButton.java @@ -574,8 +574,6 @@ public abstract class CompoundButton extends Button implements Checkable { stream.addProperty("checked", isChecked()); } - // TODO(b/33197203): add unit/CTS tests for autofill methods (and make sure they handle enable) - @Override public void onProvideAutofillStructure(ViewStructure structure, int flags) { super.onProvideAutofillStructure(structure, flags); diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java index 463ff587466a..0dce07936fe5 100644 --- a/core/java/android/widget/DatePicker.java +++ b/core/java/android/widget/DatePicker.java @@ -764,8 +764,6 @@ public class DatePicker extends FrameLayout { void onValidationChanged(boolean valid); } - // TODO(b/33197203): add unit/CTS tests for autofill methods (and make sure they handle enable) - @Override public void dispatchProvideAutofillStructure(ViewStructure structure, int flags) { // This view is self-sufficient for autofill, so it needs to call diff --git a/core/java/android/widget/RadioGroup.java b/core/java/android/widget/RadioGroup.java index 08e657559e17..5c4d4d2a7fa0 100644 --- a/core/java/android/widget/RadioGroup.java +++ b/core/java/android/widget/RadioGroup.java @@ -417,8 +417,6 @@ public class RadioGroup extends LinearLayout { } } - // TODO(b/33197203): add unit/CTS tests for autofill methods (and make sure they handle enable) - @Override public void onProvideAutofillStructure(ViewStructure structure, int flags) { super.onProvideAutofillStructure(structure, flags); diff --git a/core/java/android/widget/SimpleAdapter.java b/core/java/android/widget/SimpleAdapter.java index 57e2ece0df8e..91901178e81e 100644 --- a/core/java/android/widget/SimpleAdapter.java +++ b/core/java/android/widget/SimpleAdapter.java @@ -320,9 +320,6 @@ public class SimpleAdapter extends BaseAdapter implements Filterable, ThemedSpin return mFilter; } - // TODO(b/33197203): implement getAutofillOptions - - /** * This class can be used by external clients of SimpleAdapter to bind * values to views. diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index f42d6c81f444..399cfac441a9 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -10170,8 +10170,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener structure.setInputType(getInputType()); } - // TODO(b/33197203): add unit/CTS tests for autofill methods - boolean canRequestAutofill() { final AutofillManager afm = mContext.getSystemService(AutofillManager.class); if (afm != null) { diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java index fb00c4392333..df99fb4dd06b 100644 --- a/core/java/android/widget/TimePicker.java +++ b/core/java/android/widget/TimePicker.java @@ -519,8 +519,6 @@ public class TimePicker extends FrameLayout { } } - // TODO(b/33197203): add unit/CTS tests for autofill methods (and make sure they handle enable) - @Override public void dispatchProvideAutofillStructure(ViewStructure structure, int flags) { // This view is self-sufficient for autofill, so it needs to call diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java index 1b5b2c65e5b2..41ead8e3db50 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java +++ b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java @@ -81,7 +81,6 @@ import java.util.List; * {@link AutofillManagerServiceImpl} per user; the real work is done by * {@link AutofillManagerServiceImpl} itself. */ -// TODO(b/33197203): Handle removing of packages public final class AutofillManagerService extends SystemService { private static final String TAG = "AutofillManagerService"; @@ -109,10 +108,8 @@ public final class AutofillManagerService extends SystemService { @GuardedBy("mLock") private final SparseBooleanArray mDisabledUsers = new SparseBooleanArray(); - // TODO(b/33197203): set a different max (or disable it) on low-memory devices. private final LocalLog mRequestsHistory = new LocalLog(20); - // TODO(b/33197203): is this still needed? private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -376,7 +373,6 @@ public final class AutofillManagerService extends SystemService { public int startSession(IBinder activityToken, IBinder windowToken, IBinder appCallback, AutofillId autofillId, Rect bounds, AutofillValue value, int userId, boolean hasCallback, int flags, String packageName) { - // TODO(b/33197203): make sure it's called by resumed / focused activity activityToken = Preconditions.checkNotNull(activityToken, "activityToken"); appCallback = Preconditions.checkNotNull(appCallback, "appCallback"); diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java index 85fc5800dad7..c2799304bf7a 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java @@ -120,8 +120,6 @@ final class AutofillManagerServiceImpl { * <p>They're kept until the {@link AutofillService} finished handling a request, an error * occurs, or the session times out. */ - // TODO(b/33197203): need to make sure service is bound while callback is pending and/or - // use WeakReference @GuardedBy("mLock") private final SparseArray<Session> mSessions = new SparseArray<>(); @@ -159,14 +157,11 @@ final class AutofillManagerServiceImpl { Slog.w(TAG, "no server session for " + sessionId); return; } - // TODO(b/33197203): since service is fetching the data (to use for save later), - // we should optimize what's sent (for example, remove layout containers, - // color / font info, etc...) session.setStructureLocked(structure); } - // TODO(b/33197203, b/33269702): Must fetch the data so it's available later on + // TODO(b/35708678): Must fetch the data so it's available later on // handleSave(), even if if the activity is gone by then, but structure.ensureData() // gives a ONE_WAY warning because system_service could block on app calls. // We need to change AssistStructure so it provides a "one-way" writeToParcel() @@ -176,8 +171,8 @@ final class AutofillManagerServiceImpl { // Sanitize structure before it's sent to service. structure.sanitizeForParceling(true); - // TODO(b/33197203): Need to pipe the bundle - FillRequest request = new FillRequest(structure, null, session.mFlags); + // This is the first request, hence there is no Bundle to be sent as clientState + final FillRequest request = new FillRequest(structure, null, session.mFlags); session.mRemoteFillService.onFillRequest(request); } }; @@ -398,13 +393,6 @@ final class AutofillManagerServiceImpl { mInfo.getServiceInfo().getComponentName(), packageName); mSessions.put(newSession.id, newSession); - /* - * TODO(b/33197203): apply security checks below: - * - checks if disabled by secure settings / device policy - * - log operation using noteOp() - * - check flags - * - display disclosure if needed - */ try { final Bundle receiverExtras = new Bundle(); receiverExtras.putInt(EXTRA_SESSION_ID, sessionId); diff --git a/services/autofill/java/com/android/server/autofill/Helper.java b/services/autofill/java/com/android/server/autofill/Helper.java index 70e97c4a5cb2..17c30c561729 100644 --- a/services/autofill/java/com/android/server/autofill/Helper.java +++ b/services/autofill/java/com/android/server/autofill/Helper.java @@ -24,7 +24,8 @@ import java.util.Set; final class Helper { - static final boolean DEBUG = true; // TODO(b/33197203): set to false when stable + // TODO(b/36141126): set to false and remove guard from places that should always be on + static final boolean DEBUG = true; static final boolean VERBOSE = false; static void append(StringBuilder builder, Bundle bundle) { diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 4bc3872f4ff0..5e8a974614a9 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -85,10 +85,6 @@ import java.util.Map.Entry; * to fill the activity but it requires authentication first, that response need to be held * until the user authenticates or it times out. */ -// TODO(b/33197203): make sure sessions are removed (and tested by CTS): -// - On all authentication scenarios. -// - When user does not interact back after a while. -// - When service is unbound. final class Session implements RemoteFillService.FillServiceCallbacks, ViewState.Listener, AutoFillUI.AutoFillUiCallback { private static final String TAG = "AutofillSession"; @@ -251,7 +247,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } synchronized (mLock) { if (response.getAuthentication() != null) { - // TODO(b/33197203 , b/35707731): make sure it's ignored if there is one already + // TODO(b/37424539): proper implementation mResponseWaitingAuth = response; } processResponseLocked(response, requestId); @@ -326,7 +322,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // FillServiceCallbacks @Override public void onServiceDied(RemoteFillService service) { - // TODO(b/33197203): implement + // TODO(b/337565347): implement } // AutoFillUiCallback @@ -599,7 +595,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState mStructure.dump(); } - // TODO(b/33197203): Implement partitioning properly + // TODO(b/37426206): Implement partitioning properly final int lastResponseIdx = getLastResponseIndex(); final int requestId = mResponses.keyAt(lastResponseIdx); final FillContext fillContext = new FillContext(requestId, mStructure); @@ -692,7 +688,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } private ViewState startPartitionLocked(AutofillId id, AutofillValue value) { - // TODO(b/33197203 , b/35707731): temporary workaround until partitioning supports auth + // TODO(b/37424539): proper implementation if (mResponseWaitingAuth != null) { final ViewState viewState = new ViewState(this, id, value, this, ViewState.STATE_WAITING_RESPONSE_AUTH); @@ -751,11 +747,6 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState private void notifyUnavailableToClient() { synchronized (mLock) { - if (mCurrentViewId == null) { - // TODO(b/33197203): temporary sanity check; should never happen - Slog.w(TAG, "notifyUnavailable(): mCurrentViewId is null"); - return; - } if (!mHasCallback) return; try { mClient.notifyNoFillUi(id, mWindowToken, mCurrentViewId); @@ -922,7 +913,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } // ...or handle authentication. - // TODO(b/33197203 , b/35707731): make sure it's ignored if there is one already + // TODO(b/37424539): proper implementation mService.setDatasetAuthenticationSelected(dataset.getId()); mDatasetWaitingAuth = dataset; setViewStatesLocked(null, dataset, ViewState.STATE_WAITING_DATASET_AUTH); @@ -992,7 +983,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } if (VERBOSE) { pw.print(prefix); pw.print("mStructure: " ); - // TODO(b/33197203): add method do dump AssistStructure on pw + // TODO: add method on AssistStructure to dump on pw if (mStructure != null) { pw.println("look at logcat" ); mStructure.dump(); // dumps to logcat diff --git a/services/autofill/java/com/android/server/autofill/ViewState.java b/services/autofill/java/com/android/server/autofill/ViewState.java index ea5f1137568c..3967f59355c4 100644 --- a/services/autofill/java/com/android/server/autofill/ViewState.java +++ b/services/autofill/java/com/android/server/autofill/ViewState.java @@ -61,7 +61,7 @@ final class ViewState { public static final int STATE_STARTED_PARTITION = 0x20; /** User select a dataset in this view, but service must authenticate first. */ public static final int STATE_WAITING_DATASET_AUTH = 0x40; - // TODO(b/33197203 , b/35707731): temporary workaround until partitioning supports auth + // TODO(b/37424539): temporary workaround until partitioning supports auth public static final int STATE_WAITING_RESPONSE_AUTH = 0x80; public final AutofillId id; @@ -151,9 +151,9 @@ final class ViewState { mState &= ~state; } - // TODO(b/33197203): need to refactor / rename / document this method to make it clear that - // it can change the value and update the UI; similarly, should replace code that - // directly sets mAutoFilLValue to use encapsulation. + // TODO: refactor / rename / document this method (and maybeCallOnFillReady) to make it clear + // that it can change the value and update the UI; similarly, should replace code that + // directly sets mAutofillValue to use encapsulation. void update(@Nullable AutofillValue autofillValue, @Nullable Rect virtualBounds) { if (autofillValue != null) { mCurrentValue = autofillValue; diff --git a/services/autofill/java/com/android/server/autofill/ui/FillUi.java b/services/autofill/java/com/android/server/autofill/ui/FillUi.java index b68e3b1e2543..bb47e5b54863 100644 --- a/services/autofill/java/com/android/server/autofill/ui/FillUi.java +++ b/services/autofill/java/com/android/server/autofill/ui/FillUi.java @@ -117,7 +117,7 @@ final class FillUi { final int heightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); content.measure(widthMeasureSpec, heightMeasureSpec); decor.setOnClickListener(v -> mCallback.onResponsePicked(response)); - // TODO(b/33197203 , b/36660292): temporary limiting maximum height and minimum width + // TODO(b/37567439): temporary limiting maximum height and minimum width mContentWidth = Math.max(content.getMeasuredWidth(), 1000); mContentHeight = Math.min(content.getMeasuredHeight(), 500); |