1. 源码路径
SettingsLib:\frameworks\base\packages\SettingsLib
Settings:\packages\apps\Settings
bluetooth包:Android12时在 packages\modules\Bluetooth
\frameworks\base\core\java\android\bluetooth
2.类图
LocalBluetoothProfile:蓝牙协议接口,如子类A2dpProfile表示A2dp协议连接
LocalBluetoothProfileManager:管理支持的蓝牙协议,包括协议连接状态
BluetoothCallback:蓝牙开关状态、扫描状态、配对连接等回调接口
BluetoothEventManager:处理蓝牙相关广播事件,提供回调
CachedBluetoothDevice:包装BluetoothDevice,提供配对、连接、断开、取消配对等基础方法
CachedBluetoothDeviceManager:管理设备信息,有缓存处理
LocalBluetoothAdapter:包装BluetoothAdapter,已废弃,需注意其中setBluetoothStateInt()方法
BluetoothDeviceFilter/BluetoothDiscoverableTimeoutReceiver:设备过滤器和可见性广播接收者
LocalBluetoothManager:对外入口类
DeviceListPreferenceFragment:扫描设备列表界面
BluetoothDevicePreference:蓝牙设备条目,其中点击事件处理了断开、配对、连接
BluetoothEnabler:蓝牙开关
BluetoothDiscoverableEnabler:处理蓝牙可见性
BluetoothDeviceUpdater:蓝牙设备过滤更新器,其子类分别处理已保存的设备、已连接的设备等
BluetoothPairingRequest:配对框请求