Android的需要哪些权限调用PowerManager.goToSleep(N)把设备处于睡眠模式?睡眠、权限、模式、设备

2023-09-12 03:43:55 作者:小新没了蜡笔

已设置android.permissions.DEVICE_POWER在我的应用程序的清单。不过抱怨,无论是用户还是程序有此权限时,我打电话PowerManager.gotoSleep(n)的范围内活动。还有什么其他的设置都需要这个工作?由于这是对我的三星ATT手机

Already set android.permissions.DEVICE_POWER in manifest of my app. Still complains that neither user nor process have this permission when I call PowerManager.gotoSleep(n) within activity. What other settings are required for this to work? Thanks This is on My Samsung ATT phone

推荐答案

DEVICE_POWER是2级权限和保护权限,因此它不会提供给任何应用程序,它通过明显的提出要求,顺利拿到这个权限,我们需要有在我们的生成文件平台证书,并共享用户ID清单中设置为系统...

DEVICE_POWER is a level 2 permission and protected permission and hence it is not provided to any app which request it via manifest, to get this permission successfully we need to have Platform certificate in our make file and shared user id set in manifest as system...

LOCAL_CERTIFICATE := platform (makefile entry)

android.uid.system (shared  user id )

心不是解决的办法我环顾四周,还没有发现任何...

There isnt a way around this i have looked around havent found any ...