summaryrefslogtreecommitdiff
path: root/core/java/android/speech
Commit message (Collapse)AuthorAgeFilesLines
* RESTRICT AUTOMERGE Backport preventing BAL bypass via bound serviceNan Wu2024-08-271-1/+2
| | | | | | | | | | | | | Apply similar fix for WallpaperService to TextToSpeech Service, Job Service, Print Service, Sync Service and MediaRoute2Provider Service Bug: 232798473, 232798676, 336490997 Test: Manual test. BackgroundActivityLaunchTest (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:95b71ad87dc24cd7d3ad91172aa2a9e16c19fb82) Merged-In: Ib113e45aa18296b4475b90d6dcec5dd5664f4c80 Change-Id: Ib113e45aa18296b4475b90d6dcec5dd5664f4c80 Change-Id: Idafb06cbf219fefa56c29c7a6ae9565ab0433e17
* base: TtsEngines: fix yet another NPEjhonboy1212022-10-261-1/+1
| | | | | Signed-off-by: jhonboy121 <alfredmathew05@gmail.com> Change-Id: Idecbd92e2b879323880d47f680ed81fc6c413cc8
* TtsEngines: avoid crashes caused by null engine nameOliver Scott2022-10-261-1/+1
| | | | | Change-Id: I5ef9d0fab7a4087d2dce5bd16e2a515903f83c51 (cherry picked from commit 9a019d4998b10cfaeb5711dbc07914622d1e3792)
* Skip preflight RECORD_AUDIO in RecognitionService if FD providedNate Myren2022-05-101-2/+3
| | | | | | | | | | If a file descriptor is provided to a recognitionService using the EXTRA_AUDIO_SOURCE option, then do not make a preflight RECORD_AUDIO check Test: manual Bug: 226969470 Change-Id: Ibc9fa378f5375a38922f1791c13600a3a5ab55f1
* speech: Remove @Deprecated fields after renameAndrea Ambu2022-03-241-209/+11
| | | | | | | | These APIs are new in T, they have new fields with new names now. Bug: 225420491 Test: atest Change-Id: Ia303a6e365c77df47578edd9ce6f7d14241d7cf0
* speech: Add online languages to RecognitionSupportAndrea Ambu2022-03-211-33/+297
| | | | | | | | | | This is based on the feedback from the speech recognition team: we need to distinguish information for online vs offline classifiers. The deprecated APIs are due to be removed soon: b/225420491 Bug: 204189031 Test: atest Change-Id: I48e413c13480df0c150cd7663e9d54196149b024
* Update RecognitionListener JavaDoc to link to the right extra.Qi Cao2022-02-182-5/+5
| | | | | | | | Fix: 220247022 Test: Only JavaDoc changes. No test needed. Change-Id: I1ea9673da0b18efb6432f37e9aacb88ffecbca37 (cherry picked from commit 311e617aaccc628d2315e952e01811f3808d691b)
* Merge "Added public extras for audio injection, biasing, formatting, masking ↵Dharmesh Mokani2022-02-171-71/+191
|\ | | | | | | offensive words. Reworded existing extras for segmented session feature."
| * Added public extras for audio injection, biasing, formatting, maskingQi Cao2022-02-151-71/+191
| | | | | | | | | | | | | | | | | | | | offensive words. Reworded existing extras for segmented session feature. Reference doc: go/recognizer-intent-public-doc Bug: 218705986 Test: Only adding strings and doc. No test needed. Change-Id: I929ddfd59ea17c9ed4cdc22a9ddb90dcc409c40b
* | speech: Prefix trigger event with "on"Andrea Ambu2022-02-161-2/+2
| | | | | | | | | | | | | | Bug: 216474485 Fix: 216474485 Test: atest Change-Id: I675ab584c3bd063fb8550554e4c60e9e523fb7a8
* | 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: Fix builder pluralityAndrea Ambu2022-02-111-14/+8
| | | | | | | | | | | | Bug: 216474107 Test: atest Change-Id: Ib804f70db5d9e617b36f4f2eb4bd2ed61a4f185b
* | 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-085-1/+93
| | | | | | | cd49383e17b0566d4e6107c70fe006ca0dff7886 Test: atest Change-Id: I8b743e39172e307480d4f4ba6ec21769135c9da8
* Revert "speech: Allow long speech sessions"Shubham Dubey2022-02-075-92/+1
| | | | | | | | | | | | | | | 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-045-1/+92
| | | | | | | | | See go/one-speech-long-form Bug: 204189031 Cts-Coverage-Bug: 204189031 Test: atest Change-Id: I62adfa7aca5e8df32253c141bd4dd7bc7e4fad3c
* Merge "Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex"""TreeHugger Robot2022-01-201-1/+1
|\
| * Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""Bernardo Rufino2022-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 331be9a6431d6489f8d1e1b80cb510d0ee073c50. Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55). Original commit message: Migrate unsafe parcel APIs in framework-minus-apex Migrate the following unsafe parcel APIs in framework-minus-apex: * Parcel.readSerializable() * Parcel.readArrayList() * Parcel.readList() * Parcel.readParcelable() * Parcel.readParcelableList() * Parcel.readSparseArray() This CL was generated by applying lint fixes that infer the expected type from the caller code and provide that as the type parameter (ag/16365240). A few observations: * In some classes we couldn't migrate because the class also belonged to another build module whose min SDK wasn't current (as is the case for framework-minus-apex), hence I suppressed the lint check (since I'll eventually submit the lint check to the tree). * In some cases, I needed to do the cast in https://stackoverflow.com/a/1080525/5765705 to make the compiler happy since there isn't another way of providing a class of type Class<MyClassWithGenerics<T>>. * In the readSerializable() case, the new API also requires the class loader, that was inferred to by InferredClass.class.getClassLoader(). * Note that automatic formatting and import rely on running hooked up to the IDE, which wasn't the case here. Bug: 195622897 Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93 Test: TH passes
* | Merge "speech: Add api to check request is supported"Andrea Ambu2022-01-197-9/+666
|\ \ | |/ |/|
| * speech: Add api to check request is supportedAndrea Ambu2022-01-187-9/+666
| | | | | | | | | | | | | | Bug: 204189031 CTS-Coverage-Bug: 208776893 Test: atest, new tests TBD Change-Id: Id3d7df47f52efc31227edb577db44b9e4ca04265
* | Revert "Migrate unsafe parcel APIs in framework-minus-apex"Bernardo Rufino2022-01-121-1/+1
|/ | | | | | | | This reverts commit 90bb3709dc75f7e44914222114752de5bce133d4. Reason for revert: b/214053959 Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
* Migrate unsafe parcel APIs in framework-minus-apexBernardo Rufino2021-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate the following unsafe parcel APIs in framework-minus-apex: * Parcel.readSerializable() * Parcel.readArrayList() * Parcel.readList() * Parcel.readParcelable() * Parcel.readParcelableList() * Parcel.readSparseArray() This CL was generated by applying lint fixes that infer the expected type from the caller code and provide that as the type parameter (ag/16365240). A few observations: * In some classes we couldn't migrate because the class also belonged to another build module whose min SDK wasn't current (as is the case for framework-minus-apex), hence I suppressed the lint check (since I'll eventually submit the lint check to the tree). * In some cases, I needed to do the cast in https://stackoverflow.com/a/1080525/5765705 to make the compiler happy since there isn't another way of providing a class of type Class<MyClassWithGenerics<T>>. * In the readSerializable() case, the new API also requires the class loader, that was inferred to by InferredClass.class.getClassLoader(). * Note that automatic formatting and import rely on running hooked up to the IDE, which wasn't the case here. Bug: 195622897 Test: TH passes Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
* Do not fail Recognition on MODE_IGNORED for preflightNate Myren2021-09-101-5/+6
| | | | | | | | | Recognition will fail upon attempting to open the microphone, if it is accessed. Bug: 197465285 Test: manual Change-Id: I83f1ae30295caf576eb7a6f0191313cb789f1d52
* Merge "Only check downstream permissions in preflight in RecognitionService" ↵TreeHugger Robot2021-07-151-13/+2
|\ | | | | | | into sc-dev
| * Only check downstream permissions in preflight in RecognitionServiceNate Myren2021-07-121-13/+2
| | | | | | | | | | | | | | | | | | | | Ensure that, in the preflight permission check, RecognitionService does not check the service's own permissions. These will be checked if the RecognitionService tries to access the mic Fixes: 193111794 Test: manual Change-Id: I172849f2e0368f9601dc298e6cf96d7a52219e5a
* | Merge "speech: Add lenient SpeechRecognizer instantiation" into sc-devAndrea Ambu2021-07-081-22/+27
|\ \ | |/ |/|
| * 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
* | Avoid creating Recognition Callback if preflight failsNate Myren2021-07-021-12/+27
| | | | | | | | | | | | | | | | | | Only create the callback (and call onCancel) if the preflight permission check succeeds. Bug: 190848702 Test: manual Change-Id: Ie7155348213e86dea0a9080a9c4ed53144f91c6f
* | Merge "Cancel RecognitionService if permission check fails" into sc-devNate Myren2021-07-021-2/+14
|\ \
| * | Cancel RecognitionService if permission check failsNate Myren2021-07-011-2/+14
| |/ | | | | | | | | | | | | | | | | This ensures that, when platform checks fail, the RecognitionService is notified that it should cancel recognition Fixes: 190848702 Test: manual Change-Id: I5073728e544a47f386824ca0a034e149661d864a
* / Try to finish data delivery in onDestroy for RecognitionServiceNate Myren2021-07-011-0/+1
|/ | | | | | Test: manual Fixes: 192275399 Change-Id: I56b2e59f80da3e4c6f59236637ec32c1aff1a50a
* Properly check for SDK before nullifying attribution tagNate Myren2021-06-151-0/+1
| | | | | | | | Also adds @SuppressLint to RecognitionService#createContext Fixes: 190759697 Test: manual Change-Id: I8ad14f93f86285127d5d2674b0f9a4963b03c933
* Merge "speech: Update createSpeechRecognizer javadoc" into sc-devTreeHugger Robot2021-06-141-4/+9
|\
| * 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
* | Don don't blame if attr ctx createdSvet Ganov2021-06-121-10/+26
|/ | | | | | | | Test: manual bug: 190657833 Change-Id: Id7c65999baa294a53765f5d17f77a7903611e85a
* Switch media fw permissions checks to AttributionSourceSvet Ganov2021-06-011-55/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attribution source is the abstraction to capture the data flows for private data across apps. Checking permissions for an attribution source does this for all apps in the chain that would receive the data as well as the relevant app ops are checked/noted/started as needed. Teach speech recognition service about attribution chains. If an implementation does nothing the OS would enforce permisisons and do blame as always. This apporach leads to double blaming and doesn't support attribition chains where app calls into the default recognizer which calls into the on device recognizer (this nests recursively). If the implementer takes advantage of the attribution chain mechanims the permissions for the entire chain are checked at mic access time and all apps are blamed only once. Fixed a few bugs around finishing ops for attribution chains. Also ensured that any app death in a started attribution chain would lead to finishing the op for this app bug: 158792096 Test: (added tests for speech reco) atest CtsMediaTestCases atest CtsPermissionTestCases atest CtsPermission2TestCases atest CtsPermission3TestCases atest CtsPermission4TestCases atest CtsPermission5TestCases atest CtsAppOpsTestCases atest CtsAppOps2TestCases Merged-In: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4 Change-Id: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4
* speech: TEST_MAPPING CtsVoiceRecognitionTestCasesAndrea Ambu2021-05-211-0/+15
| | | | | | | | | | | ag/14530956 broke presubmit (b/188784537) because CtsVoiceRecognitionTestCases did not run. This makes them run for any change to core/java/android/speech Bug: 188784537 Test: presubmitting this CL Change-Id: I9e65abad8d242e5bb87fabc3523909bb14eed3c1
* speech: Add #isOnDeviceRecognitionAvailableAndrea Ambu2021-05-181-1/+40
| | | | | | Bug: 188055926 Test: CtsVoiceRecognitionTestCases Change-Id: I6ba1d083005782beedb28313077af041af2ae975
* Add information to EXTRA_AUDIO_INJECT_SOURCENate Myren2021-04-261-1/+1
| | | | | | | | indicate the data for injection should be a URI to an audio resource. Fixes: 186411622 Test: none Change-Id: I70b650c8fb8fa6de648c03df3c5464a570222fee
* Change attribution integration points for SpeechRecognizer.Sergey Volnov2021-04-232-89/+59
| | | | | | | | | | | I've deleted the extra attribution for now just to fix the bug asap, but we need a long-term sync to make sure attribution works properly. For both cases when the RS app decides to integrate with the new attribution framework OR decides to ignore it. Bug: 184963112 Test: atest CtsVoiceRecognitionTestCases Change-Id: I20bd8174c1a188da6c5af55cdd3bebee8a638d2d
* Merge "Add EXTRA_AUDIO_INJECT_SOURCE to RecognizerIntent" into sc-devNate Myren2021-04-211-3/+10
|\
| * Add EXTRA_AUDIO_INJECT_SOURCE to RecognizerIntentNate Myren2021-04-201-3/+10
| | | | | | | | | | | | | | | | | | Add a constant to signify that the caller of a RecognitionService has opened an audio stream for the service Bug: 185936177 Test: build Change-Id: Id8da84714fef547d2143457c2ad1c0b631e40741
* | Add a comment mentioning that errors might be unbundled, to improveSergey Volnov2021-04-191-1/+2
|/ | | | | | | | backwards compatibility story. Bug: 183427999 Test: N/A, comment change. Change-Id: I1f583fe31c9edccada510f9a0ab2e333cc62df08
* Introduce additional error codes for better language handling.Sergey Volnov2021-04-093-3/+49
| | | | | | | | | | Additionally, address minor feedback from API council regarding errors and documentation. Test: N/A, adding constants Bug: 176578753 Bug: 183427999 Change-Id: I46358373e8d562cb829ff44232252d26bb5acda4
* Fix TextToSpeech system connection error handlingAlex Agranovich2021-04-071-3/+2
| | | | | | | | | This CL fixes client listener notification upon engine binding error. In addition fixes logs verbosity for errors caused by calls on dead client. Bug: 183085464 Test: atest CtsSpeechTestCases Change-Id: Ic67e97befd87f841430a53993ae5c79d81a0f6ba
* 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
| * Merge "Add a comment to speech recognition service requiring clients ↵Sergey Volnov2021-04-011-1/+23
| |\ | | | | | | | | | targeting Android 11 to specify a <queries> tag."
| | * 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
* | | Merge "Set up owners for SpeechRecognition packages in frameworks/base." am: ↵Treehugger Robot2021-03-311-0/+3
|\| | | | | | | | | | | | | | | | | | | | | | | 320c3cff41 am: b80973e8d9 am: f614e62c52 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1566278 Change-Id: I52e99051d1ad161d42a128227474e9f052308794