summaryrefslogtreecommitdiff
path: root/core/java/android/speech/SpeechRecognizer.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix link for running support check in executor for speechShubham Dubey2022-02-151-1/+1
| | | | | | | | Following commit I9f1f2f6657b4c268546e68c1c2d23b6ad06b9c46, updating the link to fix broken sdk builds Fix: 219636671 Change-Id: Ia9ffc93f1ad0f5dfd9275bea21cf7f7db182024d
* speech: Run support check in ExecutorAndrea Ambu2022-02-141-31/+31
| | | | | | Bug: 216475054 Test: atest Change-Id: I9f1f2f6657b4c268546e68c1c2d23b6ad06b9c46
* speech: Connect on model check/download triggerAndrea Ambu2022-02-091-4/+32
| | | | | | Bug: 204189031 Test: atest Change-Id: I9a3a0aa1b9a955dcb5f7fc365c2f0511a7bba7a0
* Revert^2 "speech: Allow long speech sessions"Andrea Ambu2022-02-081-0/+16
| | | | | | | cd49383e17b0566d4e6107c70fe006ca0dff7886 Test: atest Change-Id: I8b743e39172e307480d4f4ba6ec21769135c9da8
* Revert "speech: Allow long speech sessions"Shubham Dubey2022-02-071-16/+0
| | | | | | | | | | | | | | | Revert "speech: Allow long speech sessions" Revert submission 16691164-os-long-form Reason for revert: Breaking OnDeviceRecognitionServiceTest BUG:218303318 Reverted Changes: I348fbcd70:speech: Allow long speech sessions I62adfa7ac:speech: Allow long speech sessions Change-Id: Ice4435288adb4472538c7426a4b68e9f75a2a2bc
* speech: Allow long speech sessionsAndrea Ambu2022-02-041-0/+16
| | | | | | | | | See go/one-speech-long-form Bug: 204189031 Cts-Coverage-Bug: 204189031 Test: atest Change-Id: I62adfa7aca5e8df32253c141bd4dd7bc7e4fad3c
* speech: Add api to check request is supportedAndrea Ambu2022-01-181-8/+124
| | | | | | | Bug: 204189031 CTS-Coverage-Bug: 208776893 Test: atest, new tests TBD Change-Id: Id3d7df47f52efc31227edb577db44b9e4ca04265
* speech: Add lenient SpeechRecognizer instantiationAndrea Ambu2021-07-081-22/+27
| | | | | | | | | | | | | | This change allows to test on-device listening via a temporary recognizer even in devices that do no support on device recognition. It moves the failure from the static SpeechRecognizer#createOnDeviceSpeechRecognizer to the instance #startListening. fail-on-listening Bug: 192586674 Test: atest CtsVoiceRecognitionTestCases with both config and no config Change-Id: Id722f4e5167132b76b4fbd5ea0c2ef7d19f15909
* speech: Update createSpeechRecognizer javadocAndrea Ambu2021-06-071-4/+9
| | | | | | | | | | | | | SpeechRecognizer#createSpeechRecognizer(Context, ComponentName) should be called only with ComponentNames that are actually mapped in the running environment. This update documents how to check the ComponentName is acutally mapped to RecognitionService. Bug: 187176179 Test: n/a javadoc change only Change-Id: Icbf1595f613d6f341b84879122e5eefce6c0fb4a
* speech: Add #isOnDeviceRecognitionAvailableAndrea Ambu2021-05-181-1/+40
| | | | | | Bug: 188055926 Test: CtsVoiceRecognitionTestCases Change-Id: I6ba1d083005782beedb28313077af041af2ae975
* Introduce additional error codes for better language handling.Sergey Volnov2021-04-091-0/+45
| | | | | | | | | | Additionally, address minor feedback from API council regarding errors and documentation. Test: N/A, adding constants Bug: 176578753 Bug: 183427999 Change-Id: I46358373e8d562cb829ff44232252d26bb5acda4
* Merge "Add a comment to speech recognition service requiring clients ↵Sergey Volnov2021-04-011-1/+23
|\ | | | | | | | | | | | | | | targeting Android 11 to specify a <queries> tag." am: 8c6820048d am: 507ca766ac am: 9a4b4693f6 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1660358 Change-Id: I4fb577b783a1fcc7b4817fc6fba9d8c56e14e5b5
| * Add a comment to speech recognition service requiring clients targetingSergey Volnov2021-03-311-1/+23
| | | | | | | | | | | | | | | | Android 11 to specify a <queries> tag. Bug: 173748514 Test: N/A Change-Id: If70dde1bff5d79e258e3759a1f9027d51de6b441
* | Runtime permission attribution improvementsSvet Ganov2021-03-291-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an app is proxying access to runtime permission protected data it needs to check whether the calling app has a permission to the data it is about to proxy which leaves a trace in app ops that the requesting app perofmed a data access. However, then the app doing the work needs to get the protected data itself from the OS which access gets attributed only to itself. As a result there are two data accesses in app ops where only the first one is a proxy one that app A got access to Foo through app B - that is the one we want to show in the permission tracking UIs - and one for the data access - that is the one we would want to blame on the calling app, and in fact, these two accesses should be one - that app A accessed Foo though B. This limitation requires fragile one off workarounds where both accesses use the same attribution tag and sys UI has hardcoded rules to dedupe. Since this is not documented we cannot expect that the ecosystem would reliably do this workaround in apps that that the workaround in the OS would be respected by every OEM. This change adds a mechaism to resolve this issue. It allows for an app to create an attribution context for another app and then any private data access thorugh this context would result in a single app op blame that A accessed Foo though B, i.e. we no longer have double accounting. Also this can be nested through apps, e.g. app A asks app B which asks app C for contacts. In this case app B creates an attribution context for app A and calls into app C which creates an attribution context for app B. When app C gets contacts the entire attribution chain would get a porper, single blame: that C accessed the data, that B got the data from C, and that A got the data form B. Furthermore, this mechanism ensures that apps cannot forget to check permissions for the caller before proxying private data. In our example B and C don't need to check the permisisons for A and B, respectively, since the permisisons for the entire attribution chain are checked before data delivery. Attribution chains are not forgeable preventing a bad actor to create an arbitrary one - each attribution is created by the app it refers to and points to a chain of attributions created by their corresponding apps. This change also fixes a bug where all content provider accesses were double counted in app ops due to double noting. While at this it also fixes that apps can now access their own last ops. There was a bug where one could not pass null getting the attributed ops from a historical package ops while this is a valid use case since if there is no attribution everything is mapped to the null tag. There were some app op APIs not being piped thorough the app ops delegate and by extension through the app ops policy. Also now that we have nice way to express the permission chain in a call we no longer need the special casing in activity manager to handle content provider accesses through the OS. Fixed a bug where we don't properly handle the android.os.shell calls with an invlaid tag which was failing while the shell can do any tag. Finally, to ensure the mechanims is validated and works end-to-end we are adding support for a voice recognizer to blame the client app for the mic access. The recognition service can create a blaming context when opening the mic and if the mic is open, which would do all permission checks, we would not do so again. Since changes to PermissionChercker for handling attribution sources were made the CL also hooks up renounced permissoins in the request permission flow and in the permission checks. bug:158792096 bug:180647319 Test:atest CtsPermissionsTestCases atest CtsPermissions2TestCases atest CtsPermissions3TestCases atest CtsPermissions4TestCases atest CtsPermissions5TestCases atest CtsAppOpsTestCases atest CtsAppOps2TestCases Change-Id: Ib04585515d3dc3956966005ae9d94955b2f3ee08
* | Add utility for to allow to overwrite on-device speech recognitionSergey Volnov2021-03-101-27/+94
| | | | | | | | | | | | | | | | | | | | | | temporarily. I had to define a new permission in order for it to work (which makes sense, since we only want to allow shell to overwrite the temp service). Test: adding CTS Bug: 177915986 Change-Id: I3ac8f2366595f502b42c9ad93b331d0c0039d16c
* | Redirect all speech recognition traffic through system server.Sergey Volnov2021-02-171-119/+124
| | | | | | | | | | | | Test: atest CtsVoiceRecognitionTestCases Bug: 176578753 Change-Id: I5783257b76fa21c2a6f1d2e589fb843b93753350
* | Add System speech recognition service.Eugenio Marchiori2021-01-271-28/+105
|/ | | | | | Bug: 176578753 Test: local demo, CTS will follow Change-Id: Ia7766c506bf43a5db5b9719363da66aab263fd8d
* Fix Voice shortcuts not working system-wide in Rryanlwlin2020-05-061-2/+2
| | | | | | | | | | | | | | | SpeechRecognizer binds RecognitionService to realize it's feature. When RecognitionService checks the record_audio permission, itself doesn't have the capabilities to use the permission since it's not a foreground process. We use the addition flag to allow the bounded process to get same capabilities. Bug: 154954447 Test: manual test: 1. Install Talkback with voice shortcut feature 3. assign voice shorct function to any gesture 2. launch any app to leave home and trigger shortcut via the gesture Change-Id: I2f867af739c69a5ba29bb49397819cb61915e42d
* Rename featureId -> attributionTagPhilip P. Moltmann2020-03-121-4/+5
| | | | | | | | | | | | | | | | | | In the core functionality this changes everything including aidl's and field names: - Context - ContentProvider - AppOps* - Package parsing For the rest, this is a shallow change to only change to the changed APIs. This keeps the change small-ish Exempt-From-Owner-Approval: Rename Fixes: 148792795 Test: TH Change-Id: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a Merged-In: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
* Pipe through featureId from caller to noteOps in RecognitionServicePhilip P. Moltmann2019-10-301-4/+6
| | | | | Test: Built Change-Id: Iab40419af886cccc1565f62bad29086b12ec1945
* Make sure cancel is called on tear down.Jerome Poichet2014-09-301-0/+8
| | | | | | | | | | - Make sure cancel is called when consumer of SpeechRecognizer calls destroy. - If consumer goes away, make sure to call cancel as well. b/17584947 Pressing mic button in Music hoses audio Change-Id: Ibe1198b37fe6167493a8694f9089d970f1eb07de
* Make InternalListener static to avoid referencing SpeechRecognizer.Mark Renouf2014-03-171-1/+1
| | | | Change-Id: I03bc1a5f5188551608395f3468aa69e622601820
* Update documentation for speech APIs.Marc Wilson2013-09-101-2/+8
| | | | | | | | | | | | Makes it clear that the intent and service APIs are likely to stream audio over the network and notes that impact this has on bandwidth and battery life. Also clarifies that the service API should not be used for continuous recognition as a result. The intent API only runs when the activity is in the foreground so I didn't mention continuous recognition for it. Bug: 10674392 Change-Id: Ib5e0c16b3124f4b7d892ef5bd4167f23662d2ca3
* Support speech recognizer confidence values.Mike LeBeau2011-04-051-1/+15
| | | | | | | | | | | | | | Pass speech recognizer confidence values in the SpeechRecognizer and RecognizerIntent APIs through to the caller. This change defines new API constants for keys to these values. The corresponding change is being made to Google Voice Search, and should be made to any other implementations. Bug: 3267513 Bug: 4163206 Change-Id: I294553f2eb9eb3be21298b8434117c8c5309558d
* Updated documentation for upcoming fix for @code tagsBen Dodson2010-08-261-1/+1
| | | | Change-Id: Id7b163179132b9cf180afecb4e9e10ee39bcd415
* bugfix for: OOM error while doing voice search repeatedlyValentin Kravtsov2010-04-221-0/+1
| | | | | | fix for: http://b/issue?id=2599931 Change-Id: Ic27d9eb8b29afa99787e469d9248c20f7d2988de
* Fix bug 2553592 API REVIEW: android.speechJean-Michel Trivi2010-03-301-0/+479
Change 1 of 4 Notes from API Council review: Rename RecognitionManager to SpeechRecognizer Change-Id: I892c0d714d928d5e31575c72b6a36281fc4c7a8a