!411 OH设备蓝牙界面,点击对应的蓝牙耳机连接,当OH设备蓝牙耳机显示栏显示的状态正在连接时,OH设备关闭不了蓝牙,蓝牙界面界面点击开关按钮,界面无响应,有时还会出现界面闪退

Merge pull request !411 from sunwei06/master
This commit is contained in:
openharmony_ci 2023-04-10 03:09:03 +00:00 committed by Gitee
commit 12686f8f09
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -423,11 +423,15 @@ export class BluetoothModel extends BaseModel {
let result = [];
for (let i = 0;i < this.profiles.length; i++) {
if (this.profiles[i]) {
let state = this.profiles[i].getDeviceState(deviceId);
result.push({
profileId: i,
profileConnectionState: state
});
try {
let state = this.profiles[i].getDeviceState(deviceId);
result.push({
profileId: i,
profileConnectionState: state
});
} catch (BusinessError) {
LogUtil.error("Bluetooth getDeviceState failed , BusinessError is " + JSON.stringify(BusinessError))
}
}
}
return result;