From 6a00b38d8326e48b0e7be6313c819df2ff6c770f Mon Sep 17 00:00:00 2001 From: Adithya R Date: Mon, 10 Jun 2024 19:31:44 +0530 Subject: [PATCH] dolby: Revert "Re-enable speaker virtualization after bootup" No longer necessary Change-Id: Iac820eafa71ea3e4ccaad2bfa0fb76c37279a22a --- .../src/co/aospa/dolby/xiaomi/DolbyUtils.java | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/dolby/src/co/aospa/dolby/xiaomi/DolbyUtils.java b/dolby/src/co/aospa/dolby/xiaomi/DolbyUtils.java index 6e2aecd..b4dd6c0 100644 --- a/dolby/src/co/aospa/dolby/xiaomi/DolbyUtils.java +++ b/dolby/src/co/aospa/dolby/xiaomi/DolbyUtils.java @@ -8,8 +8,6 @@ package co.aospa.dolby.xiaomi; import android.content.Context; import android.content.SharedPreferences; -import android.media.AudioAttributes; -import android.media.AudioDeviceAttributes; import android.media.AudioDeviceCallback; import android.media.AudioDeviceInfo; import android.media.AudioManager; @@ -32,10 +30,6 @@ public final class DolbyUtils { private static final int EFFECT_PRIORITY = 100; private static final int VOLUME_LEVELER_AMOUNT = 2; - private static final AudioAttributes ATTRIBUTES_MEDIA = new AudioAttributes.Builder() - .setUsage(AudioAttributes.USAGE_MEDIA) - .build(); - private static DolbyUtils mInstance; private DolbyAtmos mDolbyAtmos; private Context mContext; @@ -91,19 +85,6 @@ public final class DolbyUtils { registerCallbacks(dsOn); if (dsOn) setCurrentProfile(); - - // Restore speaker virtualizer, because for some reason it isn't - // enabled automatically at boot. - final AudioDeviceAttributes device = - mAudioManager.getDevicesForAttributes(ATTRIBUTES_MEDIA).get(0); - final boolean isOnSpeaker = (device.getType() == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER); - final boolean spkVirtEnabled = getSpeakerVirtualizerEnabled(); - dlog("isOnSpeaker=" + isOnSpeaker + " spkVirtEnabled=" + spkVirtEnabled); - if (isOnSpeaker && spkVirtEnabled) { - setSpeakerVirtualizerEnabled(false); - setSpeakerVirtualizerEnabled(true); - Log.i(TAG, "re-enabled speaker virtualizer"); - } } private void checkEffect() {