add API for ST clients run in battery saver mode
New system API interface for both SoundTriggerManager and
AlwaysOnHotwordDetector to indicate if a recognition should run in
battery saver mode or not.
Clients supply this information through the existing startRecognition
calls, and the client must hold a new privledged permission,
SOUND_TRIGGER_RUN_IN_BATTERY_SAVER, to indicate this intention.
As a prerequisite, the device PowerManagerService must have the
SoundTrigger service enabled in the battery saver mode battery policy.
If not enabled, recognition will be paused as if the client did not
provide the indication to run in battery saver mode.
Bug: 172294448
Test: build with Google search apk using this feature and verify
recognition keeps running in battery saver mode
Change-Id: Ia43be99290e6fd7c50ff8e4908d6c60ea513b19a
9 files changed