Remove now obsolete API check.
This commit is contained in:
parent
d2b6bda7a2
commit
c38f150562
|
@ -100,8 +100,7 @@ public final class DeviceUtils {
|
||||||
*/
|
*/
|
||||||
public static boolean isDesktopMode(final Context context) {
|
public static boolean isDesktopMode(final Context context) {
|
||||||
// Adapted from https://stackoverflow.com/a/64615568
|
// Adapted from https://stackoverflow.com/a/64615568
|
||||||
// to check for all devices that have an active cursor
|
// to check for all input devices that have an active cursor
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
final InputManager im = (InputManager) context.getSystemService(INPUT_SERVICE);
|
final InputManager im = (InputManager) context.getSystemService(INPUT_SERVICE);
|
||||||
for (final int id : im.getInputDeviceIds()) {
|
for (final int id : im.getInputDeviceIds()) {
|
||||||
final InputDevice inputDevice = im.getInputDevice(id);
|
final InputDevice inputDevice = im.getInputDevice(id);
|
||||||
|
@ -115,7 +114,6 @@ public final class DeviceUtils {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (ContextCompat.getSystemService(context, UiModeManager.class)
|
if (ContextCompat.getSystemService(context, UiModeManager.class)
|
||||||
.getCurrentModeType() == Configuration.UI_MODE_TYPE_DESK) {
|
.getCurrentModeType() == Configuration.UI_MODE_TYPE_DESK) {
|
||||||
|
|
Loading…
Reference in New Issue