From 2af9f05f0df51beaae813a40d34bfd254fd25fba Mon Sep 17 00:00:00 2001 From: Nicholas Lim Date: Mon, 6 Jun 2022 21:23:40 +0800 Subject: [PATCH] SuW: Disable BluetoothSetupActivity component with prop * Checks if config.disable_bluetooth=true is set * Some leanback devices do not have bluetooth chips Change-Id: Id4d3445e24d9888e186b69a959dbaf54fc9bf31e --- src/org/lineageos/setupwizard/util/SetupWizardUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java index 4f112812..48369844 100644 --- a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java +++ b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java @@ -227,6 +227,10 @@ public class SetupWizardUtils { disableComponentSets(context, GET_RECEIVERS | GET_SERVICES); } + public static boolean isBluetoothDisabled() { + return SystemProperties.getBoolean("config.disable_bluetooth", false); + } + public static boolean isEthernetConnected(Context context) { ConnectivityManager cm = (ConnectivityManager) context. getSystemService(Context.CONNECTIVITY_SERVICE); @@ -279,7 +283,7 @@ public class SetupWizardUtils { } public static void disableComponentsForMissingFeatures(Context context) { - if (!hasLeanback(context)) { + if (!hasLeanback(context) || isBluetoothDisabled()) { disableComponent(context, BluetoothSetupActivity.class); } if (!hasBiometric(context)) {