Browse Source

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>
Tim Krüger 3 years ago
parent
commit
99f5a64c50

+ 2 - 1
app/src/main/java/com/nextcloud/talk/webrtc/MagicAudioManager.java

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