Disable bluetooth controller if unsupported

Only disable the controllers not the whole fragment because
user might need to have entry for other features.

Change-Id: I9c44cca97189a2115785cf70aee8eb580ac56000
Fixes: 73664409
Signed-off-by: Weilun Du <wdu@google.com>
This commit is contained in:
Weilun Du
2018-02-24 21:48:11 -08:00
parent 203b923cb4
commit 726f115660
7 changed files with 193 additions and 30 deletions

View File

@@ -23,6 +23,7 @@ import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.VisibleForTesting;
import android.util.Log;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
@@ -71,7 +72,10 @@ public class BluetoothPairingDetail extends DeviceListPreferenceFragment impleme
@Override
public void onStart() {
super.onStart();
if (mLocalManager == null){
Log.e(TAG, "Bluetooth is not supported on this device");
return;
}
updateBluetooth();
mAvailableDevicesCategory.setProgress(mLocalAdapter.isDiscovering());
}
@@ -89,7 +93,10 @@ public class BluetoothPairingDetail extends DeviceListPreferenceFragment impleme
@Override
public void onStop() {
super.onStop();
if (mLocalManager == null){
Log.e(TAG, "Bluetooth is not supported on this device");
return;
}
// Make the device only visible to connected devices.
mAlwaysDiscoverable.stop();
disableScanning();