把该系统在Android上睡觉 [英] Putting the system to sleep on Android

查看:122
本文介绍了把该系统在Android上睡觉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了Android 1.6的应用程序和更新,其中包含用于切换手机睡觉的功能性。

我试图找到如何做到这一点的方式,我发现在 goToSleep 电源管理类的方法,但不幸的是这种方法的使用需要的 android.permission.DEVICE_POWER 的权限是只允许系统的系统级权限只应用程序。

有谁知道迫使手机进入睡眠模式或如何签署申请以获得上述许可,允许在 goToSleep 方式的使用的另一种方式吗?谢谢!


解决方案

  

我在开发Android 1.6及更高版本,其中包含用于切换一个功能的应用程序
  手机睡觉。


据我所知,这是不是由Android SDK中普通的应用程序的支持。


  

或如何注册的应用程序来获得上述许可,以允许goToSleep的使用
  方法?


这需要你编译并安装自己的固件。

I'm developing an application for Android 1.6 and newer which contains a functionality that switches the phone to sleep.

I tried to find a way of how to do that and I found the goToSleep method in the PowerManager class, but unfortunately the usage of that method requires android.permission.DEVICE_POWER permission which is a system level permission allowed only for system apps only.

Does anybody know an alternative way of forcing the phone to go into sleep mode or how to sign an application to gain the above mentioned permission and to allow the usage of the goToSleep method? Thank you!

解决方案

I'm developing an application for Android 1.6 and newer which contains a functionality that switches the phone to sleep.

AFAIK, that is not supported by the Android SDK for ordinary apps.

or how to sign an application to gain the above mentioned permission and to allow the usage of the goToSleep method?

That requires you to compile and install your own firmware.

这篇关于把该系统在Android上睡觉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆