title: Android, find all places in code to request permissions
body: <p>I am working on an application for pre-Marshmallow devices. The source code was not written by me and the project itself is quite big.
  I am currently making the app to request permissions when needed.</p>
  
  <p>The question is: How to find all places in code where permission should be requested?
  I am using Android Studio.</p>
  
  <p><strong>EDIT</strong><br>
  Some people suggest to change api to 23 and just run the app and see the places where it crashes.
  The problem is that the app does not crash in every place.</p>
  
  <p>For example, running this code without a permission will crash the app:</p>
  
  <pre><code>TelephonyManager manager = (TelephonyManager) context
              .getSystemService(Context.TELEPHONY_SERVICE);
  </code></pre>
  
  <p>While this one just returns an empty array, instead of crashing.</p>
  
  <pre><code>final String[] SELF_PROJECTION = new String[]{
      ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME,};
  Cursor cursor = context.getContentResolver()
      .query(ContactsContract.Profile.CONTENT_URI, SELF_PROJECTION, null, null, null);
  </code></pre>
  
  <p>Also, Android Lint does not show these places. I'm not sure if it should be.</p>