Suppress Lint for wrong constant of AudioManager.GET_DEVICES_ALL

Up to now AudioManager.GET_DEVICES_ALL is a valid value. Because of that
the suppress annotation were added.

See: https://developer.android.com/reference/android/media/AudioManager#getDevices(int)

Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
Tim Krüger 2021-09-15 14:58:12 +02:00
parent 0f54b6a505
commit 99f5a64c50
No known key found for this signature in database
GPG Key ID: FECE3A7222C52A4E

View File

@ -31,6 +31,7 @@
package com.nextcloud.talk.webrtc;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@ -464,7 +465,7 @@ public class MagicAudioManager {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return audioManager.isWiredHeadsetOn();
} else {
final AudioDeviceInfo[] devices = audioManager.getDevices(AudioManager.GET_DEVICES_ALL);
@SuppressLint("WrongConstant") final AudioDeviceInfo[] devices = audioManager.getDevices(AudioManager.GET_DEVICES_ALL);
for (AudioDeviceInfo device : devices) {
final int type = device.getType();
if (type == AudioDeviceInfo.TYPE_WIRED_HEADSET) {