summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJake Hamby <jhamby@google.com>2012-06-11 17:04:14 -0700
committerJake Hamby <jhamby@google.com>2012-11-20 18:21:44 -0800
commit95c1003f1c6ea957065fa752d89c9f64b599461c (patch)
tree323e9a1ae4da1fc64bb7eaafe8173f45fee4f41a /tests
parente9f89cfbf5309453e8efc2826815592660e9e1c2 (diff)
downloadpackages_apps_Settings-95c1003f1c6ea957065fa752d89c9f64b599461c.zip
packages_apps_Settings-95c1003f1c6ea957065fa752d89c9f64b599461c.tar.gz
packages_apps_Settings-95c1003f1c6ea957065fa752d89c9f64b599461c.tar.bz2
Fix Bluetooth enable dialog to match Android style guide.
When an app requests to enable Bluetooth and/or Bluetooth discovery, we show a dialog for user confirmation. Remove the dialog title, update the message text and button labels to be more descriptive, and use the standard dialog layout instead of a custom layout. Also fixes the button layout on the Bluetooth permission test app so that the "Discoverable" button doesn't wrap to two lines. Bug: 6001468 Change-Id: I731e2f31b4c822395fc3f83584a092550d9ae7d3
Diffstat (limited to 'tests')
-rw-r--r--tests/res/layout/bluetooth_request_permission_test.xml6
-rw-r--r--tests/src/com/android/settings/tests/BluetoothRequestPermissionTest.java8
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/res/layout/bluetooth_request_permission_test.xml b/tests/res/layout/bluetooth_request_permission_test.xml
index 0a5aec0..b62db19 100644
--- a/tests/res/layout/bluetooth_request_permission_test.xml
+++ b/tests/res/layout/bluetooth_request_permission_test.xml
@@ -32,19 +32,19 @@
style="@android:style/ButtonBar">
<Button android:id="@+id/enable"
- android:layout_width="0dip"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/enable" />
<Button android:id="@+id/discoverable"
- android:layout_width="0dip"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/discoverable" />
<Button android:id="@+id/scan"
- android:layout_width="0dip"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/start_scan" />
diff --git a/tests/src/com/android/settings/tests/BluetoothRequestPermissionTest.java b/tests/src/com/android/settings/tests/BluetoothRequestPermissionTest.java
index 8064e3a..a2cdafe 100644
--- a/tests/src/com/android/settings/tests/BluetoothRequestPermissionTest.java
+++ b/tests/src/com/android/settings/tests/BluetoothRequestPermissionTest.java
@@ -36,6 +36,9 @@ public class BluetoothRequestPermissionTest extends Activity {
BluetoothAdapter mAdapter;
private ArrayAdapter<String> mMsgAdapter;
+ // Discoverable button alternates between 20 second timeout and no timeout.
+ private boolean mDiscoveryWithTimeout = true;
+
private class BtOnClickListener implements OnClickListener {
final boolean mEnableOnly; // enable or enable + discoverable
@@ -103,7 +106,10 @@ public class BluetoothRequestPermissionTest extends Activity {
} else {
addMsg("Starting activity to enable bt + discovery");
i.setAction(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
- i.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 20);
+ // Discoverability duration toggles between 20 seconds and no timeout.
+ int timeout = (mDiscoveryWithTimeout ? 20 : 0);
+ i.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, timeout);
+ mDiscoveryWithTimeout = !mDiscoveryWithTimeout;
}
startActivityForResult(i, 1);
}