!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 = []; let result = [];
for (let i = 0;i < this.profiles.length; i++) { for (let i = 0;i < this.profiles.length; i++) {
if (this.profiles[i]) { if (this.profiles[i]) {
let state = this.profiles[i].getDeviceState(deviceId); try {
result.push({ let state = this.profiles[i].getDeviceState(deviceId);
profileId: i, result.push({
profileConnectionState: state profileId: i,
}); profileConnectionState: state
});
} catch (BusinessError) {
LogUtil.error("Bluetooth getDeviceState failed , BusinessError is " + JSON.stringify(BusinessError))
}
} }
} }
return result; return result;