summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/media/AudioPolicy.h1
-rw-r--r--include/media/AudioSystem.h11
-rw-r--r--include/media/IAudioPolicyService.h2
-rw-r--r--include/media/IAudioPolicyServiceClient.h6
-rw-r--r--media/libmedia/AudioSystem.cpp34
-rw-r--r--media/libmedia/IAudioPolicyService.cpp20
-rw-r--r--media/libmedia/IAudioPolicyServiceClient.cpp31
-rw-r--r--services/audiopolicy/AudioPolicyInterface.h6
-rw-r--r--services/audiopolicy/service/AudioPolicyClientImpl.cpp9
-rw-r--r--services/audiopolicy/service/AudioPolicyEffects.cpp27
-rw-r--r--services/audiopolicy/service/AudioPolicyEffects.h12
-rw-r--r--services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp32
-rw-r--r--services/audiopolicy/service/AudioPolicyService.cpp97
-rw-r--r--services/audiopolicy/service/AudioPolicyService.h45
14 files changed, 18 insertions, 315 deletions
diff --git a/include/media/AudioPolicy.h b/include/media/AudioPolicy.h
index 5a82bae..feed402 100644
--- a/include/media/AudioPolicy.h
+++ b/include/media/AudioPolicy.h
@@ -42,7 +42,6 @@ namespace android {
// AudioSystem's implementation of the AudioPolicyClient interface
// keep in sync with AudioSystem.java
#define DYNAMIC_POLICY_EVENT_MIX_STATE_UPDATE 0
-#define AUDIO_OUTPUT_SESSION_EFFECTS_UPDATE 10
#define MIX_STATE_DISABLED -1
#define MIX_STATE_IDLE 0
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index be1d114..26a0bb2 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -31,10 +31,6 @@ namespace android {
typedef void (*audio_error_callback)(status_t err);
typedef void (*dynamic_policy_callback)(int event, String8 regId, int val);
-typedef void (*effect_session_callback)(int event,
- audio_stream_type_t stream, audio_unique_id_t sessionId,
- audio_output_flags_t flags, audio_channel_mask_t channelMask,
- uid_t uid, bool added);
class IAudioFlinger;
class IAudioPolicyService;
@@ -96,7 +92,6 @@ public:
static void setErrorCallback(audio_error_callback cb);
static void setDynPolicyCallback(dynamic_policy_callback cb);
- static status_t setEffectSessionCallback(effect_session_callback cb);
// helper function to obtain AudioFlinger service handle
static const sp<IAudioFlinger> get_audio_flinger();
@@ -424,11 +419,6 @@ private:
virtual void onAudioPortListUpdate();
virtual void onAudioPatchListUpdate();
virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state);
- virtual void onOutputSessionEffectsUpdate(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added);
private:
Mutex mLock;
@@ -448,7 +438,6 @@ private:
static sp<IAudioFlinger> gAudioFlinger;
static audio_error_callback gAudioErrorCallback;
static dynamic_policy_callback gDynPolicyCallback;
- static effect_session_callback gEffectSessionCallback;
static size_t gInBuffSize;
// previous parameters for recording buffer size queries
diff --git a/include/media/IAudioPolicyService.h b/include/media/IAudioPolicyService.h
index 3a7bd68..6b93f6f 100644
--- a/include/media/IAudioPolicyService.h
+++ b/include/media/IAudioPolicyService.h
@@ -165,8 +165,6 @@ public:
const audio_attributes_t *attributes,
audio_io_handle_t *handle) = 0;
virtual status_t stopAudioSource(audio_io_handle_t handle) = 0;
-
- virtual status_t setEffectSessionCallbacksEnabled(bool enabled) = 0;
};
diff --git a/include/media/IAudioPolicyServiceClient.h b/include/media/IAudioPolicyServiceClient.h
index 18aed8d..a7f2cc3 100644
--- a/include/media/IAudioPolicyServiceClient.h
+++ b/include/media/IAudioPolicyServiceClient.h
@@ -37,12 +37,6 @@ public:
virtual void onAudioPatchListUpdate() = 0;
// Notifies a change in the mixing state of a specific mix in a dynamic audio policy
virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state) = 0;
- // Notifies when a default effect set is attached to a session/stream
- virtual void onOutputSessionEffectsUpdate(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added) = 0;
};
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index 5bd8747..9d645f0 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -37,7 +37,7 @@ sp<IAudioFlinger> AudioSystem::gAudioFlinger;
sp<AudioSystem::AudioFlingerClient> AudioSystem::gAudioFlingerClient;
audio_error_callback AudioSystem::gAudioErrorCallback = NULL;
dynamic_policy_callback AudioSystem::gDynPolicyCallback = NULL;
-effect_session_callback AudioSystem::gEffectSessionCallback = NULL;
+
// establish binder interface to AudioFlinger service
const sp<IAudioFlinger> AudioSystem::get_audio_flinger()
@@ -652,21 +652,6 @@ status_t AudioSystem::AudioFlingerClient::removeAudioDeviceCallback(
gDynPolicyCallback = cb;
}
-/*static*/ status_t AudioSystem::setEffectSessionCallback(effect_session_callback cb)
-{
- const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
- if (aps == 0) return PERMISSION_DENIED;
-
- Mutex::Autolock _l(gLock);
- gEffectSessionCallback = cb;
-
- status_t status = aps->setEffectSessionCallbacksEnabled(cb != NULL);
- if (status != OK) {
- gEffectSessionCallback = NULL;
- }
- return status;
-}
-
// client singleton for AudioPolicyService binder interface
// protected by gLockAPS
sp<IAudioPolicyService> AudioSystem::gAudioPolicyService;
@@ -1238,23 +1223,6 @@ void AudioSystem::AudioPolicyServiceClient::onDynamicPolicyMixStateUpdate(
}
}
-void AudioSystem::AudioPolicyServiceClient::onOutputSessionEffectsUpdate(
- audio_stream_type_t stream, audio_session_t sessionId,
- audio_output_flags_t flags, audio_channel_mask_t channelMask,
- uid_t uid, bool added)
-{
- ALOGV("AudioPolicyServiceClient::onOutputSessionEffectsUpdate(%d, %d, %d)", stream, sessionId, added);
- effect_session_callback cb = NULL;
- {
- Mutex::Autolock _l(AudioSystem::gLock);
- cb = gEffectSessionCallback;
- }
-
- if (cb != NULL) {
- cb(AUDIO_OUTPUT_SESSION_EFFECTS_UPDATE, stream, sessionId, flags, channelMask, uid, added);
- }
-}
-
void AudioSystem::AudioPolicyServiceClient::binderDied(const wp<IBinder>& who __unused)
{
{
diff --git a/media/libmedia/IAudioPolicyService.cpp b/media/libmedia/IAudioPolicyService.cpp
index 6ff8149..76b5924 100644
--- a/media/libmedia/IAudioPolicyService.cpp
+++ b/media/libmedia/IAudioPolicyService.cpp
@@ -74,7 +74,6 @@ enum {
START_AUDIO_SOURCE,
STOP_AUDIO_SOURCE,
SET_AUDIO_PORT_CALLBACK_ENABLED,
- SET_EFFECT_SESSION_CALLBACK_ENABLED,
};
#define MAX_ITEMS_PER_LIST 1024
@@ -656,18 +655,6 @@ public:
remote()->transact(SET_AUDIO_PORT_CALLBACK_ENABLED, data, &reply);
}
- virtual status_t setEffectSessionCallbacksEnabled(bool enabled)
- {
- Parcel data, reply;
- data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
- data.writeInt32(enabled ? 1 : 0);
- status_t status = remote()->transact(SET_EFFECT_SESSION_CALLBACK_ENABLED, data, &reply);
- if (status != NO_ERROR) {
- return status;
- }
- return (status_t)reply.readInt32();
- }
-
virtual status_t acquireSoundTriggerSession(audio_session_t *session,
audio_io_handle_t *ioHandle,
audio_devices_t *device)
@@ -1251,13 +1238,6 @@ status_t BnAudioPolicyService::onTransact(
return NO_ERROR;
} break;
- case SET_EFFECT_SESSION_CALLBACK_ENABLED: {
- CHECK_INTERFACE(IAudioPolicyService, data, reply);
- status_t status = setEffectSessionCallbacksEnabled(data.readInt32() == 1);
- reply->writeInt32(status);
- return NO_ERROR;
- } break;
-
case ACQUIRE_SOUNDTRIGGER_SESSION: {
CHECK_INTERFACE(IAudioPolicyService, data, reply);
sp<IAudioPolicyServiceClient> client = interface_cast<IAudioPolicyServiceClient>(
diff --git a/media/libmedia/IAudioPolicyServiceClient.cpp b/media/libmedia/IAudioPolicyServiceClient.cpp
index ecf0d1f..65cc7d6 100644
--- a/media/libmedia/IAudioPolicyServiceClient.cpp
+++ b/media/libmedia/IAudioPolicyServiceClient.cpp
@@ -30,8 +30,7 @@ namespace android {
enum {
PORT_LIST_UPDATE = IBinder::FIRST_CALL_TRANSACTION,
PATCH_LIST_UPDATE,
- MIX_STATE_UPDATE,
- OUTPUT_SESSION_EFFECTS_UPDATE
+ MIX_STATE_UPDATE
};
class BpAudioPolicyServiceClient : public BpInterface<IAudioPolicyServiceClient>
@@ -64,23 +63,6 @@ public:
data.writeInt32(state);
remote()->transact(MIX_STATE_UPDATE, data, &reply, IBinder::FLAG_ONEWAY);
}
-
- void onOutputSessionEffectsUpdate(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added)
- {
- Parcel data, reply;
- data.writeInterfaceToken(IAudioPolicyServiceClient::getInterfaceDescriptor());
- data.writeInt32(stream);
- data.writeInt32(sessionId);
- data.writeInt32(flags);
- data.writeInt32(channelMask);
- data.writeInt32(uid);
- data.writeInt32(added ? 1 : 0);
- remote()->transact(OUTPUT_SESSION_EFFECTS_UPDATE, data, &reply, IBinder::FLAG_ONEWAY);
- }
};
IMPLEMENT_META_INTERFACE(AudioPolicyServiceClient, "android.media.IAudioPolicyServiceClient");
@@ -108,17 +90,6 @@ status_t BnAudioPolicyServiceClient::onTransact(
onDynamicPolicyMixStateUpdate(regId, state);
return NO_ERROR;
}
- case OUTPUT_SESSION_EFFECTS_UPDATE: {
- CHECK_INTERFACE(IAudioPolicyServiceClient, data, reply);
- audio_stream_type_t stream = static_cast<audio_stream_type_t>(data.readInt32());
- audio_session_t sessionId = static_cast<audio_session_t>(data.readInt32());
- audio_output_flags_t flags = static_cast<audio_output_flags_t>(data.readInt32());
- audio_channel_mask_t channelMask = static_cast<audio_channel_mask_t>(data.readInt32());
- uid_t uid = static_cast<uid_t>(data.readInt32());
- bool added = data.readInt32() > 0;
- onOutputSessionEffectsUpdate(stream, sessionId, flags, channelMask, uid, added);
- return NO_ERROR;
- }
default:
return BBinder::onTransact(code, data, reply, flags);
}
diff --git a/services/audiopolicy/AudioPolicyInterface.h b/services/audiopolicy/AudioPolicyInterface.h
index bf9dd64..c1e7bc0 100644
--- a/services/audiopolicy/AudioPolicyInterface.h
+++ b/services/audiopolicy/AudioPolicyInterface.h
@@ -331,12 +331,6 @@ public:
virtual audio_unique_id_t newAudioUniqueId() = 0;
virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state) = 0;
-
- virtual void onOutputSessionEffectsUpdate(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added) = 0;
};
extern "C" AudioPolicyInterface* createAudioPolicyManager(AudioPolicyClientInterface *clientInterface);
diff --git a/services/audiopolicy/service/AudioPolicyClientImpl.cpp b/services/audiopolicy/service/AudioPolicyClientImpl.cpp
index f1a2ae9..489a9be 100644
--- a/services/audiopolicy/service/AudioPolicyClientImpl.cpp
+++ b/services/audiopolicy/service/AudioPolicyClientImpl.cpp
@@ -219,15 +219,6 @@ void AudioPolicyService::AudioPolicyClient::onDynamicPolicyMixStateUpdate(
mAudioPolicyService->onDynamicPolicyMixStateUpdate(regId, state);
}
-void AudioPolicyService::AudioPolicyClient::onOutputSessionEffectsUpdate(
- audio_stream_type_t stream, audio_session_t sessionId,
- audio_output_flags_t flags, audio_channel_mask_t channelMask,
- uid_t uid, bool added)
-{
- mAudioPolicyService->onOutputSessionEffectsUpdate(stream, sessionId,
- flags, channelMask, uid, added);
-}
-
audio_unique_id_t AudioPolicyService::AudioPolicyClient::newAudioUniqueId()
{
return AudioSystem::newAudioUniqueId();
diff --git a/services/audiopolicy/service/AudioPolicyEffects.cpp b/services/audiopolicy/service/AudioPolicyEffects.cpp
index fce471f..26857b1 100644
--- a/services/audiopolicy/service/AudioPolicyEffects.cpp
+++ b/services/audiopolicy/service/AudioPolicyEffects.cpp
@@ -28,7 +28,6 @@
#include <utils/Vector.h>
#include <utils/SortedVector.h>
#include <cutils/config_utils.h>
-#include "AudioPolicyService.h"
#include "AudioPolicyEffects.h"
#include "ServiceUtilities.h"
@@ -38,8 +37,7 @@ namespace android {
// AudioPolicyEffects Implementation
// ----------------------------------------------------------------------------
-AudioPolicyEffects::AudioPolicyEffects(AudioPolicyService *audioPolicyService) :
- mAudioPolicyService(audioPolicyService)
+AudioPolicyEffects::AudioPolicyEffects()
{
// load automatic audio effect modules
if (access(AUDIO_EFFECT_VENDOR_CONFIG_FILE2, R_OK) == 0) {
@@ -246,7 +244,6 @@ status_t AudioPolicyEffects::addOutputSessionEffects(audio_io_handle_t output,
if (idx < 0) {
procDesc = new EffectVector(audioSession);
mOutputSessions.add(audioSession, procDesc);
-
} else {
// EffectVector is existing and we just need to increase ref count
procDesc = mOutputSessions.valueAt(idx);
@@ -275,29 +272,9 @@ status_t AudioPolicyEffects::addOutputSessionEffects(audio_io_handle_t output,
procDesc->setProcessorEnabled(true);
}
-
return status;
}
-status_t AudioPolicyEffects::doAddOutputSessionEffects(audio_io_handle_t /* output */,
- audio_stream_type_t stream,
- int session,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask, uid_t uid)
-{
- if (uint32_t(stream) >= AUDIO_STREAM_CNT) {
- return BAD_VALUE;
- }
- ALOGV("doAddOutputSessionEffects()");
-
- // notify listeners
- mAudioPolicyService->onOutputSessionEffectsUpdate(stream, (audio_session_t)session,
- flags, channelMask, uid, true);
-
- // Never return an error if effects setup fails.
- return NO_ERROR;
-}
-
status_t AudioPolicyEffects::releaseOutputSessionEffects(audio_io_handle_t output,
audio_stream_type_t stream,
int audioSession)
@@ -322,7 +299,7 @@ status_t AudioPolicyEffects::releaseOutputSessionEffects(audio_io_handle_t outpu
procDesc->mEffects.clear();
delete procDesc;
mOutputSessions.removeItemsAt(index);
- ALOGV("doReleaseOutputSessionEffects(): output processing released from session: %d",
+ ALOGV("releaseOutputSessionEffects(): output processing released from session: %d",
audioSession);
}
return status;
diff --git a/services/audiopolicy/service/AudioPolicyEffects.h b/services/audiopolicy/service/AudioPolicyEffects.h
index 1c251e0..3845050 100644
--- a/services/audiopolicy/service/AudioPolicyEffects.h
+++ b/services/audiopolicy/service/AudioPolicyEffects.h
@@ -31,8 +31,6 @@
namespace android {
-class AudioPolicyService;
-
// ----------------------------------------------------------------------------
// AudioPolicyEffects class
@@ -46,7 +44,7 @@ public:
// The constructor will parse audio_effects.conf
// First it will look whether vendor specific file exists,
// otherwise it will parse the system default file.
- AudioPolicyEffects(AudioPolicyService *audioPolicyService);
+ AudioPolicyEffects();
virtual ~AudioPolicyEffects();
// NOTE: methods on AudioPolicyEffects should never be called with the AudioPolicyService
@@ -86,12 +84,6 @@ public:
audio_stream_type_t stream,
int audioSession);
- status_t doAddOutputSessionEffects(audio_io_handle_t output,
- audio_stream_type_t stream,
- int audioSession,
- audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE,
- audio_channel_mask_t channelMask = 0, uid_t uid = 0);
-
private:
// class to store the description of an effects and its parameters
@@ -200,8 +192,6 @@ private:
KeyedVector< audio_stream_type_t, EffectDescVector* > mOutputStreams;
// Automatic output effects are unique for audiosession ID
KeyedVector< int32_t, EffectVector* > mOutputSessions;
-
- AudioPolicyService *mAudioPolicyService;
};
}; // namespace android
diff --git a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
index 54b1982..c0d3866 100644
--- a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
+++ b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
@@ -18,7 +18,6 @@
//#define LOG_NDEBUG 0
#include <utils/Log.h>
-#include <media/AudioPolicyHelper.h>
#include "AudioPolicyService.h"
#include "ServiceUtilities.h"
@@ -163,29 +162,18 @@ status_t AudioPolicyService::getOutputForAttr(const audio_attributes_t *attr,
return NO_INIT;
}
ALOGV("getOutput()");
- status_t status;
- sp<AudioPolicyEffects> audioPolicyEffects;
- {
- Mutex::Autolock _l(mLock);
+ Mutex::Autolock _l(mLock);
- // if the caller is us, trust the specified uid
- if (IPCThreadState::self()->getCallingPid() != getpid_cached || uid == (uid_t)-1) {
- uid_t newclientUid = IPCThreadState::self()->getCallingUid();
- if (uid != (uid_t)-1 && uid != newclientUid) {
- ALOGW("%s uid %d tried to pass itself off as %d", __FUNCTION__, newclientUid, uid);
- }
- uid = newclientUid;
+ // if the caller is us, trust the specified uid
+ if (IPCThreadState::self()->getCallingPid() != getpid_cached || uid == (uid_t)-1) {
+ uid_t newclientUid = IPCThreadState::self()->getCallingUid();
+ if (uid != (uid_t)-1 && uid != newclientUid) {
+ ALOGW("%s uid %d tried to pass itself off as %d", __FUNCTION__, newclientUid, uid);
}
- status = mAudioPolicyManager->getOutputForAttr(attr, output, session, stream, uid, samplingRate,
- format, channelMask, flags, selectedDeviceId, offloadInfo);
- audioPolicyEffects = mAudioPolicyEffects;
- }
-
- if (audioPolicyEffects != 0) {
- audioPolicyEffects->doAddOutputSessionEffects(*output, *stream, session, flags, channelMask, uid);
+ uid = newclientUid;
}
-
- return status;
+ return mAudioPolicyManager->getOutputForAttr(attr, output, session, stream, uid, samplingRate,
+ format, channelMask, flags, selectedDeviceId, offloadInfo);
}
status_t AudioPolicyService::startOutput(audio_io_handle_t output,
@@ -282,8 +270,6 @@ void AudioPolicyService::doReleaseOutput(audio_io_handle_t output,
{
ALOGV("doReleaseOutput from tid %d", gettid());
Mutex::Autolock _l(mLock);
- onOutputSessionEffectsUpdate(stream, session,
- AUDIO_OUTPUT_FLAG_NONE, 0, -1, false);
mAudioPolicyManager->releaseOutput(output, stream, session);
}
diff --git a/services/audiopolicy/service/AudioPolicyService.cpp b/services/audiopolicy/service/AudioPolicyService.cpp
index eead3ac..12cca65 100644
--- a/services/audiopolicy/service/AudioPolicyService.cpp
+++ b/services/audiopolicy/service/AudioPolicyService.cpp
@@ -116,7 +116,7 @@ void AudioPolicyService::onFirstRef()
#endif
}
// load audio processing modules
- sp<AudioPolicyEffects>audioPolicyEffects = new AudioPolicyEffects(this);
+ sp<AudioPolicyEffects>audioPolicyEffects = new AudioPolicyEffects();
{
Mutex::Autolock _l(mLock);
mAudioPolicyEffects = audioPolicyEffects;
@@ -177,23 +177,6 @@ void AudioPolicyService::setAudioPortCallbacksEnabled(bool enabled)
mNotificationClients.valueFor(uid)->setAudioPortCallbacksEnabled(enabled);
}
-status_t AudioPolicyService::setEffectSessionCallbacksEnabled(bool enabled)
-{
- Mutex::Autolock _l(mNotificationClientsLock);
-
- uid_t uid = IPCThreadState::self()->getCallingUid();
- if (mNotificationClients.indexOfKey(uid) < 0) {
- return NO_INIT;
- }
- if (!modifyAudioRoutingAllowed()) {
- ALOGE("setEffectSessionCallbacksEnabled requires MODIFY_AUDIO_ROUTING");
- return PERMISSION_DENIED;
- }
- mNotificationClients.valueFor(uid)->setEffectSessionCallbacksEnabled(enabled);
- return OK;
-}
-
-
// removeNotificationClient() is called when the client process dies.
void AudioPolicyService::removeNotificationClient(uid_t uid)
{
@@ -271,37 +254,11 @@ status_t AudioPolicyService::clientSetAudioPortConfig(const struct audio_port_co
return mAudioCommandThread->setAudioPortConfigCommand(config, delayMs);
}
-void AudioPolicyService::onOutputSessionEffectsUpdate(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added)
-{
- ALOGV("AudioPolicyService::onOutputSessionEffectsUpdate(%d, %d, %d)",
- stream, sessionId, added);
- mOutputCommandThread->effectSessionUpdateCommand(stream, sessionId,
- flags, channelMask, uid, added);
-}
-
-void AudioPolicyService::doOnOutputSessionEffectsUpdate(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added)
-{
- Mutex::Autolock _l(mNotificationClientsLock);
- for (size_t i = 0; i < mNotificationClients.size(); i++) {
- mNotificationClients.valueAt(i)->onOutputSessionEffectsUpdate(stream, sessionId,
- flags, channelMask, uid, added);
- }
-}
-
AudioPolicyService::NotificationClient::NotificationClient(const sp<AudioPolicyService>& service,
const sp<IAudioPolicyServiceClient>& client,
uid_t uid)
: mService(service), mUid(uid), mAudioPolicyServiceClient(client),
- mAudioPortCallbacksEnabled(false),
- mEffectSessionCallbacksEnabled(false)
+ mAudioPortCallbacksEnabled(false)
{
}
@@ -332,17 +289,6 @@ void AudioPolicyService::NotificationClient::onAudioPatchListUpdate()
}
}
-void AudioPolicyService::NotificationClient::onOutputSessionEffectsUpdate(
- audio_stream_type_t stream, audio_session_t sessionId,
- audio_output_flags_t flags, audio_channel_mask_t channelMask,
- uid_t uid, bool added)
-{
- if (mAudioPolicyServiceClient != 0 && mEffectSessionCallbacksEnabled) {
- mAudioPolicyServiceClient->onOutputSessionEffectsUpdate(stream, sessionId,
- flags, channelMask, uid, added);
- }
-}
-
void AudioPolicyService::NotificationClient::onDynamicPolicyMixStateUpdate(
String8 regId, int32_t state)
{
@@ -356,10 +302,6 @@ void AudioPolicyService::NotificationClient::setAudioPortCallbacksEnabled(bool e
mAudioPortCallbacksEnabled = enabled;
}
-void AudioPolicyService::NotificationClient::setEffectSessionCallbacksEnabled(bool enabled)
-{
- mEffectSessionCallbacksEnabled = enabled;
-}
void AudioPolicyService::binderDied(const wp<IBinder>& who) {
ALOGW("binderDied() %p, calling pid %d", who.unsafe_get(),
@@ -637,21 +579,6 @@ bool AudioPolicyService::AudioCommandThread::threadLoop()
svc->doOnDynamicPolicyMixStateUpdate(data->mRegId, data->mState);
mLock.lock();
} break;
- case EFFECT_SESSION_UPDATE: {
- EffectSessionUpdateData *data =
- (EffectSessionUpdateData *)command->mParam.get();
- ALOGV("AudioCommandThread() processing effect session update %d %d %d",
- data->mStream, data->mSessionId, data->mAdded);
- svc = mService.promote();
- if (svc == 0) {
- break;
- }
- mLock.unlock();
- svc->doOnOutputSessionEffectsUpdate(data->mStream, data->mSessionId,
- data->mFlags, data->mChannelMask, data->mUid, data->mAdded);
- mLock.lock();
- } break;
-
default:
ALOGW("AudioCommandThread() unknown command %d", command->mCommand);
}
@@ -924,26 +851,6 @@ void AudioPolicyService::AudioCommandThread::dynamicPolicyMixStateUpdateCommand(
sendCommand(command);
}
-void AudioPolicyService::AudioCommandThread::effectSessionUpdateCommand(
- audio_stream_type_t stream, audio_session_t sessionId,
- audio_output_flags_t flags, audio_channel_mask_t channelMask,
- uid_t uid, bool added)
-{
- sp<AudioCommand> command = new AudioCommand();
- command->mCommand = EFFECT_SESSION_UPDATE;
- EffectSessionUpdateData *data = new EffectSessionUpdateData();
- data->mStream = stream;
- data->mSessionId = sessionId;
- data->mFlags = flags;
- data->mChannelMask = channelMask;
- data->mUid = uid;
- data->mAdded = added;
- command->mParam = data;
- ALOGV("AudioCommandThread() sending effect session update (id=%d) for stream %d (added=%d)",
- stream, sessionId, added);
- sendCommand(command);
-}
-
status_t AudioPolicyService::AudioCommandThread::sendCommand(sp<AudioCommand>& command, int delayMs)
{
{
diff --git a/services/audiopolicy/service/AudioPolicyService.h b/services/audiopolicy/service/AudioPolicyService.h
index bc2875d..d11294b 100644
--- a/services/audiopolicy/service/AudioPolicyService.h
+++ b/services/audiopolicy/service/AudioPolicyService.h
@@ -202,8 +202,6 @@ public:
audio_io_handle_t *handle);
virtual status_t stopAudioSource(audio_io_handle_t handle);
- virtual status_t setEffectSessionCallbacksEnabled(bool enabled);
-
status_t doStartOutput(audio_io_handle_t output,
audio_stream_type_t stream,
audio_session_t session);
@@ -231,17 +229,6 @@ public:
void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state);
void doOnDynamicPolicyMixStateUpdate(String8 regId, int32_t state);
- void onOutputSessionEffectsUpdate(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added);
- void doOnOutputSessionEffectsUpdate(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added);
-
private:
AudioPolicyService() ANDROID_API;
virtual ~AudioPolicyService();
@@ -273,8 +260,7 @@ private:
UPDATE_AUDIOPORT_LIST,
UPDATE_AUDIOPATCH_LIST,
SET_AUDIOPORT_CONFIG,
- DYN_POLICY_MIX_STATE_UPDATE,
- EFFECT_SESSION_UPDATE,
+ DYN_POLICY_MIX_STATE_UPDATE
};
AudioCommandThread (String8 name, const wp<AudioPolicyService>& service);
@@ -317,11 +303,6 @@ private:
int delayMs);
void dynamicPolicyMixStateUpdateCommand(String8 regId, int32_t state);
void insertCommand_l(AudioCommand *command, int delayMs = 0);
- void effectSessionUpdateCommand(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added);
private:
class AudioCommandData;
@@ -418,16 +399,6 @@ private:
int32_t mState;
};
- class EffectSessionUpdateData : public AudioCommandData {
- public:
- audio_stream_type_t mStream;
- audio_session_t mSessionId;
- audio_output_flags_t mFlags;
- audio_channel_mask_t mChannelMask;
- uid_t mUid;
- bool mAdded;
- };
-
Mutex mLock;
Condition mWaitWorkCV;
Vector < sp<AudioCommand> > mAudioCommands; // list of pending commands
@@ -537,12 +508,6 @@ private:
virtual audio_unique_id_t newAudioUniqueId();
- virtual void onOutputSessionEffectsUpdate(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added);
-
private:
AudioPolicyService *mAudioPolicyService;
};
@@ -559,12 +524,7 @@ private:
void onAudioPatchListUpdate();
void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state);
void setAudioPortCallbacksEnabled(bool enabled);
- void setEffectSessionCallbacksEnabled(bool enabled);
- void onOutputSessionEffectsUpdate(audio_stream_type_t stream,
- audio_session_t sessionId,
- audio_output_flags_t flags,
- audio_channel_mask_t channelMask,
- uid_t uid, bool added);
+
// IBinder::DeathRecipient
virtual void binderDied(const wp<IBinder>& who);
@@ -576,7 +536,6 @@ private:
const uid_t mUid;
const sp<IAudioPolicyServiceClient> mAudioPolicyServiceClient;
bool mAudioPortCallbacksEnabled;
- bool mEffectSessionCallbacksEnabled;
};
// Internal dump utilities.