3

I am getting this error specifically on HTC DESIRE 626GPLUS DUAL SIM with Android 4.4.2

java.lang.SecurityException: Permission Denial: getIntentSender() from pid=1484, uid=10151, (need uid=1000) is not allowed to send as package android
       at android.os.Parcel.readException(Parcel.java:1472)
       at android.os.Parcel.readException(Parcel.java:1426)
       at android.app.INotificationManager$Stub$Proxy.cancelAllNotifications(INotificationManager.java:271)
       at android.app.NotificationManager.cancelAll(NotificationManager.java:220)
       at com.bakar.GcmIntentService.onHandleIntent(GcmIntentService.java:92)
       at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
       at android.os.Handler.dispatchMessage(Handler.java:110)
       at android.os.Looper.loop(Looper.java:193)
       at android.os.HandlerThread.run(HandlerThread.java:61)
animuson
  • 53,861
  • 28
  • 137
  • 147
Vipul Asri
  • 8,903
  • 3
  • 46
  • 71

2 Answers2

4

Try adding a try-catch to your code, like this :

NotificationManager nMgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
try {
    nMgr.cancelAll();
} catch (Exception e) {
    e.printStackTrace();
}

as cancelAll() may not be supported by the device model you mentioned.

Vipul Asri
  • 8,903
  • 3
  • 46
  • 71
0

You cant request userid 1000 as this is system userid

Maciej Boguta
  • 1,354
  • 1
  • 12
  • 15
  • i am not requesting uid 1000 still this exception is occurring. – Vipul Asri Aug 26 '15 at 15:31
  • I am getting this error in these lines. `NotificationManager nMgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); nMgr.cancelAll();` – Vipul Asri Aug 27 '15 at 12:49
  • as you can see exception also mentioned this error : `at android.app.NotificationManager.cancelAll(NotificationManager.java:220)` – Vipul Asri Aug 27 '15 at 12:56