Here you can find the source of hasNotificationPermission(Context context)
public static final boolean hasNotificationPermission(Context context)
//package com.java2s; import android.content.Context; import android.content.pm.PackageManager; public class Main { public static final String NOTIFICATION_PERMISSION = "org.c_base.c_beam.permission.NOTIFICATION"; public static final boolean hasNotificationPermission(Context context) { PackageManager manager = context.getPackageManager(); try {/*from w ww .ja va 2 s . c o m*/ return (manager.checkPermission(NOTIFICATION_PERMISSION, context.getPackageName()) == PackageManager.PERMISSION_GRANTED); } catch (Exception e) { return false; } } }