I am making an app that requires the user’s bluetooth discoverability/visibility timeout to “Never time out”.
I use the following code to ask the user to change the current settings.
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0);
startActivity(discoverableIntent);
However, I don’t want to bother the user if bluetooth discoverability is already on.
Is there a way to get the device’s current discoverability timeout?
You can use the the following:
You should also make sure that the Adapter is turned on.