java.lang.SecurityException异常:要求在果冻豆4.2 VIBRATE许可 [英] java.lang.SecurityException: Requires VIBRATE permission on Jelly Bean 4.2

查看:157
本文介绍了java.lang.SecurityException异常:要求在果冻豆4.2 VIBRATE许可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从昨天开始我已经在Android 4.2的一个问题,当我收到推送通知它需要即使我不把它设置为振动许可

Since yesterday I have an issue on Android 4.2 when I receive push notifications it requires the permission even if i don't set it to vibrate

Notification notification = new Notification(icon, notificationItem.message, when);
notification.setLatestEventInfo(context, "App", notificationItem.message,
            PendingIntent.getActivity(context, 0, intent, 0));
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.defaults |= Notification.DEFAULT_SOUND;

NotificationManager nm =
            (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(notificationItem.notificationID, notification);

异常被上调nm.notify

the exception is raised by nm.notify

我有这个问题,在两个不同的应用程序,我从来没有修改code

I have this issue in two different apps and i never modify the code

推荐答案

这是安卓4.2的一个错误是由于在通知振动政策的改变;许可错误是固定由这种变化 4.2.1。

This was a bug in Android 4.2 due to a change in the notification vibration policy; the permission bug was fixed by this change in 4.2.1.

这篇关于java.lang.SecurityException异常:要求在果冻豆4.2 VIBRATE许可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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