Loading media/libaudioclient/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -454,6 +454,7 @@ aidl_interface { "aidl/android/media/IAudioTrack.aidl", "aidl/android/media/IAudioTrackCallback.aidl", "aidl/android/media/ISoundDose.aidl", "aidl/android/media/ISoundDoseCallback.aidl", "aidl/android/media/SoundDoseRecord.aidl", ], Loading Loading @@ -553,6 +554,7 @@ aidl_interface { unstable: true, local_include_dir: "aidl", srcs: [ "aidl/android/media/ISoundDose.aidl", "aidl/android/media/ISoundDoseCallback.aidl", "aidl/android/media/SoundDoseRecord.aidl", ], Loading media/libaudioclient/AudioSystem.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -2375,13 +2375,18 @@ status_t AudioSystem::canBeSpatialized(const audio_attributes_t *attr, return OK; } status_t AudioSystem::registerSoundDoseCallback(const sp<media::ISoundDoseCallback>& callback) { status_t AudioSystem::getSoundDoseInterface(const sp<media::ISoundDoseCallback>& callback, sp<media::ISoundDose>* soundDose) { const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == nullptr) { return PERMISSION_DENIED; } if (soundDose == nullptr) { return BAD_VALUE; } return af->registerSoundDoseCallback(callback); RETURN_STATUS_IF_ERROR(af->getSoundDoseInterface(callback, soundDose)); return OK; } status_t AudioSystem::getDirectPlaybackSupport(const audio_attributes_t *attr, Loading media/libaudioclient/IAudioFlinger.cpp +8 −6 Original line number Diff line number Diff line Loading @@ -850,9 +850,10 @@ status_t AudioFlingerClientAdapter::getSupportedLatencyModes( return NO_ERROR; } status_t AudioFlingerClientAdapter::registerSoundDoseCallback( const sp<media::ISoundDoseCallback> &callback) { return statusTFromBinderStatus(mDelegate->registerSoundDoseCallback(callback)); status_t AudioFlingerClientAdapter::getSoundDoseInterface( const sp<media::ISoundDoseCallback> &callback, sp<media::ISoundDose>* soundDose) { return statusTFromBinderStatus(mDelegate->getSoundDoseInterface(callback, soundDose)); } //////////////////////////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -1375,10 +1376,11 @@ Status AudioFlingerServerAdapter::getSupportedLatencyModes( return Status::ok(); } Status AudioFlingerServerAdapter::registerSoundDoseCallback( const sp<media::ISoundDoseCallback>& callback) Status AudioFlingerServerAdapter::getSoundDoseInterface( const sp<media::ISoundDoseCallback>& callback, sp<media::ISoundDose>* soundDose) { return Status::fromStatusT(mDelegate->registerSoundDoseCallback(callback)); return Status::fromStatusT(mDelegate->getSoundDoseInterface(callback, soundDose)); } } // namespace android media/libaudioclient/aidl/android/media/IAudioFlingerService.aidl +6 −2 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.media.EffectDescriptor; import android.media.IAudioFlingerClient; import android.media.IAudioRecord; import android.media.IAudioTrack; import android.media.ISoundDose; import android.media.ISoundDoseCallback; import android.media.LatencyMode; import android.media.MicrophoneInfoData; Loading Loading @@ -247,8 +248,11 @@ interface IAudioFlingerService { */ LatencyMode[] getSupportedLatencyModes(int output); /** Registers the sound dose callback. */ oneway void registerSoundDoseCallback(ISoundDoseCallback callback); /** * Registers the sound dose callback and returns the interface for executing * sound dose methods on the audio server. */ ISoundDose getSoundDoseInterface(in ISoundDoseCallback callback); // When adding a new method, please review and update // IAudioFlinger.h AudioFlingerServerAdapter::Delegate::TransactionCode Loading media/libaudioclient/aidl/android/media/ISoundDose.aidl 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.media; import android.media.SoundDoseRecord; /** * Interface used to push the sound dose related information from the * AudioService#SoundDoseHelper to the audio server */ oneway interface ISoundDose { /** Set a new RS2 value used for momentary exposure warnings. */ void setOutputRs2(float rs2Value); /** * Resets the native CSD values. This can happen after a crash in the * audio server or after booting when restoring the previous state. * 'currentCsd' represents the restored CSD value and 'records' contains the * dosage values and MELs together with their timestamps that lead to this * CSD. */ void resetCsd(float currentCsd, in SoundDoseRecord[] records); } Loading
media/libaudioclient/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -454,6 +454,7 @@ aidl_interface { "aidl/android/media/IAudioTrack.aidl", "aidl/android/media/IAudioTrackCallback.aidl", "aidl/android/media/ISoundDose.aidl", "aidl/android/media/ISoundDoseCallback.aidl", "aidl/android/media/SoundDoseRecord.aidl", ], Loading Loading @@ -553,6 +554,7 @@ aidl_interface { unstable: true, local_include_dir: "aidl", srcs: [ "aidl/android/media/ISoundDose.aidl", "aidl/android/media/ISoundDoseCallback.aidl", "aidl/android/media/SoundDoseRecord.aidl", ], Loading
media/libaudioclient/AudioSystem.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -2375,13 +2375,18 @@ status_t AudioSystem::canBeSpatialized(const audio_attributes_t *attr, return OK; } status_t AudioSystem::registerSoundDoseCallback(const sp<media::ISoundDoseCallback>& callback) { status_t AudioSystem::getSoundDoseInterface(const sp<media::ISoundDoseCallback>& callback, sp<media::ISoundDose>* soundDose) { const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == nullptr) { return PERMISSION_DENIED; } if (soundDose == nullptr) { return BAD_VALUE; } return af->registerSoundDoseCallback(callback); RETURN_STATUS_IF_ERROR(af->getSoundDoseInterface(callback, soundDose)); return OK; } status_t AudioSystem::getDirectPlaybackSupport(const audio_attributes_t *attr, Loading
media/libaudioclient/IAudioFlinger.cpp +8 −6 Original line number Diff line number Diff line Loading @@ -850,9 +850,10 @@ status_t AudioFlingerClientAdapter::getSupportedLatencyModes( return NO_ERROR; } status_t AudioFlingerClientAdapter::registerSoundDoseCallback( const sp<media::ISoundDoseCallback> &callback) { return statusTFromBinderStatus(mDelegate->registerSoundDoseCallback(callback)); status_t AudioFlingerClientAdapter::getSoundDoseInterface( const sp<media::ISoundDoseCallback> &callback, sp<media::ISoundDose>* soundDose) { return statusTFromBinderStatus(mDelegate->getSoundDoseInterface(callback, soundDose)); } //////////////////////////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -1375,10 +1376,11 @@ Status AudioFlingerServerAdapter::getSupportedLatencyModes( return Status::ok(); } Status AudioFlingerServerAdapter::registerSoundDoseCallback( const sp<media::ISoundDoseCallback>& callback) Status AudioFlingerServerAdapter::getSoundDoseInterface( const sp<media::ISoundDoseCallback>& callback, sp<media::ISoundDose>* soundDose) { return Status::fromStatusT(mDelegate->registerSoundDoseCallback(callback)); return Status::fromStatusT(mDelegate->getSoundDoseInterface(callback, soundDose)); } } // namespace android
media/libaudioclient/aidl/android/media/IAudioFlingerService.aidl +6 −2 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.media.EffectDescriptor; import android.media.IAudioFlingerClient; import android.media.IAudioRecord; import android.media.IAudioTrack; import android.media.ISoundDose; import android.media.ISoundDoseCallback; import android.media.LatencyMode; import android.media.MicrophoneInfoData; Loading Loading @@ -247,8 +248,11 @@ interface IAudioFlingerService { */ LatencyMode[] getSupportedLatencyModes(int output); /** Registers the sound dose callback. */ oneway void registerSoundDoseCallback(ISoundDoseCallback callback); /** * Registers the sound dose callback and returns the interface for executing * sound dose methods on the audio server. */ ISoundDose getSoundDoseInterface(in ISoundDoseCallback callback); // When adding a new method, please review and update // IAudioFlinger.h AudioFlingerServerAdapter::Delegate::TransactionCode Loading
media/libaudioclient/aidl/android/media/ISoundDose.aidl 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.media; import android.media.SoundDoseRecord; /** * Interface used to push the sound dose related information from the * AudioService#SoundDoseHelper to the audio server */ oneway interface ISoundDose { /** Set a new RS2 value used for momentary exposure warnings. */ void setOutputRs2(float rs2Value); /** * Resets the native CSD values. This can happen after a crash in the * audio server or after booting when restoring the previous state. * 'currentCsd' represents the restored CSD value and 'records' contains the * dosage values and MELs together with their timestamps that lead to this * CSD. */ void resetCsd(float currentCsd, in SoundDoseRecord[] records); }