diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-07 20:15:52 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-06-07 20:15:52 +0000 |
commit | 2d7e5ebb359f001db45e9f92a1e86219d66d19a3 (patch) | |
tree | 46a6d340c53d08a5ce6a98e852357936044ea561 | |
parent | bf265f58f33e8ed889a77c392187b971e8db239e (diff) | |
parent | 0dacaf5f20450839b65e88eba97b0173d5e7718d (diff) | |
download | wilhelm-2d7e5ebb359f001db45e9f92a1e86219d66d19a3.tar.gz |
Merge cherrypicks of [14883195] into sc-release am: 0dacaf5f20
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/wilhelm/+/14883196
Change-Id: I320d7981f298e045382d6066185d8e7d329d163e
-rw-r--r-- | src/Android.bp | 1 | ||||
-rw-r--r-- | src/android/AudioRecorder_to_android.cpp | 8 | ||||
-rw-r--r-- | src/android/android_Effect.cpp | 18 |
3 files changed, 24 insertions, 3 deletions
diff --git a/src/Android.bp b/src/Android.bp index 9b22260..827b4a4 100644 --- a/src/Android.bp +++ b/src/Android.bp @@ -233,6 +233,7 @@ cc_library_shared { "libmedia", "libmedia_codeclist", "libaudioclient", + "libaudioclient_aidl_conversion", "libaudiofoundation", "libaudiomanager", "libbinder", diff --git a/src/android/AudioRecorder_to_android.cpp b/src/android/AudioRecorder_to_android.cpp index 3d4ad75..411beff 100644 --- a/src/android/AudioRecorder_to_android.cpp +++ b/src/android/AudioRecorder_to_android.cpp @@ -689,13 +689,19 @@ SLresult android_audioRecorder_realize(CAudioRecorder* ar, SLboolean async) { SL_LOGV("SLES channel mask %#x converted to Android mask %#x", df_pcm->channelMask, channelMask); + // TODO b/182392769: use attribution source util + AttributionSourceState attributionSource; + attributionSource.uid = VALUE_OR_FATAL(android::legacy2aidl_uid_t_int32_t(getuid())); + attributionSource.pid = VALUE_OR_FATAL(android::legacy2aidl_pid_t_int32_t(getpid())); + attributionSource.token = android::sp<android::BBinder>::make(); + // initialize platform-specific CAudioRecorder fields ar->mAudioRecord = new android::AudioRecord( ar->mRecordSource, // source sampleRate, // sample rate in Hertz sles_to_android_sampleFormat(df_pcm), // format channelMask, // channel mask - AttributionSourceState(), // client attribution source (will be filled in later) + attributionSource, 0, // frameCount audioRecorder_callback,// callback_t (void*)ar, // user, callback data, here the AudioRecorder diff --git a/src/android/android_Effect.cpp b/src/android/android_Effect.cpp index a152f4a..2b5582f 100644 --- a/src/android/android_Effect.cpp +++ b/src/android/android_Effect.cpp @@ -667,7 +667,14 @@ bool android_fx_initEffectObj(audio_session_t sessionId, android::sp<android::Au const effect_uuid_t *type) { //SL_LOGV("android_fx_initEffectObj on session %d", sessionId); - effect = new android::AudioEffect(AttributionSourceState()); + // TODO b/182392769: use attribution source util + AttributionSourceState attributionSource; + attributionSource.uid = VALUE_OR_FATAL(android::legacy2aidl_uid_t_int32_t(getuid())); + attributionSource.pid = VALUE_OR_FATAL(android::legacy2aidl_pid_t_int32_t(getpid())); + attributionSource.token = android::sp<android::BBinder>::make(); + + effect = android::sp<android::AudioEffect>::make(attributionSource); + effect->set(type, EFFECT_UUID_NULL, 0,// priority 0,// effect callback @@ -808,7 +815,14 @@ SLresult android_genericFx_createEffect(IAndroidEffect* iae, SLInterfaceID pUuid } // create new effect - android::sp<android::AudioEffect> pFx = new android::AudioEffect(AttributionSourceState()); + // TODO b/182392769: use attribution source util + AttributionSourceState attributionSource; + attributionSource.uid = VALUE_OR_FATAL(android::legacy2aidl_uid_t_int32_t(getuid())); + attributionSource.pid = VALUE_OR_FATAL(android::legacy2aidl_pid_t_int32_t(getpid())); + attributionSource.token = android::sp<android::BBinder>::make(); + + const auto pFx = android::sp<android::AudioEffect>::make(attributionSource); + pFx->set(NULL, // not using type to create effect (const effect_uuid_t*)pUuid, 0,// priority |