summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/AudioPolicyInterface.h
Commit message (Collapse)AuthorAgeFilesLines
* audiopolicy: Be a little smarter with auto-attachSteve Kondik2016-04-071-1/+4
| | | | | | | | | | | | | | * The edge cases, ZOMG! * Instead of relying on effects to be automatically attached, let's just always notify userspace and send a bit more information. This lets the application decide if effects should be attached rather than relying on a hard-coded configuration file. * Perform the setup in getOutputForAttr, but do it on the command thread so we don't block the client. OPO-593 Change-Id: I3900b349f2e895d51fa3a3dcc2de0c4bdf6dbc08
* audiopolicy: Add notification when default effects are updatedSteve Kondik2016-03-081-0/+3
| | | | | | | | | | | | | | | | | | | * In M, we now have the ability to define a default set of audio effect on a per-stream basis. This allows us to get around the problem of apps not sending the control intents so we can implement smart global effects for specific media types. * We still need a session id in order to get a handle and configure them from an app like AudioFX, so we'll need to add some plumbing in order to send an event to interested applications. * This patch implements the native side of this. The Java layer will call down thru AudioSystem and register a callback which will be invoked by the audio policy when default effects are updated on a stream. This callback will receive both the stream type as well as the session id. * Attaching this listener requires that the caller hold the MODIFY_AUDIO_ROUTING permission. Change-Id: I142b15f2585ffca6a953c3e828e2a7c07b24f56c
* audio policy: protect capture from telephony RX path.Eric Laurent2015-08-071-0/+1
| | | | | | | | Add permission check if the capture device selected is telephony RX path. Bug: 23017158. Change-Id: Iaa34d836e6cf46b7cbbf2483fcd4306dcd27ce90
* audio policy: session routes continued.Eric Laurent2015-04-301-1/+3
| | | | | | | | | | | - Clear session routes when client process dies. - Enforce the route only when the requesting session is active. - Fix requested route not working if an output mix change is required (e.g forcing to SPEAKER when the default route is USB or A2DP). - Make sure all sessions sharing the strategy with a rerouted session have the same route (needed for volume control consistency) Change-Id: I0ab347a8fb97e73e2c5965374544c5f4fe509ef1
* Explicit routing in AudioRecordPaul McLean2015-04-281-0/+1
| | | | Change-Id: I9cc5d54883a3e5c75d553fabb619fc8e49f4f9e5
* audio policy: add binder calls for audio source controlEric Laurent2015-04-151-0/+5
| | | | | | | Add binder methods to IAudioPolicyService to control activity of external audio sources (e.g FM tuner). Change-Id: I2008308a6a996baeae502b68a790d87281efe2ff
* AudioPolicyManager: notification of dynamic policy mix activityJean-Michel Trivi2015-04-141-0/+2
| | | | | | | | | | Implement non-stream type specific ref counting in output descriptors to keep track of mix activity. Notify audio policy client of mix activity changes. Bug 20226914 Change-Id: Iec939cb640c58056f88947b611d23b4bb6d8a11b
* Adding explicit routing API to AudioTrackPaul McLean2015-04-081-0/+1
| | | | Change-Id: I40c048c7644c46f4e4f7103875206c0785c4b1dc
* Add additional info to AudioPort for enum/selection API.Paul McLean2015-02-051-1/+2
| | | | | | | | | | Add "device name" member to AudioPort. Moved unique device ID from DevicePort to AudioPort. Straighten out confusion between "name" and "address" Created string constants for Intent "extra" data keys. Combine card/address data into "address" at sender.Add additional info to AudioPort for enum/selection API. Change-Id: I1be308e12b09cd0ead9a3e9fbc9c385462299fb5
* Fix permission check for audio recordingJean-Michel Trivi2014-12-151-1/+12
| | | | | | | | | | | | | | | Define input types covering the different usecases for audio recording, and check the corresponding permissions when starting to record. Move the permission check from audio flinger to audio policy, as only the policy has the information to determine which permission to enforce. Fix missing permission when an application records audio and the audio is injected by an external policy. Bug 18736417 Change-Id: If7ec040502242c990ac8ea464db484339bdce573
* audio policy: binder calls for dynamic audio policy mixesEric Laurent2014-12-091-0/+4
| | | | | | | | | Add binder calls to register and unregister dynamic mixes to AudioPolicyManager. Bug: 16009464. Change-Id: I4ef38166d0cfc88c984970969380d0cd6eb083ac
* AudioRecord: use audio attributes instead of audio source.Eric Laurent2014-11-251-6/+7
| | | | | | | | | | | | | | | | Added AudioRecord constructor with audio attributes. Replaced AudioPolicymanager::getInput() by getInputForAttr(). No new functionality for now. Also: - Fixed warnings in AudioPolicyManager - Allocate audio session ID before calling getOutputForAttr() in AudioTrack. Bug: 16006090. Change-Id: I15df21e4411db688e3096dd801cf579d76d81711
* audio policy: new getOutputForAttr() prototype.Eric Laurent2014-11-251-9/+14
| | | | | | | | | | | | | | | | | | | | | | | Update getOutputForAttr() prototype and group all logic dealing with audio attributes to stream type conversion in audio policy manager. getOutputForAttr(): - specifies the audio session (for future use) - returns a status code - receives either stream type (for legacy) or audio attributes - returns an updated streamtype Remove logic dealing with legacy stream types to attributes conversion from AudioTrack. Use correct type for audio sessions in other APIs (startOutput() ...). releaseOutput() specifies the audio session (for future use). Bug: 18067208. Change-Id: I1bfbe9626c04c7955d77f8a70aecfad2cb204817
* Add sound trigger control by audio policyEric Laurent2014-08-051-0/+5
| | | | | | | | | | | | | | | | | Audio policy: - Added active capture indication to sound trigger service: recognition stops if concurrent capture is not supported. - Added generation of reserved I/O handle and session ID for utterance capture. Sound trigger service - Added sound model update callback handling. - Added service state callback - Simplified callback shared memory allocation. Bug: 12378680. Change-Id: Ib0292c2733e6df90fdae480633dd9953d0016ef1
* audio policy: pass session ID to capture activity methodsEric Laurent2014-07-281-4/+7
| | | | | | | | Indicate the audio session ID when calling getInput(), startInput(), stopInput(), releaseInput(). Bug: 12378680. Change-Id: I763793752f93e2f4e1445a5ab217c895af011038
* rename AudioSystem::newAudioSessionId()Eric Laurent2014-07-281-0/+2
| | | | | | | | | Rename AudioSystem::newAudioSessionId() to AudioSystem::newAudioUniqueId() as it can be used also for I/O handles. Bug: 12378680. Change-Id: I611ea3b5eb57a4b0774437f477ee87dc4ccc2cc2
* AudioFlinger: update openInput() and openOutput()Eric Laurent2014-07-281-14/+14
| | | | | | | | | | Add parameters to openInput() and openOutput(): device address, input source. Allow caller to specify a given I/O handle Group parameters in a struct audio_config. Bug: 12378680. Change-Id: I7e9af74c0d996561cc13cbee7d9012d2daf33025
* audio policy: add audio_input_flags_t and mOpenRefCountGlenn Kasten2014-07-241-1/+2
| | | | Change-Id: I5f9c7b5ebf03b9bc94efe70d3677edfabb99c194
* Add audio_input_flags_t to IAudioFlinger::openInputGlenn Kasten2014-07-171-1/+2
| | | | | | | For backward compatibility, until flags are correctly calculated, we will assume that the request is for a low latency input stream. Change-Id: I76746834e870df00833dc77cbdaa2edd2ffeec95
* AudioPolicyManager: return output for audio attributesJean-Michel Trivi2014-06-181-0/+6
| | | | | | | | | | In AudioPolicyManager, support querying an output or playback strategy for audio attributes, instead of a stream type, In AudioTrack creation, use the output returned for the track's attributes. Change-Id: I0fef05845ba676404775e2e338c10e6a96237268
* audio policy: add audio port gain controlEric Laurent2014-05-301-0/+3
| | | | | | | | | | Implement setAudioPortConfig() API to configure an audio port. Currently limited to gain control. Bug: 14815883. Change-Id: Ic1b268e5ba5c277e9f5b8fa63c81dd7c0b250024
* audio policy: add routing update client interfaceEric Laurent2014-05-291-0/+3
| | | | | | | | | | | | | Added IAudioPolicyServiceClient client binder interface for client process to receive notifications from AudioPolicyService when audio ports are added/removed or audio patches created/released. The audio patches owned by a given client are automatically released when this client binder dies. Bug: 14815883. Change-Id: I6013f6aec03b50565cffb1ad2cd1f0f8852032c5
* audio policy: implement routing controlEric Laurent2014-05-291-0/+18
| | | | | | | | | | | | | | | | | | | | | | Add implementation of audio routing control via AudioSystem APIs. The following APIs are implemented: - listAudioPorts(): return a list of devices and output/input mixers ports that can be used as sources or sinks for audio patches. - createAudioPatch()/releaseAudioPatch(): create/release a connection patch between two audio ports (e.g. to connect input from an HDMI device to a speaker output device). Only one client application can own a patch from a given source. When an audio port (device or mix) is part of an application created patch, its routing cannot not be changed by a policy decision. - listAudioPatches(): return a list of existing patches. Each audio port addition/removal and each audio patch creation/release increments a generation count. This generation count is used to ensure consistency betwen calls to listAudioPorts() and listAudioPatches(). Bug: 14815883. Change-Id: I022b638c2f5f0bb41543c7cfca7488fb45cfdd80
* DO NOT MERGE - audioflinger: first patch panel implementation.Eric Laurent2014-05-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Added a new PatchPanel subclass to AudioFlinger to handle audio ports and audio patches configuration and connection. The first implementation does not add new functionnality. AudioPolicyManager uses patch panel interface to control device routing. AudioFlinger: - Added PatchPanel class. The first implementation does not add new functionnality. PatchPanel handles routing commands for audio HAL after 3.0 or converts to setParameters for audio HALs before 3.0. - Added config events to ThreadBase to control synchronized audio patch connection. AudioPolicyManager: - Use PatchPanel API to control device selection isntead of setParameters. - New base class AudioPort common to audio device descriptors and input output stream profiles. This class is RefBase and groups attributes common to audio ports. - Use same device selection flow for input as for outputs: getNewInputDevice -> getDeviceForInptusiource -> setInputDevice Change-Id: Idaa5a883b19a45816651c58cac697640dc717cd9
* audio policy: add option to use new policy managerEric Laurent2014-03-181-3/+3
| | | | | | | | | | | | | | | | | Add build option USE_LEGACY_AUDIO_POLICY to use either new audio policy manager in local AudioPolicyManager.cpp or the legacy AudioPolicyManagerBase.cpp via the policy HAL. New features will be implemented only by the new audio policy manager. Platform customiization will be by config file or new policy HAL. AudioPolicyClientImplLegacy.cpp copied from AudioPolicyClientImpl.cpp AudioPolicyInterfaceImplLegacy.cpp copied from AudioPolicyInterfaceImpl.cpp New implementations of AudioPolicyInterface and AudioPolicyClient talking directly to AudioPolicyManager. Change-Id: I7a320883a1de13de2c9295343e996addf2f3c154
* audio policy: remove dependency from AudioSystemLegacyEric Laurent2014-03-111-28/+24
| | | | | | | | Remove all dependencies on AudioSystemLegacy from AudioPolicyManagerBase. Only use types and definitions from audio.h and audio_policy.h. Also move code back into android name space. Change-Id: I0c2582cf854027fb1e599981865a6cbe7b5a9490
* audio policy: import audio policy manager from hardware legacyEric Laurent2014-03-111-0/+261
Import AudioPolicyManagerBase from hardware/libhardware_legacy to prepare move from android_audio_legacy name space. Change-Id: I5d6682ccd2bfdeefbf2f6f81a557480a76aaf4fc