I see in documentation that if you set the EXTRA_DISCOVERABLE_DURATION extra's value to 0, the device is always discoverable.
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,0);
startActivity(discoverableIntent);
but I see this message in the mobile:
an app want to enable bluetooth and make your device visible to other device for 120 seconds.
I see this problem in stackoverflow but always without any solution any way to make the bluetooth always discoverable ?
NB: all values give 160 and not only 0 ,I try 100 for exemple
Documentation does not promise that "0" is "always discoverable"
It says "120" seconds is deault, "300" seconds is maximum. And that's for good - I do not want any application makers making such decisions ("make bluetooth always discoverable") on my phone.