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
This commit is contained in:
Nicholas Lim
2022-06-06 21:23:40 +08:00
parent c5d773b3b5
commit 2af9f05f0d

View File

@@ -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)) {