/android/packages/apps/Settings/src/com/android/settings/bluetooth/BluetoothPairingDetail.java:
public void onBluetoothStateChanged(int bluetoothState) {
updateContent(bluetoothState);
}
void updateContent(int bluetoothState) {
case BluetoothAdapter.STATE_ON:
addDeviceCategory(mAvailableDevicesCategory,R.string.bluetooth_preference_found_media_devices,BluetoothDeviceFilter.ALL_FILTER, mInitialScanStarted);//添加可用设备类目
updateFooterPreference(mFooterPreference);
enableScanning();
}
void enableScanning() {
super.enableScanning();
}
由于BluetoothPairingDetail extends DeviceListPreferenceFragment,所以
/android/packages/apps/Settings/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java:
void enableScanning() {
startScanning();
}
void startScanning() {
if (!mBluetoothAdapter.isDiscovering()) {