Pro 设置 > 应用程序控制电源状态
Estimated reading time: 1 minute
应用程序控制电源状态
功能
允许由 Android 应用程序通过 Broadcast intent 执行电源控制功能。
介绍(中文字幕)
范围
-
选择“应用程序控制电源状”。
-
通知出现。选择“确定”继续。
-
设置启用。
功能细节
允许不受信任的应用程序通过特定的目的执行以下功能。
- 重新启动
- 关闭电源(屏幕关闭)
- 打开电源(屏幕打开)
如何使用
- 重新启动
- 操作: “com.sony.dtv.b2b.intent.action.REBOOT”
- 示例代码
Intent intent = new Intent("com.sony.dtv.b2b.intent.action.REBOOT"); sendBroadcast(intent);
- 关机(屏幕关闭)
- 操作: “com.sony.dtv.b2b.intent.action.POWER_OFF”
- 示例代码
Intent intent = new Intent("com.sony.dtv.b2b.intent.action.POWER_OFF"); sendBroadcast(intent);
- 开机
- 操作: “com.sony.dtv.b2b.intent.action.POWER_ON”
- 示例代码
Intent intent = new Intent("com.sony.dtv.b2b.intent.action.POWER_ON"); sendBroadcast(intent);
Last modified: 26 Feb 2021