title: Unable to get permission: "android.permission.SET_ALARM"
body: <p>I've made an android application and  used AlarmManager and Broadcast Receiver to get local notifications. But my Receiver class is not at all being called. I backtraced the issue and found out that my app is not able to get 'SET_ALARM' permission. Please find screenshot below for the same. </p>
  
  <p><strong>Screenshot</strong>: </p>
  
  <p><a href="https://i.stack.imgur.com/53v3R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/53v3R.png" alt="enter image description here"></a></p>
  
  <p>So to crosscheck the permission issue, I've added the following code in MainActivity.java to check whether the app is able to get permissions or not. I found out that it is not able to get requested SET_ALARM permission. Please find the code below. </p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>package com.dileepmanuballa224.alarm_test;
  
  import android.Manifest;
  import android.app.AlarmManager;
  import android.content.pm.PackageManager;
  import android.os.Build;
  import android.support.annotation.RequiresApi;
  import android.support.v4.content.ContextCompat;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.util.Log;
  
  
  public class MainActivity extends AppCompatActivity {
  
      AlarmManager am;
      @RequiresApi(api = Build.VERSION_CODES.M)
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          if(ContextCompat.checkSelfPermission(this, Manifest.permission.SET_ALARM)!= PackageManager.PERMISSION_GRANTED){
              Log.d("Perm check:SET_ALARM", "Permission Denied");
              requestPermissions(new String[]{Manifest.permission.SET_ALARM},1);
          }else{
              Log.d("Perm check:SET_ALARM", "Permission Exists");
          }
  
          if(ContextCompat.checkSelfPermission(this, Manifest.permission.INTERNET)!= PackageManager.PERMISSION_GRANTED){
              Log.d("Perm check:INTERNET", "Permission Denied");
              requestPermissions(new String[]{Manifest.permission.SET_ALARM},1);
          }else{
              Log.d("Perm check:INTERNET", "Permission Exists");
          }
  
      }
      }
  </code></pre>
  
  <p><strong>Manifest file</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.dileepmanuballa224.alarm_test"&gt;
  &lt;uses-permission android:name="android.permission.SET_ALARM"/&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_launcher_round"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;receiver android:name=".AlarmReceiver"/&gt;
          &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>Log Results:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ZuNRI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZuNRI.png" alt="enter image description here"></a></p>
  
  <p>Could anyone please help me with this issue.</p>