Decouple HapticScale from ExternalVibratorService scale.
Use a conversion function rather than a static cast, and convert
to a properly typed HapticScale straight away, and all the way down to
where it's marshalled into the effect params.
Bug: 248993206
Test: presubmit, manual check scaling of audio-coupled ringtone
Change-Id: I588031ace0b3562cba50449b2147acaa6098af57
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 7c5afce..fcf19c9 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -320,7 +320,8 @@
sp<MmapStreamInterface>& interface,
audio_port_handle_t *handle);
- static int onExternalVibrationStart(const sp<os::ExternalVibration>& externalVibration);
+ static os::HapticScale onExternalVibrationStart(
+ const sp<os::ExternalVibration>& externalVibration);
static void onExternalVibrationStop(const sp<os::ExternalVibration>& externalVibration);
status_t addEffectToHal(audio_port_handle_t deviceId,