Remove unnecessary code now that minSdk is 21.

This commit is contained in:
Greyson Parrelli
2023-01-17 11:52:26 -05:00
committed by Cody Henthorne
parent 8cfd02aff2
commit 3e7dc79fe8
68 changed files with 123 additions and 443 deletions

View File

@@ -169,10 +169,8 @@ public abstract class AudioManagerCompat {
public static AudioManagerCompat create(@NonNull Context context) {
if (Build.VERSION.SDK_INT >= 26) {
return new Api26AudioManagerCompat(context);
} else if (Build.VERSION.SDK_INT >= 21) {
return new Api21AudioManagerCompat(context);
} else {
return new Api19AudioManagerCompat(context);
return new Api21AudioManagerCompat(context);
}
}
@@ -242,7 +240,6 @@ public abstract class AudioManagerCompat {
}
}
@RequiresApi(21)
private static class Api21AudioManagerCompat extends Api19AudioManagerCompat {
private static AudioAttributes AUDIO_ATTRIBUTES = new AudioAttributes.Builder()

View File

@@ -158,7 +158,7 @@ class FullSignalAudioManager(context: Context, eventListener: EventListener?) :
updateAudioDeviceState()
wiredHeadsetReceiver = WiredHeadsetReceiver()
context.registerReceiver(wiredHeadsetReceiver, IntentFilter(if (Build.VERSION.SDK_INT >= 21) AudioManager.ACTION_HEADSET_PLUG else Intent.ACTION_HEADSET_PLUG))
context.registerReceiver(wiredHeadsetReceiver, IntentFilter(AudioManager.ACTION_HEADSET_PLUG))
state = State.PREINITIALIZED