title: Allow display over other apps - greyed out
body: <p>I've searched high and low for a solution to this but keep failing and I don't know why! I'm trying to create the start of an application for displaying notifications in Android Kiosk Mode (because the AndroidManagement API turns off the status bar and notifications when in kiosk, and I work with Care Homes who need call bell alerts to display).</p>
  
  <p>I'm falling at the hurdle of getting access to Allow Display Over Other Apps. My permissions check code is;</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      boolean settingsCanDraw = Settings.canDrawOverlays(MainActivity.this);
      if (!settingsCanDraw)
      {
          Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
          intent.setData(Uri.parse("package:" + getPackageName()));
          this.startActivityForResult(intent, 5469);
      } ....... blah
  </code></pre>
  
  <p>with an onActivityResult of;</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      switch (requestCode) {
          case 5469: {
              Toast.makeText(this,"Permission Granted!",Toast.LENGTH_SHORT).show();
              return;
          }
      }
  }
  </code></pre>
  
  <p>and my manifest file has the following (I've tried a mixture of the permissions by removing some and leaving them all but with identical results);</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  package="com.example.pcsnotificationbridge" &gt;
  
  &lt;uses-permission android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION" /&gt;
  &lt;uses-permission android:name="android.permission.TYPE_APPLICATION_OVERLAY"/&gt;
  &lt;uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW "/&gt;
  &lt;uses-permission android:name="android.permission.FOREGROUND_SERVICE" /&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"
      tools:ignore="GoogleAppIndexingWarning"
      android:fullBackupContent="true"&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;service android:name="com.example.pcsnotificationbridge.NLService"
          android:label="@string/app_name"
          android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.service.notification.NotificationListenerService" /&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
  
  
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>and whenever I run the application, I get the following option greyed out - can someone please help :)</p>
  
  <p><a href="https://i.stack.imgur.com/IslbM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IslbM.png" alt="The Result"></a></p>