diff options
author | Vaibhav Raut <quic_vraut@quicinc.com> | 2024-02-01 15:01:54 +0530 |
---|---|---|
committer | Vaibhav Raut <quic_vraut@quicinc.com> | 2024-02-19 11:20:49 +0000 |
commit | 6c9bb0c07d59085d69e0f5afd9e7337d73d174ae (patch) | |
tree | 036959f8f794cfdd1452e8f5930299b4e48532aa | |
parent | fc01e4cfa66dfa3054ba2897e30788fb8e1baadc (diff) |
Revert "Based on property enforce haptic intensity to None"
This reverts commit c575511abc32eaf716d8dfc730c5b136755f89a6.
CRs-Fixed: 3721570
Change-Id: I210c3910687a35c5e4d71a8e28c6682bd5743435
-rw-r--r-- | services/audioflinger/Threads.cpp | 13 | ||||
-rw-r--r-- | services/audiopolicy/managerdefault/AudioPolicyManager.cpp | 32 |
2 files changed, 8 insertions, 37 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 427dc7faae..c3f2ee748d 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -2713,7 +2713,6 @@ void AudioFlinger::PlaybackThread::setVolumeForOutput_l(float left, float right) status_t AudioFlinger::PlaybackThread::addTrack_l(const sp<Track>& track) { status_t status = ALREADY_EXISTS; - int intensity; if (mActiveTracks.indexOf(track) < 0) { // the track is newly added, make sure it fills up all its @@ -2765,12 +2764,8 @@ status_t AudioFlinger::PlaybackThread::addTrack_l(const sp<Track>& track) // Unlock due to VibratorService will lock for this call and will // call Tracks.mute/unmute which also require thread's lock. mLock.unlock(); - if (property_get_bool("vendor.audio.gaming.enabled", false /* default_value */)) { - intensity = static_cast<int>(os::HapticScale::NONE); - } else { - intensity = AudioFlinger::onExternalVibrationStart( - track->getExternalVibration()); - } + const int intensity = AudioFlinger::onExternalVibrationStart( + track->getExternalVibration()); std::optional<media::AudioVibratorInfo> vibratorInfo; { // TODO(b/184194780): Use the vibrator information from the vibrator that will be @@ -7349,10 +7344,6 @@ void AudioFlinger::DuplicatingThread::addOutputTrack(MixerThread *thread) attributionSource.pid = VALUE_OR_FATAL(legacy2aidl_pid_t_int32_t( IPCThreadState::self()->getCallingPid())); attributionSource.token = sp<BBinder>::make(); - - if (property_get_bool("vendor.audio.gaming.enabled", false /* default_value */)) - mChannelMask = (audio_channel_mask_t)(mChannelMask | mHapticChannelMask); - sp<OutputTrack> outputTrack = new OutputTrack(thread, this, mSampleRate, diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index eaa21b5c20..d44de119b2 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp @@ -5870,16 +5870,8 @@ uint32_t AudioPolicyManager::nextAudioPortGeneration() } static status_t deserializeAudioPolicyXmlConfig(AudioPolicyConfig &config) { - - std::string audioPolicyXmlConfigFile; - - if (property_get_bool("vendor.audio.gaming.enabled", false /* default_value */)) { - audioPolicyXmlConfigFile = "/vendor/etc/audio/audio_policy_configuration_gaming.xml"; - } else { - audioPolicyXmlConfigFile = audio_get_audio_policy_config_file(); - } - - if (!audioPolicyXmlConfigFile.empty()) { + if (std::string audioPolicyXmlConfigFile = audio_get_audio_policy_config_file(); + !audioPolicyXmlConfigFile.empty()) { status_t ret = deserializeAudioPolicyFile(audioPolicyXmlConfigFile.c_str(), &config); if (ret == NO_ERROR) { config.setSource(audioPolicyXmlConfigFile); @@ -8229,10 +8221,9 @@ sp<SwAudioOutputDescriptor> AudioPolicyManager::openOutputWithProfileAndDevice( profile->pickAudioProfile( config.sample_rate, config.channel_mask, config.format); config.offload_info.sample_rate = config.sample_rate; - config.offload_info.format = config.format; - if (property_get_bool("vendor.audio.gaming.enabled", false /* default_value */)) - config.channel_mask = AUDIO_CHANNEL_OUT_STEREO_HAPTIC_AB; config.offload_info.channel_mask = config.channel_mask; + config.offload_info.format = config.format; + status = desc->open(&config, mixerConfig, devices, AUDIO_STREAM_DEFAULT, AUDIO_OUTPUT_FLAG_NONE, &output); if (status != NO_ERROR) { @@ -8263,21 +8254,10 @@ sp<SwAudioOutputDescriptor> AudioPolicyManager::openOutputWithProfileAndDevice( //TODO: configure audio effect output stage here - // open a duplicating output thread for the new output and the haptic/primary output + // open a duplicating output thread for the new output and the primary output sp<SwAudioOutputDescriptor> dupOutputDesc = new SwAudioOutputDescriptor(nullptr, mpClientInterface); - if (property_get_bool("vendor.audio.gaming.enabled", false /* default_value */)) { - sp<SwAudioOutputDescriptor> hapticDesc = nullptr; - for (size_t i = 0; i < mOutputs.size(); i++) { - hapticDesc = mOutputs.valueAt(i); - if (hapticDesc->getChannelMask() & AUDIO_CHANNEL_HAPTIC_ALL) - break; - } - if (hapticDesc != nullptr) - status = dupOutputDesc->openDuplicating(hapticDesc, desc, &duplicatedOutput); - } else { - status = dupOutputDesc->openDuplicating(mPrimaryOutput, desc, &duplicatedOutput); - } + status = dupOutputDesc->openDuplicating(mPrimaryOutput, desc, &duplicatedOutput); if (status == NO_ERROR) { // add duplicated output descriptor addOutput(duplicatedOutput, dupOutputDesc); |