gpt4 book ai didi

受管理配置文件中的 Android 请勿打扰 (DnD) 权限

转载 作者:太空狗 更新时间:2023-10-29 14:40:49 25 4
gpt4 key购买 nike

我有以下问题:

我的应用程序分布在 MDM 系统上,并在 Android for Work 中运行。在某些情况下,应用程序必须暂时终止 DnD 模式。为此,用户必须在应用启动时授予 DnD 权限。

到目前为止一切顺利。如果我在非托管区域安装该应用程序,该应用程序会显示在列表中并且可以毫无问题地授予权限。通过 MDM 系统分发应用程序后,该应用程序将不再出现在列表中,并且无法授予权限。所有权限都已在 MDM 系统中授予。例如,我通过 MDM 系统分发了 Google App。此应用出现在列表中。

Screenshot image

在 list 中我设置了以下权限:

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

应用程序启动时,将执行以下代码:

NotificationManager nm = (NotificationManager).getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M && !nm.isNotificationPolicyAccessGranted()) {
Intent intent = new
Intent(Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS);
startActivity(intent);
}

只有 DnD 权限才会出现此问题。所有其他权限(例如覆盖权限)都可以正常显示。

我希望有人能帮助我。

最佳答案

根据 Android documentation : 不可能

Users can grant and deny access to Do Not Disturb configuration from here. Managed profiles cannot grant Do Not Disturb access.

关于受管理配置文件中的 Android 请勿打扰 (DnD) 权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48567956/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com