googlesamples / easypermissions

Simplify Android M system permissions
https://firebaseopensource.com/projects/googlesamples/easypermissions/
Apache License 2.0
9.86k stars 1.46k forks source link

EasyPermission Not working in HTC Device #283

Closed ravirajjak closed 5 years ago

ravirajjak commented 5 years ago

Basic Information

Device type: HTC OS version: Android 5.1 EasyPermissions version: 3.0.0

Describe the problem

Permission Dialog is not asked

What happened? What did you expect to happen? It should ask permission

  @AfterPermissionGranted(RC_LOCATION)
    private fun getLocationPermission() {
        val perms = arrayOf<String>(ACCESS_FINE_LOCATION, permission.ACCESS_COARSE_LOCATION)
        if (EasyPermissions.hasPermissions(this, *perms)) {
            // Already have permission, do the thing
            /*  setCreateLocationRequest()
              setGoogleApiClient()*/
            checkIfGpsIsOn()

        } else {
            // Do not have permissions, request them now
            EasyPermissions.requestPermissions(this, getString(R.string.lbl_location_permission),
                    RC_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION)
        }
    }

// TODO(you): show the code that produces the problem, // and any relevant logs.


Steps to reproduce
Install Google EasyPermission Sample Application on Htc device and observe no permission dialog will appear.
samtstern commented 5 years ago

@ravirajjak You're running on "OS version: Android 5.1". The permissions API did not exist until Android 6.0, so this library won't do anything on that device. Any permissions in your AndroidManifest.xml are automatically granted.