Move isolatable bluetooth code to SettingsLib
Move the non-ui bluetooth control/tracking code to SettingsLib so that it can be shared with others. Mostly just move classes to frameworks/base/packages/SettingsLib, however a few things had to move around. - Dock handling had to move back to code still in settings - Local preference related code had to be moved back to settings - Added an error flow from SettingsLib to Settings Depends on I69fd888362c6dbb325f6113b32c4b15cc6a23a41 Bug: 19180466 Change-Id: Ie57fe26a27bbb0adc2ef69e042a05c7290c6a52a
This commit is contained in:
@@ -16,8 +16,12 @@
|
||||
|
||||
package com.android.settings.bluetooth;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceCategory;
|
||||
@@ -26,6 +30,11 @@ import android.preference.PreferenceScreen;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.settings.RestrictedSettingsFragment;
|
||||
import com.android.settingslib.bluetooth.BluetoothCallback;
|
||||
import com.android.settingslib.bluetooth.BluetoothDeviceFilter;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothAdapter;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.WeakHashMap;
|
||||
@@ -74,7 +83,7 @@ public abstract class DeviceListPreferenceFragment extends
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mLocalManager = LocalBluetoothManager.getInstance(getActivity());
|
||||
mLocalManager = Utils.getLocalBtManager(getActivity());
|
||||
if (mLocalManager == null) {
|
||||
Log.e(TAG, "Bluetooth is not supported on this device");
|
||||
return;
|
||||
@@ -164,7 +173,7 @@ public abstract class DeviceListPreferenceFragment extends
|
||||
if (mFilter.matches(cachedDevice.getDevice())) {
|
||||
createDevicePreference(cachedDevice);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void createDevicePreference(CachedBluetoothDevice cachedDevice) {
|
||||
if (mDeviceListGroup == null) {
|
||||
|
Reference in New Issue
Block a user