Thanox icon indicating copy to clipboard operation
Thanox copied to clipboard

disableBT无法关闭蓝牙

Open Matthew-Harris-36 opened this issue 1 year ago • 2 comments
trafficstars

我尝试了不少情景模式规则,发现通过hw.disableBT命令无法关闭蓝牙,而hw.enableBT正常.

情景模式如下,打开变量bt里的应用,蓝牙可以正常开启,但关闭应用,却不能关闭蓝牙.

[
    {
        "name": "蓝牙开关",
        "description": "变量bt应用关闭则关闭蓝牙,反之打开蓝牙",
        "priority": 1,
        "condition": "int n = 0 ;if(taskRemoved){foreach(app : globalVarOf$bt){if(app.equals(pkgName)){n++ ;}}if(n > 0){hw.disableBT() ;}}/*==============================================*/if(activityResumed){n = 0 ;foreach(app : globalVarOf$bt){if(app.equals(pkgName)){n++ ;}}if(n>0){hw.enableBT() ;}}/*==============================================*/if(btStateOff){ui.showShortToast(\"蓝牙关闭\") ;}else if(btStateOn){ui.showShortToast(\"蓝牙打开\") ;}",
        "actions": [
        ""
        ]
    }
]

希望能正常关闭蓝牙

  • OS: Realme Neo3 UI3.0 A23 安卓12
  • Version 5.0.0-prc LSP模块

server_logging.zip

演示视频:https://www.bilibili.com/video/BV1RN4y1Y7Rg/

Matthew-Harris-36 avatar Dec 02 '23 06:12 Matthew-Harris-36

看起来:关闭蓝牙的toast没有弹出,说明你的情景模式写的有问题,导致没执行关闭的操作

Tornaco avatar Dec 10 '23 01:12 Tornaco

看起来:关闭蓝牙的toast没有弹出,说明你的情景模式写的有问题,导致没执行关闭的操作

我曾升级了手机系统,在高版本的系统中是可以正常关闭蓝牙的,其它都没变动。

Matthew-Harris-36 avatar Dec 10 '23 04:12 Matthew-Harris-36