title: Android Studio keeps showing Missing Permission, even though i am handling it explicitly. How do I fix it?
body: <p>While using Google Map API every time I add relate to location like here below, Android Studio keep showing error :</p>
  <pre><code>private fun enableMyLocationOnMap() {
          googleMap.setPadding(0, ViewUtils.dpToPx(48f), 0, 0)
          googleMap.isMyLocationEnabled = true //&lt;----ERROR
  }
  </code></pre>
  <p>Error: Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with checkPermission) or explicitly handle a potential SecurityException</p>
  <p>I am handling permission explicitly:</p>
  <pre><code>    override fun onStart() {
          super.onStart()
          when {
              PermissionUtils.isAccessFineLocationGranted(this) -&gt; {
                  when {
                      PermissionUtils.isLocationEnable(this) -&gt; {
                          setUpLocationListener()
                      }
                      else -&gt; {
                          PermissionUtils.showGPSNotEnableDialog(this)
                      }
                  }
              }
              else -&gt; {
                  PermissionUtils.requestAccessFineLocation(
                      this
                      , LOCATION_PERMISSION_REQUEST_CODE
                  )
              }
          }
      }
  
      override fun onRequestPermissionsResult(
          requestCode: Int,
          permissions: Array&lt;out String&gt;,
          grantResults: IntArray
      ) {
          super.onRequestPermissionsResult(requestCode, permissions, grantResults)
          when (requestCode) {
              LOCATION_PERMISSION_REQUEST_CODE -&gt; {
                  if (grantResults.isNotEmpty() &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                      when {
                          PermissionUtils.isLocationEnable(this) -&gt; {
                              setUpLocationListener()
                          }
                          else -&gt; {
                              PermissionUtils.showGPSNotEnableDialog(this)
                          }
                      }
                  } else {
                      Toast.makeText(this, &quot;Location Permission not granted&quot;, Toast.LENGTH_LONG)
                          .show()
                  }
              }
          }
      }
  </code></pre>
  <p>where PermissionUtils.kt :</p>
  <pre><code>object PermissionUtils {
      fun requestAccessFineLocation(activity: AppCompatActivity, requestId: Int) {
          ActivityCompat.requestPermissions(
              activity,
              arrayOf(Manifest.permission.ACCESS_FINE_LOCATION),
              requestId
          )
  
      }
  
      fun isAccessFineLocationGranted(context: Context): Boolean {
          return ContextCompat.checkSelfPermission(
              context,
              Manifest.permission.ACCESS_FINE_LOCATION
          ) == PackageManager.PERMISSION_GRANTED
      }
  
      fun isLocationEnable(context: Context): Boolean {
          val locationManager: LocationManager = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager
          return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)
                  || locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)
      }
  
      fun showGPSNotEnableDialog(context: Context) {
          AlertDialog.Builder(context)
              .setTitle(context.getString(R.string.enable_gps))
              .setMessage(context.getString(R.string.required_for_this_app))
              .setCancelable(false)
              .setPositiveButton(context.getString(R.string.enable_now)) { _, _ -&gt;
                  context.startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS))
              }
              .show()
      }
  }
  </code></pre>
  <p>AndroidManifest.xml have :</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
  
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot;/&gt;
  </code></pre>