summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-02-03 17:18:49 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-02-03 17:18:49 -0800
commit793dd9f2be9c802c5e78831fe6765d697466eaf4 (patch)
tree51fed8bc4223e003cb618214d80bc464d543abfb /include
parentb6bb4031b51c94b00c793dc748e8b36979b94cd4 (diff)
parent01056fcfbbbb577f7d70324a4d6a3a211a519951 (diff)
downloadhardware_libhardware_legacy-793dd9f2be9c802c5e78831fe6765d697466eaf4.zip
hardware_libhardware_legacy-793dd9f2be9c802c5e78831fe6765d697466eaf4.tar.gz
hardware_libhardware_legacy-793dd9f2be9c802c5e78831fe6765d697466eaf4.tar.bz2
am 01056fcf: am 36291a74: Fix issue 3371080.
* commit '01056fcfbbbb577f7d70324a4d6a3a211a519951': Fix issue 3371080.
Diffstat (limited to 'include')
-rw-r--r--include/hardware_legacy/AudioPolicyInterface.h2
-rw-r--r--include/hardware_legacy/AudioPolicyManagerBase.h8
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 1a4a5f8..7eb1c25 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
@@ -114,6 +114,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:
@@ -150,6 +152,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
@@ -316,7 +319,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