Permission.Write.Settings only granted to system apps – needed to change screen brightness – will code also work on Google Play?

huangapple 未分类评论44阅读模式
英文:

Permission.Write.Settings only granted to system apps - needed to change screen brightness - will code also work on Google Play?

问题

我的应用程序需要调整手机的屏幕亮度。为此,我需要以下权限:

<uses-permission android:name="android.permission.WRITE_SETTINGS" />

当我在Android Studio悬停在该权限上时,会显示以下错误:

只有系统应用程序被授予权限

但是:当我将代码上传到我的手机时,代码仍然有效。有人可以解释一下为什么吗?此外,我还需要知道,如果用户从Google Play下载应用程序,此代码是否也会起作用。

是否有其他不同的方法来更改屏幕亮度?

英文:

My app has to adjust the screen brightness of the phone. To do so, I needed the following permission:

&lt;uses-permission android:name=&quot;android.permission.WRITE_SETTINGS&quot; /&gt;

Android Studio shows the following error, when I hover over the permission:

    Permission is only granted to system apps

But: the code still works when I upload it to my phone. Can somebody explain me why? Furthermore, I'd need to know, if this code will also work, if the user downloads the app from Google Play.

Is there a different approach to change the screen brightness?

huangapple
  • 本文由 发表于 2020年4月6日 23:41:15
  • 转载请务必保留本文链接:https://java.coder-hub.com/61063544.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定