title: Settings.canDrawOverlays(context) returns false on Android Oreo
body: <p>Manifest:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" /&gt;
  &lt;uses-permission android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION" /&gt;
  </code></pre>
  
  <p>Code activity.onCreate():</p>
  
  <pre><code>if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M &amp;&amp; BuildConfig.DEBUG) {
          if (!Settings.canDrawOverlays(this)) {
              Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
                      Uri.parse("package:" + getPackageName()));
              startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE);
          }
      }
  </code></pre>
  
  <p><strong>Problem:</strong> Settings.canDrawOverlays(this) returns false even so the permission has been already granted. Hasn't happened before update Pixel to Oreo.</p>
  
  <p>Android version: 8.0.0</p>
  
  <p>I've tried to update build tools: to 26.0.1 and target and compileSdk to 26.
  It helped on the first launch :after toggling on it returns true, but next time I launch application it returns false again.</p>