From f10d591462bdcc68ff58e18cb8f5eba82a45064d Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 3 Jan 2023 10:06:46 +0100 Subject: [PATCH] Samsung DeX should only be checked on Samsung devices Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com> --- .../main/java/org/schabi/newpipe/util/DeviceUtils.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 46ab6da51..4b08cfcb5 100644 --- a/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java +++ b/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java @@ -1,5 +1,7 @@ package org.schabi.newpipe.util; +import static android.content.Context.INPUT_SERVICE; + import android.annotation.SuppressLint; import android.app.UiModeManager; import android.content.Context; @@ -27,11 +29,10 @@ import org.schabi.newpipe.R; import java.lang.reflect.Method; -import static android.content.Context.INPUT_SERVICE; - public final class DeviceUtils { private static final String AMAZON_FEATURE_FIRE_TV = "amazon.hardware.fire_tv"; + private static final boolean SAMSUNG = Build.MANUFACTURER.equals("samsung"); private static Boolean isTV = null; private static Boolean isFireTV = null; @@ -120,6 +121,10 @@ public final class DeviceUtils { return true; } + if (!SAMSUNG) { + return false; + // DeX is Samsung-specific, skip the checks below on non-Samsung devices + } // DeX check for standalone and multi-window mode, from: // https://developer.samsung.com/samsung-dex/modify-optimizing.html try {