dolby: Revert "Re-enable speaker virtualization after bootup"

No longer necessary

Change-Id: Iac820eafa71ea3e4ccaad2bfa0fb76c37279a22a
This commit is contained in:
Adithya R 2024-06-10 19:31:44 +05:30 committed by basamaryan
parent 975856cac5
commit 6a00b38d83
No known key found for this signature in database
GPG Key ID: 707BA6C82329E8F9

View File

@ -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() {