Android Context Check hasNotificationPermission(Context context)

Here you can find the source of hasNotificationPermission(Context context)

Description

has Notification Permission

Declaration

public static final boolean hasNotificationPermission(Context context) 

Method Source Code

//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;
        }
    }
}

Related

  1. hasAsymmericMasterSecret(Context context)
  2. hasConnection(Context c)
  3. hasInternetConnection(Context context)
  4. hasInternetConnectivity(Context applicationContext)
  5. hasOtherSPAppsInstalled(Context context)
  6. hasTelephony(@Nonnull Context context)
  7. hasVibrationPermission(Context context)
  8. is3G(Context context)