【发布时间】:2017-01-23 07:57:51
【问题描述】:
显然 MIUI OS 在 Marshmallow 之前已经实现了自己的权限系统。我目前正在测试小米 4i 的视频录制应用程序,它使用基于 API 21 [Android 5.0.2] 的 MIUI,它需要 MIUI 权限管理器默认未授予的录制音频权限。
到目前为止,我设法更改权限的方法是通过单击 AlertDialog 中的“确定”按钮访问应用程序的“权限管理器”窗口:
isMIUI = MIUIUtils.isMIUI();
if(isMIUI)
{
AlertDialog.Builder adb = new AlertDialog.Builder(this);
adb.setMessage("If you intend to use the video recording feature, please enable the 'Record Audio' permission in the settings menu. You will be redirected there if you press OK.")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
intent.setClassName("com.miui.securitycenter", "com.miui.permcenter.permissions.AppPermissionsEditorActivity");
intent.putExtra("extra_pkgname", "com.picmix.mobile");
startActivity(intent);
}
})
.setNegativeButton("CANCEL", null)
.create();
adb.show();
}
但这对我来说还不够好。我需要检查 Record Audio 权限是否已在 MIUI 权限管理器中检查,以便仅运行一次。
如何以编程方式在 MIUI 权限管理器中检查授予或通知的权限?
【问题讨论】:
标签: android permissions