我正在尝试制作一个 GPS 追踪器应用。
我无意在 Play 商店中分发此应用。因此,我完全控制了设备(并且可以手动加入白名单)。
我想知道是否:
- 如果充电器始终连接到 电话?
- 手机突然震动或振动会禁用打瞌睡模式 长时间不活动后?例如,考虑放置电话 在卡车内,振动会(从发动机启动或 旅行)足以使设备从休眠状态恢复正常 模式?
- Job Scheduler 服务是否会按计划在打瞌睡模式下工作 手动将应用列入白名单(包括 GPS 和网络)?
- 打瞌睡模式设备的电话是否会将其状态更改为正常模式?
- 陀螺仪、加速度计等传感器能否在休眠模式下工作?
最佳答案
问题一:
Would doze mode be activated if charger is always connected to phone?
没有。
As soon as the user wakes the device by moving it, turning on the screen, or connecting a charger, the system exits Doze and all apps return to normal activity.
问题2:
Would sudden jerk or vibration to phone disables doze mode after a prolonged inactivity? For example,consider phone placed inside a truck and would that vibration (from engine start or travelling) be sufficient to get the device from doze to normal mode?
在 Android N 之前,是的。从 Android N 开始,没有。
Android 7.0 brings further enhancements to Doze by applying a subset of CPU and network restrictions while the device is unplugged with the screen turned off, but not necessarily stationary, for example, when a handset is traveling in a user’s pocket.
问题三
Will job scheduler service work in doze mode with scheduled app manually whitelisted (including GPS and network)?
没有。
An app that is whitelisted can use the network and hold partial wake locks during Doze and App Standby. However, other restrictions still apply to the whitelisted app, just as they do to other apps. For example, the whitelisted app’s jobs and syncs are deferred (on API level 23 and below), and its regular AlarmManager alarms do not fire.
问题 4
Would phone call to doze mode device changes its state to normal mode?
是的。由于与问题 1 相同的原因。
问题 5
Would sensors like gyro, accelerometer work in doze mode?
在 Doze 模式下可能无法工作
有关 Doze 模式优化的更多详细信息,您可以引用此 document .
关于android - 处于打瞌睡模式的白名单 Android 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50198931/