From cdd9d033b0f16c705433f009812e69bed977e1cf Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Tue, 1 Feb 2011 15:09:13 -0800 Subject: [PATCH] Allow users to change the length of BT disoverability. DO NOT MERGE It can set to be two minues, five minutes, an hour, or forever discoverable. The default is 120 secs. This addresses the internal bug 2413429: http://b/issue?id=2413429 and external issue 6348: http://code.google.com/p/android/issues/detail?id=6348 Original Author: Chris Wren Modifications done by: Jaikumar Ganesh Change-Id: Ie12e56ac41aa01a161d263c7525b6e021d4eeb1f --- res/values/arrays.xml | 18 ++++ res/values/strings.xml | 15 ++- res/xml/bluetooth_settings.xml | 8 ++ .../BluetoothDiscoverableEnabler.java | 91 ++++++++++++++----- .../settings/bluetooth/BluetoothSettings.java | 11 ++- .../bluetooth/RequestPermissionActivity.java | 21 ++++- .../RequestPermissionHelperActivity.java | 6 +- 7 files changed, 139 insertions(+), 31 deletions(-) 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" /> + +