diff options
author | Eric Laurent <elaurent@google.com> | 2015-06-26 09:39:24 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-06-26 12:38:13 -0700 |
commit | e8726fea8a53bf3474aa3c6deaf2f6c1f565e694 (patch) | |
tree | d72b6ffcc7e33c178e3cac7c108b102041451cb6 /media/libmedia/IAudioPolicyService.cpp | |
parent | ed8505836c0b2fba0ab4be0c1eff31d4f241bc1d (diff) | |
download | frameworks_av-e8726fea8a53bf3474aa3c6deaf2f6c1f565e694.zip frameworks_av-e8726fea8a53bf3474aa3c6deaf2f6c1f565e694.tar.gz frameworks_av-e8726fea8a53bf3474aa3c6deaf2f6c1f565e694.tar.bz2 |
reduce number of binder calls from mediaserver
Reduce the number of audio port, audio patch and
IO config changed binder calls from mediaserver to
client processes:
- Do not call IO config changed callback if selected
device is the same as previously selected one on a given
audio flinger playback or capture thread.
- Do not call the audio port or audo patch list update
callback on a client if this client as no listener registered.
Bug: 22045560.
Change-Id: If780e105404de79b7cb5c80c27b793ceb6b1c423
Diffstat (limited to 'media/libmedia/IAudioPolicyService.cpp')
-rw-r--r-- | media/libmedia/IAudioPolicyService.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/media/libmedia/IAudioPolicyService.cpp b/media/libmedia/IAudioPolicyService.cpp index fd18f17..3348441 100644 --- a/media/libmedia/IAudioPolicyService.cpp +++ b/media/libmedia/IAudioPolicyService.cpp @@ -72,7 +72,8 @@ enum { GET_PHONE_STATE, REGISTER_POLICY_MIXES, START_AUDIO_SOURCE, - STOP_AUDIO_SOURCE + STOP_AUDIO_SOURCE, + SET_AUDIO_PORT_CALLBACK_ENABLED, }; #define MAX_ITEMS_PER_LIST 1024 @@ -646,6 +647,14 @@ public: remote()->transact(REGISTER_CLIENT, data, &reply); } + virtual void setAudioPortCallbacksEnabled(bool enabled) + { + Parcel data, reply; + data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor()); + data.writeInt32(enabled ? 1 : 0); + remote()->transact(SET_AUDIO_PORT_CALLBACK_ENABLED, data, &reply); + } + virtual status_t acquireSoundTriggerSession(audio_session_t *session, audio_io_handle_t *ioHandle, audio_devices_t *device) @@ -1219,6 +1228,12 @@ status_t BnAudioPolicyService::onTransact( return NO_ERROR; } break; + case SET_AUDIO_PORT_CALLBACK_ENABLED: { + CHECK_INTERFACE(IAudioPolicyService, data, reply); + setAudioPortCallbacksEnabled(data.readInt32() == 1); + return NO_ERROR; + } break; + case ACQUIRE_SOUNDTRIGGER_SESSION: { CHECK_INTERFACE(IAudioPolicyService, data, reply); sp<IAudioPolicyServiceClient> client = interface_cast<IAudioPolicyServiceClient>( |