Skip to content

Commit c38f150

Browse files
cybersphinxAudricV
authored andcommitted
Remove now obsolete API check.
1 parent d2b6bda commit c38f150

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,18 @@ public static boolean isTv(final Context context) {
100100
*/
101101
public static boolean isDesktopMode(final Context context) {
102102
// Adapted from https://stackoverflow.com/a/64615568
103-
// to check for all devices that have an active cursor
104-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
105-
final InputManager im = (InputManager) context.getSystemService(INPUT_SERVICE);
106-
for (final int id : im.getInputDeviceIds()) {
107-
final InputDevice inputDevice = im.getInputDevice(id);
108-
if (
109-
inputDevice.supportsSource(InputDevice.SOURCE_BLUETOOTH_STYLUS)
110-
|| inputDevice.supportsSource(InputDevice.SOURCE_MOUSE)
111-
|| inputDevice.supportsSource(InputDevice.SOURCE_STYLUS)
112-
|| inputDevice.supportsSource(InputDevice.SOURCE_TOUCHPAD)
113-
|| inputDevice.supportsSource(InputDevice.SOURCE_TRACKBALL)
114-
) {
115-
return true;
116-
}
103+
// to check for all input devices that have an active cursor
104+
final InputManager im = (InputManager) context.getSystemService(INPUT_SERVICE);
105+
for (final int id : im.getInputDeviceIds()) {
106+
final InputDevice inputDevice = im.getInputDevice(id);
107+
if (
108+
inputDevice.supportsSource(InputDevice.SOURCE_BLUETOOTH_STYLUS)
109+
|| inputDevice.supportsSource(InputDevice.SOURCE_MOUSE)
110+
|| inputDevice.supportsSource(InputDevice.SOURCE_STYLUS)
111+
|| inputDevice.supportsSource(InputDevice.SOURCE_TOUCHPAD)
112+
|| inputDevice.supportsSource(InputDevice.SOURCE_TRACKBALL)
113+
) {
114+
return true;
117115
}
118116
}
119117

0 commit comments

Comments
 (0)