diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 560e6e3c1d6..1b3abbf3ba6 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -255,6 +255,24 @@
- TTLS
+
+
+
+
+ - 2 Minutes
+ - 5 Minutes
+ - 1 Hour
+ - Never
+
+
+
+
+ - twomin
+ - fivemin
+ - onehour
+ - never
+
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ed6787f5ab6..4c2ae0fc5a0 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -184,9 +184,14 @@
Discoverable
Discoverable for %1$s seconds\u2026
+
+ Discoverable
Make device discoverable
-
+
+ Discoverable timeout
+
+ Set how long device will be discoverable
Lock voice dialing
@@ -194,7 +199,7 @@
Prevent use of the bluetooth dialer when the screen is locked
-
+
Bluetooth devices
Device name
@@ -243,9 +248,15 @@
"An application on your phone is requesting permission to make your phone discoverable by other Bluetooth devices for %1$d seconds. Do you want to do this?"
+
+ "An application on your phone is requesting permission to make your phone always discoverable by other Bluetooth devices. Do you want to do this?"
+
"An application on your phone is requesting permission to turn on Bluetooth and to make your phone discoverable by other devices for %1$d seconds. Do you want to do this?"
+
+ "An application on your phone is requesting permission to turn on Bluetooth and to make your phone discoverable by other devices. Do you want to do this?"
+
"Turning on Bluetooth\u2026"
diff --git a/res/xml/bluetooth_settings.xml b/res/xml/bluetooth_settings.xml
index 131f7a01ee5..0c16880278b 100644
--- a/res/xml/bluetooth_settings.xml
+++ b/res/xml/bluetooth_settings.xml
@@ -40,6 +40,14 @@
android:summaryOff="@string/bluetooth_not_discoverable"
android:persistent="false" />
+
+
MAX_DISCOVERABLE_TIMEOUT) {
- mTimeout = MAX_DISCOVERABLE_TIMEOUT;
- } else if (mTimeout <= 0) {
+ // Right now assuming for simplicity that an app can pick any int value,
+ // and if equal to BluetoothDiscoverableEnabler.DISCOVERABLE_TIMEOUT_NEVER
+ // it will be treated as a request for lasting discoverability.
+ // Alternatively, a check can be added here for enforcing the specific allowed values
+ // as listed in BluetoothDiscoverableEnabler.
+ // We need to make all these value public.
+
+ if (mTimeout <= 0) {
mTimeout = BluetoothDiscoverableEnabler.DEFAULT_DISCOVERABLE_TIMEOUT;
}
} else {
diff --git a/src/com/android/settings/bluetooth/RequestPermissionHelperActivity.java b/src/com/android/settings/bluetooth/RequestPermissionHelperActivity.java
index c8698687f05..2657d91b896 100644
--- a/src/com/android/settings/bluetooth/RequestPermissionHelperActivity.java
+++ b/src/com/android/settings/bluetooth/RequestPermissionHelperActivity.java
@@ -75,7 +75,11 @@ public class RequestPermissionHelperActivity extends AlertActivity implements
if (mEnableOnly) {
tv.setText(getString(R.string.bluetooth_ask_enablement));
} else {
- tv.setText(getString(R.string.bluetooth_ask_enablement_and_discovery, mTimeout));
+ if (mTimeout == BluetoothDiscoverableEnabler.DISCOVERABLE_TIMEOUT_NEVER) {
+ tv.setText(getString(R.string.bluetooth_ask_enablement_and_lasting_discovery));
+ } else {
+ tv.setText(getString(R.string.bluetooth_ask_enablement_and_discovery, mTimeout));
+ }
}
p.mPositiveButtonText = getString(R.string.yes);