From c38f1505620170545799d0f55db84e99e6896090 Mon Sep 17 00:00:00 2001 From: cybersphinx Date: Sat, 16 Jul 2022 20:56:24 +0200 Subject: [PATCH] Remove now obsolete API check. --- .../org/schabi/newpipe/util/DeviceUtils.java | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java b/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java index 36ba33633..d96721b0d 100644 --- a/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java +++ b/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java @@ -100,20 +100,18 @@ public final class DeviceUtils { */ public static boolean isDesktopMode(final Context context) { // Adapted from https://stackoverflow.com/a/64615568 - // to check for all devices that have an active cursor - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - final InputManager im = (InputManager) context.getSystemService(INPUT_SERVICE); - for (final int id : im.getInputDeviceIds()) { - final InputDevice inputDevice = im.getInputDevice(id); - if ( - inputDevice.supportsSource(InputDevice.SOURCE_BLUETOOTH_STYLUS) - || inputDevice.supportsSource(InputDevice.SOURCE_MOUSE) - || inputDevice.supportsSource(InputDevice.SOURCE_STYLUS) - || inputDevice.supportsSource(InputDevice.SOURCE_TOUCHPAD) - || inputDevice.supportsSource(InputDevice.SOURCE_TRACKBALL) - ) { - return true; - } + // to check for all input devices that have an active cursor + final InputManager im = (InputManager) context.getSystemService(INPUT_SERVICE); + for (final int id : im.getInputDeviceIds()) { + final InputDevice inputDevice = im.getInputDevice(id); + if ( + inputDevice.supportsSource(InputDevice.SOURCE_BLUETOOTH_STYLUS) + || inputDevice.supportsSource(InputDevice.SOURCE_MOUSE) + || inputDevice.supportsSource(InputDevice.SOURCE_STYLUS) + || inputDevice.supportsSource(InputDevice.SOURCE_TOUCHPAD) + || inputDevice.supportsSource(InputDevice.SOURCE_TRACKBALL) + ) { + return true; } }