summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewStructure.java
Commit message (Collapse)AuthorAgeFilesLines
* Reporting the Autofill IDs and Positions of active views in list viewMihir Patel2022-08-091-0/+24
| | | | | | Test: atest CtsContentCaptureServiceTestCases, observed events reported only once on scroll and stop as well as on fling Bug: 211899037 Change-Id: Id67fcc360bf63fcab1d9f345c31d2bf7b9a173d6
* Rename getOnReceiveContentMimeTypes (drop "On")Nikita Dubrovsky2021-03-261-2/+2
| | | | | | Bug: 179143943 Test: Presubmit Change-Id: Ib2109f0a45c25ae6c4507a9199bf8b34fc394af5
* API: Suppress existing NullableCollections lints (S edition)Adrian Roos2021-02-011-1/+3
| | | | | | | Bug: 152525509 Test: make checkapi Change-Id: Idf96709bf93ef49ca5ad3cdd1f14d06e0d9e09d7 Exempt-From-Owner-Approval: API lint large scale change
* Add MIME types to ViewStructure and autofill/cc ViewNode classesNikita Dubrovsky2021-01-111-0/+8
| | | | | | | | Bug: 168253885 Test: atest FrameworksCoreTests:TextViewOnReceiveContentTest Test: Manual CTS-Coverage-Bug: 170893906 Change-Id: Iac8f73a7a022f20f59ecef9be89e3189ca106e4c
* Suppress all hidden abstract methods in constructable classes.Aurimas Liutikas2020-11-111-0/+2
| | | | | | | | | | | | | Having a hidden abstract method for a class that can be extended means that public implementors cannot implement these hidden methods posing a risk that custom implementations will not have required abstract methods resulting in an exception. Bug: 151134792 Test: make update-api Change-Id: I758d12465fabc671be19bedeeceb16885de23c87 Exempt-From-Owner-Approval: large scale suppression of existing issues, no-op in terms of behavior
* Added documentation on how hintIdEntry was used.Adam He2019-09-261-0/+2
| | | | | | Bug: 141318055 Test: atest CtsAutoFillServiceTestCases Change-Id: Ib85638a159404ca29bc2cd97bca73148f87cefae
* Implement AssistStructure.ViewNode.getHintIdEntry().Adam He2019-07-191-0/+10
| | | | | | | Bug: 135134274 Test: atest CtsAutoFillServiceTestCases Test: atest android.contentcaptureservice.cts.unit.ViewNodeTest Change-Id: I7154cf97a5236ad975bd774c29b30e055cfca8bd
* Added moar ContentCapture APIs (and their initial implementation).Felipe Leme2018-11-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 4 new APIs on View: - boolean setImportantForContentCapture() - boolean getImportantForContentCapture() - boolean isImportantForContentCapture() - boolean onProvideContentCaptureStructure() And 4 on IntelligenceManager: - void notifyViewAppeared() - void notifyViewDisappeared() - void notifyViewTextChanged() - ViewStructure newVirtualViewStructure() These methods are similar to the equivalent methods that are used for Autofill and/or Assist, except for the following differences: - The view hierarchy nodes are reported as they are rendered, rather than at once in a tree, recursively. Hence, the ViewStructure implementation does not implement the methods that add children to it, and views that provide virtual hierarchies must manually call IntelligenceManager to create the ViewStructure to their children and notify when their children are added and removed. - It does not support methods added for Autofill to handle HTML pages (such as setHtmlInfo() and setWewbDomain()), as they're not important in the Content Capture context. - Similarly, it also does not support setDataIsSensitive(), because the Intelligence service does not have the same restrictions as the Autofill service. The CL also provides the initial implementation of these APIs, although still full of TODOs (for example, we're not holding the events to send as a batch yet). Test: m -j update-api doc-comment-check-docs Bug: 117944706 Change-Id: I43f06ce82bfe3b14d8d13fb3b2ebee223db83284
* Docs: Inserted links to relevant guide pages.Laura Davis2018-08-161-1/+6
| | | | | | | | | | | | This is the proof of concept for adding relevant links in API pages to narrative content. The design doc is hosted at: https://docs.google.com/document/d/1Y6bFua27Gs7ONZ27gz0nHz3Djv0WND_V_rX-XvbeB3U/edit?usp=sharing Test: make ds-docs Bug: 112478848 Change-Id: Ic3842629c802fe89582d4d7b4a153e54d4ba1713
* New autofill APIs to get importantForAutofill mode on ViewNodes.felipeal2018-02-081-0/+8
| | | | | | | | Test: atest CtsAutoFillServiceTestCases:FatActivityTest Fixes: 72834587 Change-Id: Ia30da4ba53175a5cc4da6837c60d379c8eda05a8
* Added new Autofill APIs to get name of id used on android:text.Felipe Leme2018-01-031-0/+12
| | | | | | | | | | | | Such resource id is useful to help the autofill service heuristics to figure out the meaning of the labels without relying on their localized text. For example, the id could be "username", while the text could be "Nome do usuario". Test: atest CtsAutoFillServiceTestCases:LoginWithStringsActivityTest Fixes: 71552872 Change-Id: I13f7080fb3c67f91492a113115ffa43d185d192a
* Make new Autofill API concretes, so they don't break support library.Felipe Leme2017-10-191-3/+3
| | | | | | | | | Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testNewTextAttributes Test: m update-api Bug: 38323227 Change-Id: Idafb157fe9b3e96661d58923d361ea07ff2c6d40
* Merge "Added new ViewNode properties for Autofill (minEms, maxEms, maxLength)."TreeHugger Robot2017-10-131-0/+24
|\
| * Added new ViewNode properties for Autofill (minEms, maxEms, maxLength).Felipe Leme2017-10-061-0/+24
| | | | | | | | | | | | | | | | | | Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testNewTextAttributes Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases Fixes: 38323227 Change-Id: I6d8606f2d0668644ae1bd33e982edef0ec1e8e63
* | Added ViewNode.getWebScheme().Felipe Leme2017-10-031-1/+1
|/ | | | | | | | | Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases Test: cts-tradefed run commandAndExit cts-dev -m CtsAssistTestCases Fixes: 65207762 Change-Id: Ia8f7b3f5fce8cf0cc783e861fd7e1f1f7f78db19
* Overall improvement on Autofill javadocs for autofillable APIs.Felipe Leme2017-06-061-0/+7
| | | | | | | Bug: 37567048 Test: ran 'm -j doc-comment-check-docs' and checked resulting HTML Change-Id: I7eaf0a521c3777baf0dc0002ae814990fd96a14c
* Removed deprecated setAutofill() method for virtual children.Felipe Leme2017-05-251-7/+0
| | | | | | | | Test: CtsAutoFillServiceTestCases pass Bug: 37563972 Change-Id: Icbffb89d86ee65831b7c78effd2522ac7891e1be
* Removed deprecated ViewStructure.setUrl() method.Felipe Leme2017-05-021-7/+0
| | | | | | | | Fixes: 37623568 Test: CtsAutoFillServiceTestCases pass Test: CtsAssistTestCases pass Change-Id: I13cdf08f40ba3db31ddb3f104f99b7ab8839bd01
* Changed HtmlInfo.getAttributes() to return List instead of ArrayListFelipe Leme2017-04-281-2/+2
| | | | | | | Fixes: 37747396 Test: CtsAutoFillServiceTestCases pass Change-Id: Ief53e6d71805f561577b73e57a9d36bc3769862a
* Provide a way to set AutofillId on ViewStructure.Felipe Leme2017-04-251-7/+20
| | | | | | | | | | | So far that was done indirectly by public methods that could be overridden in away that does not set the proper id in the structure, which would crash apps. Bug: 36171235 Test: modified VirtualContainerActivityTest#testAutofillOverrideDispatchprovideAutofillStructure Change-Id: I3f1c64020125cbb8349971a0bc52ccd1e0c81e62
* Replaced getUrl() by getWebDomain().Felipe Leme2017-04-241-2/+10
| | | | | | | Bug: 37566507 Test: CtsAssistTestCases pass Change-Id: I1b4dfa7259040b3b8bf1014ebb806eb7a3b36c58
* Moved getAutofillOptions() logic from SpinnerAbs to AdapterView and Adapter.Felipe Leme2017-04-181-5/+5
| | | | | | | | Fixes: 37330022 Test: CtsAutoFillServiceTestCases pass Test: manual verification using app from bug 37327881 Change-Id: I66260131c7ef0d5b3c2b20514f29efd5eb10057e
* Merge "Created an HtmlInfo object on ViewStructure." into oc-devTreeHugger Robot2017-04-011-18/+64
|\
| * Created an HtmlInfo object on ViewStructure.Felipe Leme2017-03-301-18/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ViewStructure typically represents a View, but it it can also be a virtual view; in particular, WebView uses virtual views to represent HTML elements. Although most of the properties of the HTML element maps to properties of Android Views, some properties (such as 'name' and 'id' on <INPUT> fields) don't, and those are crucial for autofilling web pages. Rather than trying to artificially map these properties, it's better to create a generic representation, for the following reasons: 1. Web standards move in a different velocity than Android APIs 2. Android APIs cannot be changed easily. Deprecated APIs continue to work, and new added APIs don't work in older versions 3. The data used for autofill is opaque to the Framework - it's only relevant to the node producers (like WebView) and consumers (Autofill services). Also removed the setIdEntry() that was used for the same purpose. Fixes: 36696757 Bug: 36718508 Test: VirtualContainerActivityTest with new checks pass Change-Id: Ia626bd1f640b0b5861e81a5915504b95029874c9
* | Rename autoFillHint to autoFillHints.Philip P. Moltmann2017-03-301-2/+2
|/ | | | | | | Fixes: 35364993 Test: cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases Change-Id: I65a4c2c65563e7bbd60c4e99c8800b0b11af2300 (cherry picked from commit feb3299ed5fa30db8b1a4ab693e11e8acb32d13d)
* Added LocaleList on ViewStructure.Felipe Leme2017-03-221-0/+6
| | | | | | | Fixes: 36219641 Test: CtsAssistTestCases pass Change-Id: I4f208a3b979a524d631e9d2c642b9b5a3cdccb22
* Fixed bad link caused by race conditions on git merges.Felipe Leme2017-03-211-1/+1
| | | | | Test: no time for that Change-Id: Iffbba4ab2aa0751a406e031fe34e8e2c75e0abde
* Merge "Changes on Assist structure to handle virtual child for autofill:"TreeHugger Robot2017-03-211-30/+5
|\
| * Changes on Assist structure to handle virtual child for autofill:Felipe Leme2017-03-201-30/+5
| | | | | | | | | | | | | | | | | | | | | | - Removed overloaded newChild() methods. - Added a setAutofillId(parent, virtualId). - Changed view so AutofillId is set on all relevant methods. Test: VirtualContainerActivityTest (with new tests) pass Bug: 36056207 Change-Id: Ia11344f95c2756e83307c54052878e9dbe471873
* | Improved WebView -> ViewStructure mapping for Autofill.Felipe Leme2017-03-201-0/+11
|/ | | | | | | | | | | Added setIdEntry() on ViewStructure and documented how WebView can map HTML tags and attributes into ViewStructure. Test: VirtualContainerActivityTest pass Test: m update-api Bug: 36056207 Change-Id: Idaee9612d2c1b1adac99f354c8f87137ee9ef877
* Batch autofill() calls to views with virtual children.Felipe Leme2017-03-181-2/+2
| | | | | | | | | This is useful in the cases where the virtual children hierarchy is rendered by a different process. Test: VirtualContainerActivityTest pass Bug: 36056207 Change-Id: Id9bf3a9e9366b616dc2a6e0a204e238a2bee3a20
* Removed 'virtual' from autofill method names.Felipe Leme2017-03-171-7/+5
| | | | | | | Fixes: 36126001 Test: VirtualContainerActivityTest pass Change-Id: I3b8fe835cd7c7f39c8e2cb8f2daca71b03236a1f
* Allow users to manually request Autofill.Felipe Leme2017-03-151-3/+3
| | | | | | | | | | | | | | | | - Added a requestAutofill(view,flags) method, that when passed with FLAG_MANUAL_AUTOFILL triggers a manual request. - Added same method for virtual views - Overloaded existing AutofillService request methods to take a flag. - Added an AUTOFILL context menu option on TextViews. - Added a canRequestAutofill() that is used to enable the context menu. BUG: 35708229 Test: manual verification Test: existing CtsAutoFillServiceTestCases pass Test: android.autofillservice.cts.LoginActivityTest#testManualAutofill pass Change-Id: I1a64d40da3373774451d178b1cabf20f11120e9d
* Merge "Change autoFillHint to list of strings"Philip P. Moltmann2017-03-141-1/+2
|\
| * Change autoFillHint to list of stringsPhilip P. Moltmann2017-03-131-1/+2
| | | | | | | | | | | | Test: Ran autofill CTS tests Fixes: 35364993 Change-Id: I3f4ceb719b2d3fef0168e8300c0d15f1661560c0
* | Renamed ViewStructure.setSanitized() to setDataIsSensitive().Felipe Leme2017-03-141-6/+14
|/ | | | | | | | Bug: 36126001 Test: CtsAutoFillServiceTestCases pass Test: m update-api Change-Id: I182355b63d8743cd8cd8612f29a9269e258283c2
* AssistStructure improvementsAmith Yamasani2017-03-101-0/+5
| | | | | | | | | | | | Added isOpaque() for Views Added getAcquisitionStartTime(), ...EndTime() Added isHomeActivity() Bug: 30895450 Test: cts-tradefed run cts-dev -m CtsAssistTestCases -t android.assist.cts.AssistStructureTest#testAssistStructure Change-Id: I294a089aa3454ebfebf0442036d98ccb86cb2827
* Replaced auto-fill by autofill to keep it consistent with API style.Felipe Leme2017-03-091-32/+22
| | | | | | | | | | | | | | This change will affects 2 types of apps: autofill service implementations and apps that use autofill APIs. Since just the former is known to be used at the moment, we're not trying to keep backward compatibility with the latter. Bug: 35956626 Test: CtsAutoFillServiceTestCases pass Test: android.provider.SettingsBackupTest pass Change-Id: Ia720083508716deae9e887f9faa7ae7c5a82f471
* Replace AutoFillType by view constants.Felipe Leme2017-03-071-2/+7
| | | | | | | | | | | | | | | Now that AutoFillType does have any logic (since the "subType" logic was moved to AutoFillHint), it makes more sense to get rid of the type and use constants directly. This change creates the contants and "pseudo-deprecate" the old stuff: it's still available because some clients are using it, but it will be removed once they migrate. Bug: 35956626 Test: CtsAutoFillServiceTestCases pass Change-Id: I0efe7f0cc101c86164a18c85903bb871e1f13ba2
* Add forAutoFill suffix on ViewStructure methods that add children.Felipe Leme2017-03-031-10/+26
| | | | | | Change-Id: I36f7bd26b7d45fd809d7398cc86de3d2671f2b28 Fixes: 35764877 Test: m update-api
* Add autoFillHint property to viewPhilip P. Moltmann2017-03-021-0/+7
| | | | | | Bug: 35364993 Test: Ran amended ViewAttributesTest Change-Id: Ib7d2c3dfd5b4a6b638b56c4583af4c9bdf37e346
* Added inputType to Assist API.Felipe Leme2017-02-271-0/+7
| | | | | | | | | | It will be used mostly for auto-fill purposes.. Bug: 35364993 Test: CtsAutoFillServiceTestCase (with new tests) pass Test: manual verification Change-Id: Ia5b6ff94e66a7da385cfb6f42ad994fe5e1e976b
* Added auto-fill support for Spinner.Felipe Leme2017-02-221-0/+9
| | | | | | | | | | | | | | Spinner is a special kind of list-value field because its auto-fillable values are not currently present in the assist structure: this change adds a getAutoFillOptions() to fill that void, and implements the auto-fill APIs on Spinner. It also fixes RadioGroup.getAutoFillValue() - it should return the index of the child, not its resource id. Bug: 33550221 Test: CtsAutoFillServiceTestCases (with new tests) pass Change-Id: I625e7dd705fade56fda490fcd3c4446c0c245ee1
* Add API to mark sanitized fields and implement it on TextView.Felipe Leme2017-02-211-16/+13
| | | | | | | | | | | | | | | | | | When sending a ViewNode to the auto-fill service, it's necessary to sanitize it so it does not contain PII (Personally Identifiable Information). A good rule of thumb is to mark as sanitized nodes whose value were statically set from resources. Ideally, that logic should belong to View, but View does not know how its contexts are set, so the decision must be made by the subclasses, and this CL implements that logic on TextView (which is the main auto-fill type - others will come soon...) Bug: 33269702 Test: CtsAutoFillServiceTestCases pass Test: manual verification Change-Id: I4dcdd8419a35812bd2f15a63a5be85f8cd97bb4e
* Merge "Add URL on ViewStructure."Felipe Leme2017-02-161-0/+13
|\
| * Add URL on ViewStructure.Felipe Leme2017-02-151-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The URL will be typically used by views rendering HTML pages (like WebView), and used in 2 cases - Root node (containing the URL of the HTML page) - Child nodes that represent hyperlinks (contains the hyperlink URL). Fixes: 20902429 Test: manual verification Test: android.assist.cts.WebViewTest verifies it Change-Id: Ic49472f1fca89047369b7187176f54efd277e204
* | Minor fixes on documentation.Felipe Leme2017-02-151-4/+7
|/ | | | | | Bug: 31001899 Test: m update-api Change-Id: I1f08552885fb5572ca9d811959dfe2b965ce3537
* Get rid of VirtualViewDelegate.Felipe Leme2017-02-071-9/+6
| | | | | | | | | | | | | | | | | | VirtualViewDelegate was used by views providing virtual children to: - auto-fill the chidren - notify system about children changes Since the notification logic moved to the AutoFillManager class, it's kind of an overkill to provide a delegate just for autoFill(); instead, it's simpler to add a new autoFillVirtual(virtualId, value) method on View. BUG: 31001899 Test: manual verification Test: CtsAutoFillServiceTestCases passes Change-Id: Ia7670aa665918496a009017a11c3de72c4ed3fa2
* Improved AutoFill Save workflow.Felipe Leme2017-02-011-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the onProvideAutoFillStructure() methods can be called twice: to auto-fill an activity and to save the activity's data in the service. The problem with this approach is that when the save workflow is called, the activity might have been gone. Hence, a proper approach is to keep the initial AssistStructure data in the system_service memory, watch for view changes, and then passed the new structure back to the AutoFillService. A side effect of this change is that we need another way to determine if the view is sanitized or not. For "standard" views, that will be defined based on whether the view content come from a resource or not, but that logic is not implemented yet (for now, all views will be considered sanitized, except for TextView passwords). For "custom" views (such as WebView), this logic is responsibility of the view implementation, through the newChild() method, which now takes a flag (whose value could be AUTO_FILL_FLAG_SANITIZED for sanitized views). The SaveCallback.onSuccess() method was simplified: it does not need a list of saved ids anymore the auto-fill UI will not use it anymore. Another side effect is that the Save notification is gone - until it's attached again, it can be test by using: adb shell cmd autofill save Finally, hook AutoFillUI on ACTION_CLOSE_SYSTEM_DIALOGS events. BUG: 33269702 BUG: 31001899 Test: manual verification Test: CtsAutoFillServiceTestCases passes Change-Id: I907a7e21d1b3cd1ab6dec3a08d144a52655da46f
* YAMAFFR - Yet Another Major AutoFill Framework RefactoringFelipe Leme2017-01-101-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Explicitly split View methods into Assist and AutoFill methods, rather than use an overloaded method that takes flags. - Simarly, renamed ASSIST_FLAG_SANITIZED_TEXT and ASSIST_FLAG_NON_SANITIZED_TEXT flags to AUTO_FILL_FLAG_TYPE_FILL and AUTO_FILL_FLAG_TYPE_SAVE respectively. - Created a AutoFillUI class to host the auto-fill bar and other UI affordances. - Moved the temporary notifications to AutoFillUI (eventually that class will host the real UI). - Moved FillData to android.app.view.autofill package. - Split IAutoFillCallback in 2 (IAutoFillAppCallback and IAutoFillServerCallback, residing at the app and system_server respectively), so service cannot fill the app directly (which lets the framework control the UI). - Moved assist's IResultReceiver to AutoFillServiceImpl so system_server can act as a mediator between the AutoFillService implementation and the app being auto-filled. - Replaced FillData and FillableInputFields by a bunch of new objects: - FillResponse contains a group of Datasets, each representing different values that can be used to auto-fill an activity (for example, different user accounts), optional id of fields the service is interested to save, and an optional bundle for service-side extras. - Dataset contains a name, Fields, and an optional bundle for service-side extras. - Fields contain an AutoFillId (parcelable) and a value (Bundle) - Changed the temporary notifications to emulate the new workflow: - Initial notification requests the auto-fill data but do not auto-fill. - Once service calls back, a new notification is shown with the results. - Then if the user selects a dataset, the activity is auto-filled with it. - It also shows a notification to emulate what can be saved. - Created an VirtualViewDelegate for views that uses a virtual hierarchy for assist data. - Added new methods on ViewStructure to add children with virtual ids. - Added 2 methods on View to support auto-fill: - autoFill(Bundle) to auto-fill the view. - getAutoFillType() to return how the view can be auto-filled. - AutoFillType defines the input fields that support auto-fill: - Text fields (like EditText) - Toggle fields (like CheckBox) - Lists (like RadioGroup) - AutoFillType can also have a sub-type representing its semantic (for now only text fields have it, and it's the same as getInputType()). - etc :-) Bug: 31001899 Test: manual verification Change-Id: I2dd2fdedcb3ecd1e4403f9c32fa644cb914e186f