From 1b0489cb3eb051b2cf18aa2cb3110ff904c9ebe8 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 Bluetooth discoverability to be two minues, five minutes, an hour, or forever discoverable. 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 | 17 +++- res/xml/bluetooth_settings.xml | 8 ++ .../BluetoothDiscoverableEnabler.java | 91 ++++++++++++++----- .../settings/bluetooth/BluetoothSettings.java | 7 +- .../bluetooth/RequestPermissionActivity.java | 21 ++++- .../RequestPermissionHelperActivity.java | 6 +- 7 files changed, 139 insertions(+), 29 deletions(-) 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 ea9f6cad32e..93dc5889d53 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -185,9 +185,14 @@ Discoverable Discoverable for %1$s seconds\u2026 + + Discoverable Make device discoverable - + + Discoverable timeout + + Set how long device will be discoverable Lock voice dialing @@ -195,7 +200,7 @@ Prevent use of the bluetooth dialer when the screen is locked - + Bluetooth devices Device name @@ -250,11 +255,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" /> + +