title: Permission error in BroadcastReceiver
body: <p>I gave the <code>READ_SMS</code> as well as <code>READ_CALL_LOG</code> permission in manifest file but still I am getting <code>SecurityException</code> in my <code>BroadcastReceiver</code>.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>@Override
  public void onReceive(Context context, Intent intent) {
      getMissedCallCount(context);
      getUnreadSMSCount(context);
  }
  
  private void getMissedCallCount(Context context) {
      if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_CALL_LOG) != PackageManager.PERMISSION_GRANTED) {
          Log.d("Call Logs permission", "Not provided...");
          return;
      }
      String[] projection = {CallLog.Calls.CACHED_NAME, CallLog.Calls.CACHED_NUMBER_LABEL, CallLog.Calls.TYPE};
      String where = CallLog.Calls.TYPE + "=" + CallLog.Calls.MISSED_TYPE;
      Cursor c = context.getContentResolver().query(CallLog.Calls.CONTENT_URI, projection, where, null, null);
      c.moveToFirst();
      Log.d("CALL COUNT: ", ""+c.getCount());
      c.close();
  }
  </code></pre>
  
  <p><strong>Log:</strong></p>
  
  <p><code>Call Logs permission: Not provided...</code></p>
  
  <p>Any idea about this problem?</p>