Loading media/libaudioclient/AudioSystem.cpp +9 −16 Original line number Diff line number Diff line Loading @@ -132,12 +132,10 @@ const sp<IAudioFlinger> AudioSystem::get_audio_flinger() { binder = gAudioFlingerBinder; } else { sp<IServiceManager> sm = defaultServiceManager(); do { binder = sm->getService(String16(IAudioFlinger::DEFAULT_SERVICE_NAME)); if (binder != nullptr) break; ALOGW("AudioFlinger not published, waiting..."); usleep(500000); // 0.5 s } while (true); binder = sm->waitForService(String16(IAudioFlinger::DEFAULT_SERVICE_NAME)); if (binder == nullptr) { return nullptr; } } binder->linkToDeath(gAudioFlingerClient); const auto afs = interface_cast<media::IAudioFlingerService>(binder); Loading Loading @@ -864,14 +862,10 @@ const sp<IAudioPolicyService> AudioSystem::get_audio_policy_service() { Mutex::Autolock _l(gLockAPS); if (gAudioPolicyService == 0) { sp<IServiceManager> sm = defaultServiceManager(); sp<IBinder> binder; do { binder = sm->getService(String16("media.audio_policy")); if (binder != 0) break; ALOGW("AudioPolicyService not published, waiting..."); usleep(500000); // 0.5 s } while (true); sp<IBinder> binder = sm->waitForService(String16("media.audio_policy")); if (binder == nullptr) { return nullptr; } if (gAudioPolicyServiceClient == NULL) { gAudioPolicyServiceClient = new AudioPolicyServiceClient(); } Loading Loading @@ -2078,8 +2072,7 @@ status_t AudioSystem::getHwOffloadFormatsSupportedForBluetoothMedia( return BAD_VALUE; } const sp<IAudioPolicyService> & aps = AudioSystem::get_audio_policy_service(); const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service(); if (aps == 0) return PERMISSION_DENIED; std::vector<AudioFormatDescription> formatsAidl; Loading Loading
media/libaudioclient/AudioSystem.cpp +9 −16 Original line number Diff line number Diff line Loading @@ -132,12 +132,10 @@ const sp<IAudioFlinger> AudioSystem::get_audio_flinger() { binder = gAudioFlingerBinder; } else { sp<IServiceManager> sm = defaultServiceManager(); do { binder = sm->getService(String16(IAudioFlinger::DEFAULT_SERVICE_NAME)); if (binder != nullptr) break; ALOGW("AudioFlinger not published, waiting..."); usleep(500000); // 0.5 s } while (true); binder = sm->waitForService(String16(IAudioFlinger::DEFAULT_SERVICE_NAME)); if (binder == nullptr) { return nullptr; } } binder->linkToDeath(gAudioFlingerClient); const auto afs = interface_cast<media::IAudioFlingerService>(binder); Loading Loading @@ -864,14 +862,10 @@ const sp<IAudioPolicyService> AudioSystem::get_audio_policy_service() { Mutex::Autolock _l(gLockAPS); if (gAudioPolicyService == 0) { sp<IServiceManager> sm = defaultServiceManager(); sp<IBinder> binder; do { binder = sm->getService(String16("media.audio_policy")); if (binder != 0) break; ALOGW("AudioPolicyService not published, waiting..."); usleep(500000); // 0.5 s } while (true); sp<IBinder> binder = sm->waitForService(String16("media.audio_policy")); if (binder == nullptr) { return nullptr; } if (gAudioPolicyServiceClient == NULL) { gAudioPolicyServiceClient = new AudioPolicyServiceClient(); } Loading Loading @@ -2078,8 +2072,7 @@ status_t AudioSystem::getHwOffloadFormatsSupportedForBluetoothMedia( return BAD_VALUE; } const sp<IAudioPolicyService> & aps = AudioSystem::get_audio_policy_service(); const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service(); if (aps == 0) return PERMISSION_DENIED; std::vector<AudioFormatDescription> formatsAidl; Loading