【发布时间】:2019-01-30 14:54:22
【问题描述】:
美好的一天。 我想知道现在蓝牙扫描是否不可用(被打盹模式锁定?)。
现在我用这种方法检查:
fun isInDozeMode(context: Context) : Boolean {
val powerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && powerManager.isDeviceIdleMode
}
但是即使我刚刚收到蓝牙(iBeacon)事件,这个方法也会返回true。
【问题讨论】:
标签: android bluetooth bluetooth-lowenergy altbeacon android-doze