Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

506
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!