From 98b1b3b70da0fddcae02b96f9c20aacec9c1e5d1 Mon Sep 17 00:00:00 2001 From: althafvly Date: Tue, 10 Jan 2023 12:53:07 +0530 Subject: [PATCH] Updater: Check dev options toggle for test channel Change-Id: Ifecac146e3f637fa589241e513a269f3306764ed --- src/org/lineageos/updater/misc/Utils.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java index 7758b8ab..903714a4 100644 --- a/src/org/lineageos/updater/misc/Utils.java +++ b/src/org/lineageos/updater/misc/Utils.java @@ -218,7 +218,7 @@ public class Utils { String serverUrl = ""; if (retrieveStatus(context) != null) { - if (retrieveStatus(context).equals("true")) { + if (retrieveStatus(context).equals("true") && isDevModeOn(context)) { serverUrl = context.getString(R.string.ota_staging_server_url); return serverUrl.replace("{device}", device) .replace("{type}", type) @@ -477,9 +477,8 @@ public class Utils { } public static boolean isDevModeOn(Context context) { - int devOptions = Settings.Secure.getInt(context.getContentResolver(), - Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0); - return devOptions == 1; + return Settings.Secure.getInt(context.getContentResolver(), + Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0) == 1; } public static boolean hasTouchscreen(Context context) { -- GitLab