Check bluetooth status when relevant
Change-Id: Ie67a28cb89bf68ef0d57f36ee2d875cfc44e29cc
diff --git a/src/org/lineageos/setupwizard/BluetoothSetupActivity.java b/src/org/lineageos/setupwizard/BluetoothSetupActivity.java
index 0856e3b..91ba556 100644
--- a/src/org/lineageos/setupwizard/BluetoothSetupActivity.java
+++ b/src/org/lineageos/setupwizard/BluetoothSetupActivity.java
@@ -7,6 +7,7 @@
package org.lineageos.setupwizard;
import static com.google.android.setupcompat.util.ResultCodes.RESULT_ACTIVITY_NOT_FOUND;
+import static com.google.android.setupcompat.util.ResultCodes.RESULT_SKIP;
import android.content.Intent;
import android.util.Log;
@@ -26,6 +27,10 @@
@Override
protected void onStartSubactivity() {
+ if (!SetupWizardUtils.hasLeanback(this) || SetupWizardUtils.isBluetoothDisabled()) {
+ finishAction(RESULT_SKIP);
+ return;
+ }
try {
Intent intent = new Intent(ACTION_CONNECT_INPUT);
intent.putExtra(INTENT_EXTRA_NO_INPUT_MODE, true);
diff --git a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
index e5c78ac..13c813b 100644
--- a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
+++ b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
@@ -51,7 +51,6 @@
import android.util.Log;
import org.lineageos.setupwizard.BaseSetupWizardActivity;
-import org.lineageos.setupwizard.BluetoothSetupActivity;
import org.lineageos.setupwizard.SetupWizardApp;
import java.io.File;
@@ -233,9 +232,7 @@
}
public static void disableComponentsForMissingFeatures(Context context) {
- if (!hasLeanback(context) || isBluetoothDisabled()) {
- disableComponent(context, BluetoothSetupActivity.class);
- }
+
}
/**