Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

507
Vistas
Android 12 BLUETOOTH_CONNECT permission is granted when denied

So I know Android 12 has new Bluetooth permissions. In the App Info Permissions it looks like its called Nearby Devices now. I have this logic:

        if (ContextCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) {
            viewModel.connectDevice(macAddressDropdown.selectedItem.toString())
        } else {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
                ActivityCompat.requestPermissions(
                    this,
                    arrayOf(Manifest.permission.BLUETOOTH_CONNECT),
                    1
                )
            }
        }
    }

On initial launch, this seems to work fine, it will prompt for the Nearby Device permission as it looks on the Google documentation. After this, I go into the Permissions in App Info, and I deny the Nearby Devices permission. When I debug this logic, it is saying BLUETOOTH_CONNECT is still allowed.

s = ContextCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED
a = ContextCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_SCAN) == PackageManager.PERMISSION_GRANTED
b = ContextCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH) == PackageManager.PERMISSION_GRANTED
c = ContextCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_ADMIN) == PackageManager.PERMISSION_GRANTED
d = ContextCompat.checkSelfPermission(this, Manifest.permission_group.NEARBY_DEVICES) == PackageManager.PERMISSION_GRANTED

When I debug this, BLUETOOTH_CONNECT is the only one showing as true, the rest are false. Any ideas on why this is happening and how it can be fixed? Potentially a bug? Thanks

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I encountered the same issue with

minSdkVersion 21
targetSdkVersion 30
compileSdkVersion 31

changing the target version to 31 fix it for me

minSdkVersion 21
targetSdkVersion 31
compileSdkVersion 31
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda