summaryrefslogtreecommitdiff
path: root/core/java/android/view/View.java
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2017-01-24 15:10:26 -0800
committerFelipe Leme <felipeal@google.com>2017-01-26 15:39:59 -0800
commitbd00fef41ce38d2c711bd4151997c1cd8964b712 (patch)
tree947661d21d70abb2dd45917e3f8d1b0b054f2616 /core/java/android/view/View.java
parent6ee80f3a652358e8297102ea855105aea05bedf8 (diff)
Moar AutoFill Framework refactoring...
* Encapsulated application-level auto-fill logic on AutoFillSession. Currently, Activity.java directly manages the IAutoFillCallback binder object used to auto-fill its views, but this logic need to be extended so Views can use it to draw the auto-fill bar. * Pass auto-fill id and boundaries to requests So AutoFillUI can display its affordance in the right places. * Uses a new auto-fill id on View (instead of reusing accessibility's). That allows moving the logic on whether a new request should be made or the existing UI moved to the service side. * Split service methods in 2, for shell cmd and app And applied the right permission check on both. * Removed CancelationSignal from onSaveRequest() Since it's not really needed. * Etc... ¯\_(ツ)_/¯ BUG: 34637800 BUG: 31001899 Test: CtsAutoFillServiceTestCases passes Test: manual verification Change-Id: Ibd0cb2cfff6d0f6bb6b697a423ed5e89df687b82
Diffstat (limited to 'core/java/android/view/View.java')
-rw-r--r--core/java/android/view/View.java33
1 files changed, 7 insertions, 26 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index ba9bb67c1546..0657bef2ab69 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -1765,12 +1765,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
int mAccessibilityViewId = NO_ID;
- /**
- * The stable ID of this view for auto-fill purposes.
- */
- private int mAutoFillId = NO_ID;
-
-
private int mAccessibilityCursorPosition = ACCESSIBILITY_CURSOR_POSITION_UNDEFINED;
SendViewStateChangedAccessibilityEvent mSendViewStateChangedAccessibilityEvent;
@@ -4045,9 +4039,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* input fields and tags (like {@code id}).
* </ul>
*/
- // TODO(b/33197203) (b/34078930): improve documentation: mention all cases, show examples, etc.
- // In particular, be more specific about webview restrictions
- public static final int AUTO_FILL_FLAG_TYPE_FILL = 0x1;
+ // TODO(b/33197203): cannot conflict with flags defined on AutoFillManager until they're removed
+ // (when save is refactored).
+ public static final int AUTO_FILL_FLAG_TYPE_FILL = 0x10000000;
/**
* Set when the user explicitly asked a {@link android.service.autofill.AutoFillService} to save
@@ -4057,7 +4051,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* (Personally Identifiable Information). For example, the text of password fields should be
* included since that's what's typically saved.
*/
- public static final int AUTO_FILL_FLAG_TYPE_SAVE = 0x2;
+ // TODO(b/33197203): cannot conflict with flags defined on AutoFillManager until they're removed
+ // (when save is refactored).
+ public static final int AUTO_FILL_FLAG_TYPE_SAVE = 0x20000000;
/**
* Set to true when drawing cache is enabled and cannot be created.
@@ -6940,8 +6936,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (forAutoFill) {
// The auto-fill id needs to be unique, but its value doesn't matter, so it's better to
// reuse the accessibility id to save space.
- mAutoFillId = getAccessibilityViewId();
- structure.setAutoFillId(mAutoFillId);
+ structure.setAutoFillId(getAccessibilityViewId());
structure.setAutoFillType(getAutoFillType());
}
@@ -7568,20 +7563,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
- * Gets the unique identifier of this view for auto-fill purposes.
- *
- * <p>It's only set after {@link #onProvideAutoFillStructure(ViewStructure, int)} is called.
- *
- * @return The view autofill id or {@link #NO_ID} if
- * {@link #onProvideAutoFillStructure(ViewStructure, int)} was not called yet.
- *
- * @hide
- */
- public int getAutoFillViewId() {
- return mAutoFillId;
- }
-
- /**
* Gets the unique identifier of the window in which this View reseides.
*
* @return The window accessibility id.