diff options
author | Jake Hamby <jhamby@google.com> | 2012-06-11 17:04:14 -0700 |
---|---|---|
committer | Jake Hamby <jhamby@google.com> | 2012-11-20 18:21:44 -0800 |
commit | 95c1003f1c6ea957065fa752d89c9f64b599461c (patch) | |
tree | 323e9a1ae4da1fc64bb7eaafe8173f45fee4f41a /tests/src/com/android/settings | |
parent | e9f89cfbf5309453e8efc2826815592660e9e1c2 (diff) | |
download | packages_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/src/com/android/settings')
-rw-r--r-- | tests/src/com/android/settings/tests/BluetoothRequestPermissionTest.java | 8 |
1 files changed, 7 insertions, 1 deletions
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); } |