Revert "Disable bluetooth controller if unsupported"
This reverts commit 726f115660
.
Reason for revert: broke git_master
https://android-build.googleplex.com/builds/submitted/4635329/sailfish-userdebug_fastbuild3_linux/latest/view/logs/build_error.log
Change-Id: Icefa78f0a79f7ff0af373f3f0cd35d200cd4fec8
This commit is contained in:
@@ -16,14 +16,12 @@
|
||||
|
||||
package com.android.settings.bluetooth;
|
||||
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
import android.support.v7.preference.Preference;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
@@ -32,7 +30,7 @@ import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||
/**
|
||||
* Controller that shows received files
|
||||
*/
|
||||
public class BluetoothFilesPreferenceController extends BasePreferenceController
|
||||
public class BluetoothFilesPreferenceController extends AbstractPreferenceController
|
||||
implements PreferenceControllerMixin {
|
||||
private static final String TAG = "BluetoothFilesPrefCtrl";
|
||||
|
||||
@@ -49,15 +47,13 @@ public class BluetoothFilesPreferenceController extends BasePreferenceController
|
||||
private MetricsFeatureProvider mMetricsFeatureProvider;
|
||||
|
||||
public BluetoothFilesPreferenceController(Context context) {
|
||||
super(context, KEY_RECEIVED_FILES);
|
||||
super(context);
|
||||
mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)
|
||||
? AVAILABLE
|
||||
: DISABLED_UNSUPPORTED;
|
||||
public boolean isAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -23,7 +23,6 @@ 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;
|
||||
@@ -72,10 +71,7 @@ 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());
|
||||
}
|
||||
@@ -93,10 +89,7 @@ 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();
|
||||
|
Reference in New Issue
Block a user