diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java index 0ba3f46191e3b65393aca2081e7b9d7a282ebcad..65369fc6ccacbef3e631eb7b94c40d06a17aa1bc 100644 --- a/src/org/lineageos/updater/misc/Utils.java +++ b/src/org/lineageos/updater/misc/Utils.java @@ -31,6 +31,7 @@ import android.os.Environment; import android.os.StatFs; import android.os.SystemProperties; import android.os.storage.StorageManager; +import android.provider.Settings; import android.util.Log; import android.widget.Toast; @@ -210,7 +211,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) @@ -442,6 +443,11 @@ public class Utils { return isAB; } + public static boolean isDevModeOn(Context context) { + return Settings.Secure.getInt(context.getContentResolver(), + Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0) == 1; + } + public static boolean hasTouchscreen(Context context) { return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN); }