diff options
author | Eric Laurent <elaurent@google.com> | 2011-02-02 12:10:13 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2011-02-02 15:33:42 -0800 |
commit | 36291a74cd212c4172ac054ad0eec686b7e15c96 (patch) | |
tree | 0e608a89058912b9b3039b8e29a2452058310ed5 /include/hardware_legacy | |
parent | c3045e462651bf92dd91d8af91d87d09dfc5ddd8 (diff) | |
download | hardware_libhardware_legacy-36291a74cd212c4172ac054ad0eec686b7e15c96.zip hardware_libhardware_legacy-36291a74cd212c4172ac054ad0eec686b7e15c96.tar.gz hardware_libhardware_legacy-36291a74cd212c4172ac054ad0eec686b7e15c96.tar.bz2 |
Fix issue 3371080.
Move isStreamActive() method from AudioFlinger to AudioPolicyManager.
iStreamActive() now specifies a time window during which the stream is considered
active after it actually stopped.
Change-Id: Ib0d7d8f061b9f809d307ecfac40960ef582e5f0f
Diffstat (limited to 'include/hardware_legacy')
-rw-r--r-- | include/hardware_legacy/AudioPolicyInterface.h | 2 | ||||
-rw-r--r-- | include/hardware_legacy/AudioPolicyManagerBase.h | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/include/hardware_legacy/AudioPolicyInterface.h b/include/hardware_legacy/AudioPolicyInterface.h index fa7c670..df4e72a 100644 --- a/include/hardware_legacy/AudioPolicyInterface.h +++ b/include/hardware_legacy/AudioPolicyInterface.h @@ -141,6 +141,8 @@ public: int id) = 0; virtual status_t unregisterEffect(int id) = 0; + virtual bool isStreamActive(int stream, uint32_t inPastMs = 0) const = 0; + //dump state virtual status_t dump(int fd) = 0; }; diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index ca2c1e6..815ab2e 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -32,9 +32,9 @@ namespace android { #define SONIFICATION_HEADSET_VOLUME_FACTOR 0.5 // Min volume for STRATEGY_SONIFICATION streams when limited by music volume: -36dB #define SONIFICATION_HEADSET_VOLUME_MIN 0.016 -// Time in seconds during which we consider that music is still active after a music +// Time in milliseconds during which we consider that music is still active after a music // track was stopped - see computeVolume() -#define SONIFICATION_HEADSET_MUSIC_DELAY 5 +#define SONIFICATION_HEADSET_MUSIC_DELAY 5000 // Time in milliseconds during witch some streams are muted while the audio path // is switched #define MUTE_TIME_MS 2000 @@ -112,6 +112,8 @@ public: int id); virtual status_t unregisterEffect(int id); + virtual bool isStreamActive(int stream, uint32_t inPastMs = 0) const; + virtual status_t dump(int fd); protected: @@ -148,6 +150,7 @@ protected: AudioSystem::output_flags mFlags; // uint32_t mDevice; // current device this output is routed to uint32_t mRefCount[AudioSystem::NUM_STREAM_TYPES]; // number of streams of each type using this output + nsecs_t mStopTime[AudioSystem::NUM_STREAM_TYPES]; AudioOutputDescriptor *mOutput1; // used by duplicated outputs: first output AudioOutputDescriptor *mOutput2; // used by duplicated outputs: second output float mCurVolume[AudioSystem::NUM_STREAM_TYPES]; // current stream volume @@ -304,7 +307,6 @@ protected: StreamDescriptor mStreams[AudioSystem::NUM_STREAM_TYPES]; // stream descriptors for volume control String8 mA2dpDeviceAddress; // A2DP device MAC address String8 mScoDeviceAddress; // SCO device MAC address - nsecs_t mMusicStopTime; // time when last music stream was stopped bool mLimitRingtoneVolume; // limit ringtone volume to music volume if headset connected uint32_t mDeviceForStrategy[NUM_STRATEGIES]; float mLastVoiceVolume; // last voice volume value sent to audio HAL |