summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-06-09 01:07:14 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-06-09 01:07:14 +0000
commit312d87d64cc1b8250954dd62cd86aa5daabf85fa (patch)
tree46a6d340c53d08a5ce6a98e852357936044ea561
parented3c9770c55ddf04c5887c2ae00a60e1fa69b8c3 (diff)
parent4ea879d3a536cf67e6077e9f8c6586781580ca09 (diff)
downloadwilhelm-android12L-d2-s3-release.tar.gz
Change-Id: I3338a2e62fb4208104a05b2a8e9b847a3c88854c
-rw-r--r--src/Android.bp1
-rw-r--r--src/android/AudioRecorder_to_android.cpp8
-rw-r--r--src/android/android_Effect.cpp18
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