debug: 启动时打印设备所有可用传感器列表

检查是否有陀螺仪/旋转向量等传感器可用于改进抬手检测。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-04-30 18:50:08 +09:30
parent f35bbfc1e9
commit 5f30611cc0

View File

@@ -78,6 +78,13 @@ class FiseAccelerometerWake @Inject constructor(
override fun start() {
if (started) return
// 列出设备所有可用传感器(调试用,正式发布删除)
val allSensors = sensorManager.getSensorList(Sensor.TYPE_ALL)
Timber.i("抬手亮屏: 设备传感器列表(共 %d 个):", allSensors.size)
for (s in allSensors) {
Timber.i(" - type=%d name=%s vendor=%s", s.type, s.name, s.vendor)
}
// 方案D优先尝试 TYPE_WRIST_TILT_GESTURE (type=26, API 20+)
val wristTilt = sensorManager.getDefaultSensor(26)
if (wristTilt != null) {