History log of /frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ba08b7945a66434a76840062b2dac1275adc4844 09-Jun-2017 Chris Thornton <thorntonc@google.com> Add SoundTriggerManager APIs to use a PendingIntent to get callbacks.

Test: APIs exercised using a special test app not in this CL.

Change-Id: I99425d1e67a778513e6c75e7d595c072032aa2ab
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
23a57404e3cb1b8672c063f0eb0e74807e725411 11-Jun-2017 Chris Thornton <thorntonc@google.com> Prevent ConcurrentModificationException in updateAllRecognitions

When invoking updateAllRecognitions, if a callback binder was determined
to have died, an internal function would go and remove it from
mModelDataMap. However, updateAllRecognitions was iterating over this
map, so it would then explode. By first making a copy of the model datas
before iterating over all of them, this problem is avoided.

(As part of trying to figure out what was happening, also updated all
the method names that implicitly assumed they had a lock, and double
checked that everything with a Locked suffix is actually locked)

Bug: 62487479
Test: Use the sound trigger test app to load and start two models, force
kill the app (so the dangling binders hang around), then enable power
save (which triggers the call to updateAllRecognitions)

Change-Id: I87b9dfc1b2af5e294050b146737916ccaad882c1
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
a533b9942dd7a93804953d633eb842f0b7cd0ede 25-Mar-2017 Chris Thornton <thorntonc@google.com> SoundTriggerHelper: Remove unused models onLoad

If some process tries to start a recognition, the STH will now check to
see if there are any other models that have been loaded and either:
- Have a callback that's died (determined by pinging the binder)
- Don't have a callback at all (meaning they didn't clean up after the
last detection and didn't start it again).
If it finds such a model, it will be stopped and unloaded, freeing up
resources in the HAL.

Test: Manually load model/kill the process and make sure that it is
unloaded the next time some other model is loaded. Also made sure
running models aren't evicted.

Change-Id: Ia1139b47afe5f88102a3773d90f4f056ea3cdc92
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
2411a2c38e6c050f2175eac48b6aaefb94a84be8 22-Mar-2017 Chris Thornton <thorntonc@google.com> Clean up dead objects when detected in the SoundTriggerHelper

If an app has died while being connected to the sound trigger helper/the
binder goes away, we should stop and unload the model since there's no
way to get a handle on it again (without reloading the same UUID at some
point).

Test: Force stop the SoundTriggerTestApp while it has a model started,
trigger the sound model, then watch it get unloaded when the helper
notices that the binder is dead.

Change-Id: Iddfaaa03482d56e71f23e5982d4bd579f386b51d
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
455e90add22835d0744fc0f5c2feb5fcaf03b28f 10-Feb-2017 jackqdyulei <jackqdyulei@google.com> Add BatterySaverPolicy for power save mode

The BatterySaverPolicy is designed to consolidate all battery saver
knobs into a central location. Usually it is consistent to
mLowPowerModeEnabled unless it gets different data for specific
service. By adding these knobs, we can effectively tune the battery
saver.

This cl sets up the framework for BatterySaverPolicy and updates
following service to get battery saver data from BatterySaverPolicy

1. GnssLocationProvider
2. VibratorService
3. WindowManagerService
4. BackupManagerService
5. SoundTriggerService
6. NetworkPolicyManagerService

Screen brightness will come in a following cl.

Bug: 34693888
Test: FrameworksServicesTests

Change-Id: I6b040e93391614b44d136a485faa4a332c396e51
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
d0a83b89a622eb4b568951113ea627ee8f484a36 20-Jul-2016 Chris Thornton <thorntonc@google.com> SoundTriggerHelpoer: Send pause events on abort if a model is running.

If the recognition was aborted due to the service state being set to
false, clients were not made aware that the model had been stopped (but
would get a resume event).

Bug: 30233664
Change-Id: I9f663362ff142eadfd5ef727c5f0c941f8e9e89d
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
f967da90528426ff48f75c9109aede2b89a14880 03-May-2016 Chris Thornton <thorntonc@google.com> VIMS should only stop the keyphrases it started.

When the VIMS changes the implementation or has its implementation force
stopped, it used to stop all the recognitions that were in the
SoundTriggerService (without letting those clients know that they've
been stopped). Instead, the VIMS should just unload the keyphrases that
it loaded, so the other clients are not perturbed.

Bug:28518547
Change-Id: Ia70e8576f43cb8a8521c947ff7fc56f63cfbad54
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
37f9776ab9aec865fe2ef6544fc84c37e48aca1a 30-Apr-2016 Chris Thornton <thorntonc@google.com> Remove the STH tracking if a model has been aborted.

The STH just needs to log the fact that a model has been stopped when it
is aborted. We also need to allow models to be stopped even if the
service is unavailable.

Bug:28474708
Change-Id: I2d618ae9c7c87311223f7d75b8ded7678252d11c
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
56056038f750d29af79e47b04b845ec24a47157f 30-Apr-2016 Chris Thornton <thorntonc@google.com> Keep STH state in sync with HAL

During stopAllRecognitions(), the internal state of a sound model was
being cleared (which made it look like the model was being unloaded).
However, the model was still loaded, so subsequent calls to load a 'new'
model would break.

Bug:28432002

Change-Id: I7090bf52704c6e46e3bb6d495d8fe4b8a1d9e2ad
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
41e04a4525923815176630a992cdbc6c4c737e6b 19-Apr-2016 Chris Thornton <thorntonc@google.com> Use .equals() to compare two UUIDs in SoundTriggerHelper, rather than ==

Also refactors ModelData::clearState to clear a bit more of the state.

Bug:28251543
Change-Id: I18d7ccd90a6a9ee8bc8743d9a92c48f17d87c842
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
fac2515695b9be78743d243b88f92d7687d24772 11-Apr-2016 Arunesh Mishra <arunesh@google.com> SoundTriggerHelper: Add ability to manage multiple voice models.

This CL adds the ability in STH to manage multiple voice models indexed by
keyphrase ID, which is an integer.

Bug: 28104190
Change-Id: I8e10cca05ed8b4b8414cae7fffc26c132d4b7cbd
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
78ab7cf301fd102fbfd99c69fd442ed93563a6f1 04-Mar-2016 Arunesh Mishra <arunesh@google.com> SoundTriggerHelper re-design.

This CL redesigns and cleans up a lot of the core logic in STH.

Major changes include:
- Adds Tron logging based counters.
- Common startRecognition(), stopRecognition() and updateRecognition()
routines that work on both Keyphrase and Generic sound models.
- Common streamlined logic for when recognition is aborted, requested and
paused due to phone call/power save etc, for both keyphrase and generic
models.
- Special handling of the singleton nature of keyphrase models in
startRecognition().
- Moves all Keyphrase model state to the common ModelData structure.
- Adds Recognition pause/resume() for generic sound models so that they react
to power save, call state, recognition aborted due to service unavailable
etc.
Bug: 27972641

Change-Id: I96a7f567d2a4973facec556892a163ca74176bbf
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
79655ebf7e1ef9dd48e71761fe71f8180d98a49f 07-Mar-2016 Ryan Bavetta <bavetta@google.com> Fix unsynchronized access to model hashmap

BUG:27529749
Change-Id: I5b7cd59d8b45858896e6014b8fe95c1cc3c77869
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
f47f173b06e2972bb376da8ff11db3a83c21d10b 19-Feb-2016 Arunesh Mishra <arunesh@google.com> Fix AlwaysOnHotwordDetector recognition event bug.

Parcelables don't work well with inheritance. So changed the
IRecognitionStatusCallback to have onKeyphraseDetected() and
onGenericSoundTriggerDetected() for those respective events.

Made corresponding changes to AlwaysOnHotwordDetector and SoundTriggerDetector.

Bug: 27250528
Change-Id: Ic08a431e7cc4248c688b05c865348170246de576
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
2d1de78a4c8fc224329a9622c9326e42a42ddadd 22-Feb-2016 Arunesh Mishra <arunesh@google.com> Unload logic for generic and keyphrase sound models.

When delete is called, now the STH unloads the corresponding models.

Fix bug with keyphrase where a delete call didn't unload (or stop)
the keyphrase model.

Bug: 27279380
Change-Id: Ia34f713d2aecef4102c0f0ccc57b8d2e5febe4bb
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
933da8150c4a80b94684c97cd6813e5018a73a8d 19-Feb-2016 Arunesh Mishra <arunesh@google.com> Fix minor bugs:

- Fix issue when multiple starts cause multiple spurious loads to be sent to
the native layer.
- Fix scrolling issue in the native app.

Bug: 27222043
Change-Id: Iddf36a8b68637f478dc23b001ecbde352db3a5f0
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
3fff7f5634ca788c1c84b6f1b316819ffd4c7cb2 09-Feb-2016 Arunesh Mishra <arunesh@google.com> SoundTriggerHelper changes for GenericSoundModels.

- Refactoring SoundTriggerHelper to handle generic sound models.
- Ability to store multiple models, callback and state information.
- Separate out initialization to be done per voice model, per any model
and per generic model.
- Minor change to the API exposed -- removing the Handler from the
createSoundTriggerDetector call.
- Added callback processing for onRecognitionEvent().
- Added logic for stopAll().
- Changes to the SoundTriggerTestApp to start/stop recognition.
- Multiple models (3).
- Ability to start/stop/load/unload individual models.

Bug: 22860713
Bug: 27222043
Change-Id: Ie5d811babb956bead653fb560a43f1e549ed11bd
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
55a9b0089c12dd657a8dc8551c79cf3e0f25d7e4 01-Feb-2016 Arunesh Mishra <arunesh@google.com> Fix moduleProperties in SoundTriggerInternal.

Change-Id: Ie7ea74ca39894f78875768dbc3e504b32f262fe6
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java
a772e5fc062c8de48cb9c1d61755110f6b2e189b 25-Jan-2016 Arunesh Mishra <arunesh@google.com> SoundTrigger API improvements.

This CL implements the SoundTrigger API improvements as given in b/22860713. Only the java-level
parts are implemented in this CL.

Key changes include:

* Addition of a SoundTriggerManager/SoundTriggerDetector system API to manage
the sound-trigger based sound models.
* Addition of a SoundTriggerService service that manages all sound models
including voice (keyphrase) and sound-trigger based models.
* Includes logic to write sound-trigger based models to the database.
* VoiceInteractionManager service now uses SoundTriggerService instead of
SoundTriggerHelper.

Bug: 22860713
Change-Id: I7b5c0ed80702527c4460372efeb5e542d3693a69
/frameworks/base/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java