1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 00:20:32 +00:00

Fix DeX mode check

This commit is contained in:
Hanif Shersy 2022-05-02 12:23:29 +10:00 committed by AudricV
parent ff774a1870
commit cfda073aa5
No known key found for this signature in database
GPG Key ID: DA92EC7905614198

View File

@ -120,10 +120,10 @@ public final class DeviceUtils {
final Method getEnabledMethod = desktopModeStateClass
.getDeclaredMethod("getEnabled");
final int enabled = (int) getEnabledMethod.invoke(desktopModeState);
final boolean isEnabled = enabled == desktopModeStateClass
.getDeclaredField("ENABLED").getInt(desktopModeStateClass);
isDeXMode = isEnabled;
if (enabled == desktopModeStateClass
.getDeclaredField("ENABLED").getInt(desktopModeStateClass)) {
isDeXMode = true;
}
} catch (NoSuchFieldException | NoSuchMethodException
| IllegalAccessException | InvocationTargetException e) {
// Device does not support DeX 3.0