使用adb更改打盹模式设置

问题描述 投票:0回答:2

根据我从Doze Editor app源代码中学到的知识,可以使用adb更改打盹设置。

我的问题是,我一次只能更改一个设置吗?

例如:

adb shell settings put global device_idle_constants KEY_INACTIVE_TIMEOUT=720000

或者我应该用逗号分隔所有的值对?

例如:

adb shell settings put global device_idle_constants KEY_INACTIVE_TIMEOUT=720000, KEY_SENSING_TIMEOUT=xxxx, KEY_LOCATING_TIMEOUT=yyyy ... and so on
android android-6.0-marshmallow
2个回答
1
投票

我一次只能更改一个设置吗?

是的,您无法一次更改多个设置。

命令adb shell settings一次只支持一个键/值,如命令帮助中所示:

adb shell settings
usage:  settings [--user NUM] get namespace key
        settings [--user NUM] put namespace key value
        settings [--user NUM] delete namespace key

'namespace' is one of {system, secure, global}, case-insensitive
If '--user NUM' is not given, the operations are performed on the owner user.

1
投票

根据Android SDK中的官方评论,您需要将所有值对放在键“device_idle_constants”下,例如:“inactive_timeout = 60000,sensing_timeout = 400000”

© www.soinside.com 2019 - 2024. All rights reserved.