打開和關閉藍牙BT
adb root
adb shell svc bluetooth enable
adb shell svc bluetooth disable
UI層
查詢:adb shell settings get global bluetooth_on
查詢:adb shell settings get global bluetooth_on
獲取mac地址:
1. adb shell settings get secure bluetooth_address
2. service call bluetooth_manager 13
其中: bluetooth_manager: [android.bluetooth.IBluetoothManager] 是Bluetooth相關services提供給上層的接口
13 是IBluetoothManager接口中的第13個方法:String getAddress();(注:該值不同平台可能不一樣,最終根據IBluetoothManager.aidl確定。 在/system/bt/binder/android/bluetooth/ 或 /frameworks/base/core/java/android/bluetooth/下)