diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 3ef465a8daa..cb4547377e9 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -294,6 +294,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 131fe6b1159..4c4f11b311e 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -183,9 +183,14 @@
Discoverable
Discoverable for %1$s seconds\u2026
+
+ Discoverable
Make device discoverable
-
+
+ Discoverable timeout
+
+ Set how long device will be discoverable
Lock voice dialing
@@ -193,7 +198,7 @@
Prevent use of the bluetooth dialer when the screen is locked
-
+
Bluetooth devices
Device name
@@ -248,11 +253,19 @@
"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 tablet is requesting permission to make your tablet always discoverable by other Bluetooth devices. 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 tablet is requesting permission to turn on Bluetooth and to make your tablet 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 for %1$d seconds. Do you want to do this?"
+
+ "An application on your tablet is requesting permission to turn on Bluetooth and to make your tablet discoverable by other 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. 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 64e6377d7a1..b441ab41307 100644
--- a/res/xml/bluetooth_settings.xml
+++ b/res/xml/bluetooth_settings.xml
@@ -43,6 +43,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);