summaryrefslogtreecommitdiffstats
path: root/tests/VoiceInteraction
Commit message (Collapse)AuthorAgeFilesLines
* Fix issue #22940169: "pm grant" can no longer grant permissions...Dianne Hackborn2015-08-131-0/+1
| | | | | | | | | | | | ...with protection flag PROTECTION_FLAG_DEVELOPMENT Bring back the old grant/revoke code for development permissions. Also some more dumpsys output to help debugging. And new dumpsys command for checking a permission. Change-Id: I6e27e62a9ca5ec1ecc0f102714a448ea02f0f41c
* Fix issue #22860466: viapi security bug - rubber stamping in nested VIsDianne Hackborn2015-08-033-1/+24
| | | | | | | | | | | | | | | | | Add new Activity.isVoiceInteractionRoot() API that an activity can use to determine whether it is the root activity of a voice interaction session started by the user's designated voice interaction service. This is a special new API that apps must explicitly check, because as with visual activities the model behind an activity should usually be that it accomplishes its task by interacting with the user (implicitly getting their approval) rather than trusting that whoever invoked it is telling it to do what the user once. In the voice world, however, there are some cases where quick interactions want to allow for immediate execution without further user involvement, so this API allows for that without opening up security holes from other applications. Change-Id: Ie02d2458f16cb0b12af825641bcf8beaf086931b
* Fix issue #21895842: Add is_assist_blocked to assist.ViewNode.NodePropertiesDianne Hackborn2015-07-313-0/+20
| | | | Change-Id: I928882d42d0546cc6a12e803d96131beaba76d4e
* Work on issue #21516866: Implement voice interaction in ResolverActivityDianne Hackborn2015-07-281-0/+22
| | | | | | | | | | | | | | | The main change here is to not allow the dialog to go in to its "focus on the last app the user selected" when running in voice interaction mode, instead just always giving a simple list. This also fixes some problems with cleaning up active commands when an activity finishes and not forcing the current session to go away when the screen is turned off. Also added some debug help, having activity print the state of the voice interactor. Change-Id: Ifebee9c74d78398a730a280bb4970f47789dadf5
* Fix issue #22531747: Assist info should declare if user has disabled...Dianne Hackborn2015-07-205-25/+23
| | | | | | | | | | | | | | | ...context and/or screenshot Added new API to find out what contextual data has been globally disabled. Also updated various documentation to make it clear what kind of contextual data you will get (and when it will be null). Also added a new Activity.showAssist() API because... well, I was already in there, it was easy to do, it is safe, and maybe people will build cool things with it. Change-Id: Ia553d6bcdd098dc0fce4b9237fbfaca9652fc74b
* Merge "Implement issue #22403908: Enable assistant to refuse context ↵Dianne Hackborn2015-07-152-24/+89
|\ | | | | | | sharing" into mnc-dev
| * Implement issue #22403908: Enable assistant to refuse context sharingDianne Hackborn2015-07-152-24/+89
| | | | | | | | | | | | | | New APIs allow the voice interaction service to set/retrieve a filter for which of the show flags are allowed. Change-Id: I588cbe55afee0548ad3afa22d3a7d3bc43cb54a6
* | Fix issue #22124996: VI: Command Request not ActiveDianne Hackborn2015-07-151-0/+8
|/ | | | | | | This stupid thing wasn't even completely implemented in HandlerCaller! D'oh! Change-Id: I0dac42c208fa0f08a6e20a6cb17b072f51efcaa7
* Implement better handling of text in assist.Dianne Hackborn2015-07-073-2/+262
| | | | | | | | | | | TextView is now much smarter about the text it reports, limiting it to what is visible (plus a bit more). Also add a facility for it to report where the lines of text are, both as offsets in the text string and their baselines on screen. Part of fixing issue #22328792: Fix scalability issues in AssistStructure Change-Id: Idddb8c3a3331355f381e2d4af06d520fe7c7ce8e
* Fix issue #22124996: VI: Command Request not ActiveDianne Hackborn2015-06-305-42/+123
| | | | | | | | | | | Just forgot to add the request to the active set. Also eradicate a bunch of old cruft that has been replaced by the final APIs, and improve voice interaction test to sit fully on top of the final APIs and have a test for command request. Change-Id: Ieff7a6165ebf2a4c5fb80c1ebd020511a2ae63ee
* Fix issue #22013372: Assist should take translationX and friends...Dianne Hackborn2015-06-254-32/+143
| | | | | | | | | | | | | | | | | | ...into account when calculating the position information Actually what we need here is the full transformation matrix, if it is available. And that means actually computing the location of views on the screen requires doing this all through transformations, so the AssistVisualizer has been changed to do this (while still also keeping the old mechanism for comparison to verify that things are working correctly). Also added new properties for elevation and alpha. And optimized the parcelling of AssistStructure to not write things that aren't needed; this reduces the parcelled size by about half. Change-Id: I50b0dd2e6599c74701a5d188617a3eff64b07d03
* Fix issue #20654534: API Review: android.app.assistDianne Hackborn2015-06-223-90/+79
| | | | | | Remove the old classes. Change-Id: I949350cadc5fc304e2651d7db0ffd38e45db9b6e
* Fix issue #21621920: VI: need mechanism to get current requestDianne Hackborn2015-06-093-22/+51
| | | | | | | | | | | Add new APIs to associate a Request with a name, get all active requests, and get active request by name. Also add a new Activity.onProvideReferrer() which will allow applications to propagate referrer information to the assistant (and other apps they launch) in a consistent way. Change-Id: I4ef74b5ed07447da9303a74a1bdf42e4966df363
* Use VoiceInteractor.Prompt in VoiceInteraction test appJames Cook2015-06-081-4/+4
| | | | | | | | The framework API that takes a CharSequence as a prompt is now deprecated, so update the test code to use the new API. Bug: 21695917 Change-Id: Ic4b7afa6c547a9885a900ed092910f3c6bdd1dd4
* More API changes.Dianne Hackborn2015-06-021-2/+27
| | | | | | | | | | | | | Start moving Assist* stuff to android.app.assist. Clean up some more of the VoiceInteractionSession APIs. Clearly document that finish() is not the same as hide(), always call hide() instead, and fix the finish() path to also always do a hide to make sure everything is cleaned up correctly. Change-Id: I962d4069fcb34fe89547a95d395ae1b9fa3b4148
* Update VoiceInteractionService from API review.Dianne Hackborn2015-06-012-2/+3
| | | | | | | This may even manage to retain compatibility with existing binaries! (For now.) Change-Id: I3b1386287a6b9b20b57ac2e2444fd6f458837277
* Add new API to set URI on AssistContent.Dianne Hackborn2015-05-281-28/+10
| | | | | | | | | Also rework how we transfer AssistContent and AssistStructure to the assistant, so they are delivered as completely separate objects rather than the kludgy bundling them in the assist data thing. Change-Id: Ib40cc3b152bafeb358fd3adec564a7dda3a0dd1d
* Fix issue #20655182: API Review: ViewAssistStructureDianne Hackborn2015-05-072-9/+3
| | | | | | | | | | | Fix the various view assist related APIs. Also remove the blockAssist view attribute, and instead use the window's FLAG_SECURE to drive blocking of the entire hierarchy (which is semantically correct, and will protect existing apps that have already indicated they need it). Change-Id: I6beebc86b202809cba0a356cae9607d8d0fb5e78
* Rename supportsAssistGesture to supportsAssistJorim Jaggi2015-05-011-1/+1
| | | | | Bug: 20642759 Change-Id: Idddc786980244cc94570d04fd414540bbad60448
* Add "assist block" API.Dianne Hackborn2015-04-222-1/+8
| | | | | | To prevent assist structure traversal down the view hierarchy. Change-Id: I50ce5f8de6f2eca3cb862de8eacd6422c40a2f7c
* Various fixes and improvements...Dianne Hackborn2015-04-044-18/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #19912529: VI: VoiceInteractor callback ClassCastException Fix to use correct argument. Issue #19912636: VI: Documentation for VoiceInteractionSession.onBackPressed Added documentation. Issue #19912703: VI: VoiceInteractionSession NPE on Abort Request Maybe fix this -- don't crash if there is no active session. Issue #19953731: VI: Add value index to... ...android.app.VoiceInteractor.PickOptionRequest.Option There is now an optional index integer that can be associated with every Option object. Issue #19912635: VI: Behavior of startActivity when in voice... ...interaction is unexpected We now forcibly finish the current voice interaction task whenever another activity takes focus from it. Issue #20066569: Add API to request heap dumps New ActivityManager API to set the pss limit to generate heap dumps. Also added app ops for assist receiving structure and screenshot data, so that we can track when it does these things. Change-Id: I688d4ff8f0bd0b8b9e3390a32375b4bb7875c1a1
* Add quick and dirty async AssistStructure building.Dianne Hackborn2015-04-024-1/+68
| | | | | | | | | | | | | | New APIs on ViewAssistStructure all the app to request to build a sub-tree asynchronously and indicate when it is done with that. The overall AssistStructure is now only flattened and transfered on-demand, when the app receiving it requests its data -- and at that point we can wait for any asynchronous building to complete. New AsyncStructure view is a very simple example of using this to asynchronously build a child view. Change-Id: I14f9199bee64915ad3dc80b2190916ec874308af
* Rework assist to walk down the view hierarchy.Dianne Hackborn2015-04-012-4/+7
| | | | | | | | | | | | | Instead of collecting all of the data directly in AssistStructure, we now have a dispatch mechanism down the hierarchy to do so. While doing this, also added the ability to automatically collect assist data from AccessibilityNodeProviders attached to views (so now we see all of the data in for example Calendar). This is a first step needed towards being able to asynchronously populate assist data. Change-Id: I59ee1ea104ca8207bad8df7a38195d93da1adea7
* Add view ID, rework assist API.Dianne Hackborn2015-03-231-6/+5
| | | | | | | | | | | | | Add view ID information to the assist structure. Also rework the API to simplify how it works by removing the ViewNode wrapper around ViewNodeImpl -- these are now just the same thing. And then add complexity by introducing a formal WindowNode object that contains the top-level window information (so I can add in some more window-specific info in the future). Change-Id: I5d525cf61ab6a73193e5cceb4c09d2d21cc27bae
* Add ability to get a screenshot for assist.Dianne Hackborn2015-03-174-5/+24
| | | | | | | New flag you pass in to startSession() to say you want it, new callback on VoiceInteractionSession to receive it. Change-Id: I61fdcfdee41a60d46036a2ef16681a9b4181115a
* Add new voice request for picking from a list.Dianne Hackborn2015-03-164-10/+121
| | | | | | | | | | | | Also add API for voice interaction service to control whether the system should hold a wake lock while it is working with an activity (and actually *do* hold a wake lock while doing so, duh!). And while in there, clean up the launching wake lock to correctly give blame to the app that is launching. Change-Id: I7cc4d566b80f59fe0a9ac51ae9bbb7188a01f433
* More work on collecting assist data.Dianne Hackborn2015-03-124-27/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize parceling of AssistData (which is now renamed to AssistStructure) by pooling duplicated class name strings. Change text associated with a view node to a CharSequence, so styling information comes along. Include global text attributes -- size, colors, etc. Introduce a new AssistContent structure, which allows us to propagate information about the intent and data the activity is looking at. This further allows us to propagate permission grants, so the assistant can dig in to that data. The default implementation propagates the base intent of an activity, so if for example you bring up the assistant while doing a share the assistant itself has the same information and access that was given to the share activity (so it could for example share it in another way if it wanted to). Did some optimization of loading PersistableBundle from xml, to avoid duplicating hash maps and such. Changed how we dispatch ACTION_ASSIST to no longer include the more detailed AssistStructure (and new AssistContent) data when launching; now the example code that intercepts that needs to be sure to ask for assist data when it starts its session. This is more like it will finally be, and allows us to get to the UI more quickly. Change-Id: I88420a55761bf48d34ce3013e81bd96a0e087637
* Rework voice interaction session lifecycle.Dianne Hackborn2015-02-257-20/+61
| | | | | | | | | | | | | | | | | | | | We now have a formal concept of the session being shown and hidden, with it being able to continue running while hidden as long as there is enough RAM. This changes the flow that a VoiceInteractionSession will see: onCreate() is when it is first created, onCreateContentView() is when its UI first needs to be built, onShow() is called each time it needs to be shown and has the arguments given when the show request was made (which has been renamed from startSession to showSession), and then onHide() will be called when the UI is no longer shown. The methods show() and hide() now allow a VoiceInteractionSession subclass to control when it is shown and hidden, working with the shown state being maintained by the system. Change-Id: Ic4a430ec7e8bf76a5441fd0425e2932806170fcc
* Update voice interaction layer for new UI design.Dianne Hackborn2015-02-138-27/+238
| | | | | | | | | | | | | | | | | | Can switch from a pure overlay at the top of the screen, to interactive mode with the voice UI drawing at the bottom and pushing its target activity up like an IME. Add mechanism to get assist data to the voice interaction UI. Add some basic visualization of the assist data, outlining where on the screen we have text. Add a test ACTION_ASSIST handler, which can propagate the assist data it gets to the voice interaction session so you can see what kind of data we are getting from different apps. Change-Id: I18312fe1601d7926d1fb96a817638d60f6263771
* am 6feba6b6: am 0b230ea6: am efd4ea01: Merge "Address API review ↵Dharmesh Mokani2014-09-051-1/+1
|\ | | | | | | | | | | | | comment:AlwaysOnHotwordDetector" into lmp-dev * commit '6feba6b61ecddcb93a2b33a2ea52daad6cf70bd5': Address API review comment:AlwaysOnHotwordDetector
| * Address API review comment:AlwaysOnHotwordDetectorDharmesh Mokani2014-09-041-1/+1
| | | | | | | | | | | | | | - Methods creating an Intent should be named createFooIntent Bug: 17389896 Change-Id: Icb9c9f9ca3a41fca09f79ff22b99988a1ded331f
* | am 601d017c: am efe6c903: am cffbcb8a: Merge "Address API review comments" ↵Sandeep Siddhartha2014-08-291-2/+1
|\ \ | |/ | | | | | | | | | | into lmp-dev * commit '601d017c2209f0a7930503a0bc97b4e762e4e8a1': Address API review comments
| * Address API review commentsSandeep Siddhartha2014-08-271-2/+1
| | | | | | | | | | | | | | | | | | - Make Callback an abstract class - Split manage intents into 3 different methods - Remove RECOGNITION_FLAGS_NONE Bug: 17255602 Change-Id: I1329f889bb2ab35938f42d2ecfe755d2b17ec542
* | am c95d61e1: am b6943e7b: am fe3a5e88: Merge "Fix conversion of locale from ↵Sandeep Siddhartha2014-08-251-1/+1
|\ \ | |/ | | | | | | | | | | BCP47 language tag" into lmp-dev * commit 'c95d61e15c33519225e2d89af58aeb9843776e2f': Fix conversion of locale from BCP47 language tag
| * Fix conversion of locale from BCP47 language tagSandeep Siddhartha2014-08-231-1/+1
| | | | | | | | | | Bug: 17187528 Change-Id: Ifcf707c9be736885f3fc79f3c36087ecf9092971
* | am 68f133b4: am a8d8e4c4: am e829259d: Merge "Fix the Locale story in the ↵Sandeep Siddhartha2014-08-251-1/+3
|\ \ | |/ | | | | | | | | | | hotword API" into lmp-dev * commit '68f133b422733f89c9e226c636ce6153d4e86f1c': Fix the Locale story in the hotword API
| * Fix the Locale story in the hotword APISandeep Siddhartha2014-08-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Tighten the API by taking in a locale rather than a string tag. Tighten the checks when reading the enrollment metadata, bail out if any attribute is missing or invalid. Add missing recycle call for a TypedArray Stop recognition when sound model(s) change. This is needed during un-enrollment/re-enrollment. Bug: 17187528 Bug: 17205230 Change-Id: Idb00b51ef8c4ea0a8f8993decea582223181fa3d
* | am 69d4c16b: am fc5a45fd: am 57ab4478: Merge "Make Test Voice Interactor ↵Barnaby James2014-08-116-1/+149
|\ \ | |/ | | | | | | | | | | support new requirements." into lmp-dev * commit '69d4c16bd7fe2530f8fd35f04b87cb3034d8bafe': Make Test Voice Interactor support new requirements.
| * Make Test Voice Interactor support new requirements.Barnaby James2014-08-096-1/+149
| | | | | | | | | | | | Add settings activity and stub RecognizerService to voice interactor test. Change-Id: I3c3dda7d2c30eac5e0b889c0c7305dc8f4dfbcb9
* | am 22a3c9e6: am 9ac2891f: am 53f4a335: Merge "Handle microphone ↵Sandeep Siddhartha2014-08-081-0/+10
|\ \ | |/ | | | | | | | | | | contention/Phone calls while recognition is active" into lmp-dev * commit '22a3c9e6d899197f772837dabb810a539d3782ac': Handle microphone contention/Phone calls while recognition is active
| * Handle microphone contention/Phone calls while recognition is activeSandeep Siddhartha2014-08-071-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Internally we pause the recognition when: - a phone call is active/off-hook/ringing - or some other application grabs the microphone we auto-resume when the condition that caused us to pause reverses. Both these events are notified to the client via callbacks so that they can choose to display on their UI, that the recognition is paused for some reason. Bug: 16515468 Bug: 16740806 Bug: 16514535 Change-Id: Ib274d68522c8cf37d42402c875b16159957657f0
* | am 73d5dc67: am 969edb82: am 5885981a: Merge "Fix build break" into lmp-devSandeep Siddhartha2014-08-081-2/+2
|\ \ | |/ | | | | | | * commit '73d5dc67665778a5cf01dc0cb0d586e57834c991': Fix build break
| * Fix build breakSandeep Siddhartha2014-08-071-2/+2
| | | | | | | | Change-Id: I7af700671f1a2e910b6e08498381c8adb40631f8
* | Fix VoiceInteractionService.isActiveService.Barnaby James2014-08-061-0/+9
|/ | | | | | Small fix + added to the test application. Change-Id: I05ad84c32064fc98d3bb90eff921702af9855a66
* Add a flag for multiple triggers with same recognition sessionSandeep Siddhartha2014-08-011-13/+8
| | | | | | | | | | | | | | Also annotate the flags with @IntDef to make things clearer and safer Add more debug logging Revert to start/stop being synchronous since telephony and microphone will need to be handled internally. Bug: 16731586 Bug: 16514535 Bug: 16549061 Change-Id: I83695d52e9547269c95d443e4d921c9238b7401e
* Tighten the checks around a detector being invalidatedSandeep Siddhartha2014-07-311-5/+0
| | | | | | | | | | | | | | | | | | | Don't call back for a detector being marked invalid because that happens when someone else obtains a detector or VIS shuts down, in either case we don't want a loop where two entities keep creating new detectors and being invalidated. Don't call back on an invalid detector for availability change/detected/started and stopped only propagate errors. This helps us with cases where a callback for the previous VIS may get called and then crash because it tries to make calls without being the current VIS. In the new scheme of things, if the VIS changes, or the current VIS obtains a new AlwaysOnHotwordDetector, the previous one is shutdown and internally marked as invalid and all calls to it fail with an IllegalStateException. Bug: 16629417 Change-Id: I74417bf76ba80916ebc21b042c18b3467857733e
* Make startRecognition asyncSandeep Siddhartha2014-07-301-3/+12
| | | | | | | | | | | | | | - This is needed for telephony and audio integration which should happen via async callbacks that'll end up starting/stopping recognition. e.g. if a startRecognition happens when in a phone call - the onDetectionStarted will get called once the phone call ends. For now the transient stoppages due to internal reasons will not be propagated back to the client. Bug: 16514535 Bug: 16515468 Change-Id: I1b2b8edd28f5c5e67c453f66c23e1a67a626114e
* Make hotword availability a callbackSandeep Siddhartha2014-07-221-13/+9
| | | | | | | | | | | | This helps us make the list sound models operation an async one, it also helps us with the case where a detector is invalidated, so the client doesn't have to keep checking the state. Synchronize DatabaseHelper methods on its instance so that other VoiceInteractionManagerService calls aren't blocked on db writes/reads. It's still possible for the list operation to be blocked on update and vice-versa Change-Id: Ib8ec4ac5056b62d443038560ce31d0641b4627b0
* AlwaysOnHotwordDetector needs to reflect enrollment changesSandeep Siddhartha2014-07-221-18/+34
| | | | | | | | | Add a callback for when any sound model change happens. This helps the VIS to re-check the availability and either enroll the user, or start/stop recognition. Also shut down any active recognition when VIS dies, or a different hotword detector instance is obtained from VIS. Change-Id: I03f94e78c6ee307afe822a84aebc7e74c64de7b4
* Add permissions associated with app ops.Dianne Hackborn2014-07-211-0/+2
| | | | Change-Id: I575ad7a3ceea59486ca601f69760b14f6269511d