Skip to content

Commit cfda073

Browse files
han-szAudricV
authored andcommitted
Fix DeX mode check
1 parent ff774a1 commit cfda073

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ public static boolean isDesktopMode(final Context context) {
120120
final Method getEnabledMethod = desktopModeStateClass
121121
.getDeclaredMethod("getEnabled");
122122
final int enabled = (int) getEnabledMethod.invoke(desktopModeState);
123-
final boolean isEnabled = enabled == desktopModeStateClass
124-
.getDeclaredField("ENABLED").getInt(desktopModeStateClass);
125-
126-
isDeXMode = isEnabled;
123+
if (enabled == desktopModeStateClass
124+
.getDeclaredField("ENABLED").getInt(desktopModeStateClass)) {
125+
isDeXMode = true;
126+
}
127127
} catch (NoSuchFieldException | NoSuchMethodException
128128
| IllegalAccessException | InvocationTargetException e) {
129129
// Device does not support DeX 3.0

0 commit comments

Comments
 (0)