title: Runtime permission for SYSTEM_ALERT_WINDOW
body: <p>I need to get the user permissions automatically for the following permissions while user opens the app for the first time</p>
  
  <ol>
  <li>Phone</li>
  <li>Call logs</li>
  <li><strong>Always on top</strong></li>
  </ol>
  
  <p>Phone is working fine. How to get the always on top permission</p>
  
  <p>MainActivity</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.SYSTEM_ALERT_WINDOW)
              != PackageManager.PERMISSION_GRANTED) {
          ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.SYSTEM_ALERT_WINDOW}, 1);
      }
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  </code></pre>
  
  <p>Manifest</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.READ_CALL_LOG" /&gt;
  &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/&gt;
  &lt;uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /&gt;
  </code></pre>