diff options
Diffstat (limited to 'tests')
24 files changed, 157 insertions, 53 deletions
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml index fe4dd95..e125128 100644 --- a/tests/AndroidManifest.xml +++ b/tests/AndroidManifest.xml @@ -18,6 +18,7 @@ package="com.android.settings.tests"> <uses-permission android:name="android.permission.BLUETOOTH" /> + <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <application> <uses-library android:name="android.test.runner" /> diff --git a/tests/res/layout/bluetooth_request_permission_test.xml b/tests/res/layout/bluetooth_request_permission_test.xml index 8bb0daa..0a5aec0 100644 --- a/tests/res/layout/bluetooth_request_permission_test.xml +++ b/tests/res/layout/bluetooth_request_permission_test.xml @@ -16,18 +16,18 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> + android:layout_width="match_parent" + android:layout_height="match_parent"> <ListView android:id="@+id/msg_container" - android:layout_width="fill_parent" + android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" android:transcriptMode="normal"/> <LinearLayout android:orientation="horizontal" - android:layout_width="fill_parent" + android:layout_width="match_parent" android:layout_height="wrap_content" style="@android:style/ButtonBar"> @@ -37,10 +37,16 @@ android:layout_weight="1" android:text="@string/enable" /> - <Button android:id="@+id/discover" + <Button android:id="@+id/discoverable" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/discoverable" /> + + <Button android:id="@+id/scan" + android:layout_width="0dip" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/start_scan" /> </LinearLayout> </LinearLayout> diff --git a/tests/res/values-cs/strings.xml b/tests/res/values-cs/strings.xml index 835e589..6a6855f 100644 --- a/tests/res/values-cs/strings.xml +++ b/tests/res/values-cs/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Viditelné"</string> + <string name="start_scan" msgid="6035699220942169744">"Zahájit vyhledávání"</string> + <string name="stop_scan" msgid="527546916633745779">"Zastavit vyhledávání"</string> </resources> diff --git a/tests/res/values-da/strings.xml b/tests/res/values-da/strings.xml index 824db2c..f050a6d 100644 --- a/tests/res/values-da/strings.xml +++ b/tests/res/values-da/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Søgbar"</string> + <string name="start_scan" msgid="6035699220942169744">"Start scanning"</string> + <string name="stop_scan" msgid="527546916633745779">"Stop scanning"</string> </resources> diff --git a/tests/res/values-de/strings.xml b/tests/res/values-de/strings.xml index a6c4688..e6b624b 100644 --- a/tests/res/values-de/strings.xml +++ b/tests/res/values-de/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Sichtbar"</string> + <string name="start_scan" msgid="6035699220942169744">"Scan starten"</string> + <string name="stop_scan" msgid="527546916633745779">"Scan stoppen"</string> </resources> diff --git a/tests/res/values-el/strings.xml b/tests/res/values-el/strings.xml index f62e42d..58c9131 100644 --- a/tests/res/values-el/strings.xml +++ b/tests/res/values-el/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Ανιχνεύσιμο"</string> + <string name="start_scan" msgid="6035699220942169744">"Έναρξη σάρωσης"</string> + <string name="stop_scan" msgid="527546916633745779">"Διακοπή σάρωσης"</string> </resources> diff --git a/tests/res/values-es-rUS/strings.xml b/tests/res/values-es-rUS/strings.xml index 5d33eb0..9af4411 100644 --- a/tests/res/values-es-rUS/strings.xml +++ b/tests/res/values-es-rUS/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Visible"</string> + <string name="start_scan" msgid="6035699220942169744">"Comenzar lectura"</string> + <string name="stop_scan" msgid="527546916633745779">"Detener lectura"</string> </resources> diff --git a/tests/res/values-es/strings.xml b/tests/res/values-es/strings.xml index 5d33eb0..59e26f7 100644 --- a/tests/res/values-es/strings.xml +++ b/tests/res/values-es/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Visible"</string> + <string name="start_scan" msgid="6035699220942169744">"Iniciar búsqueda"</string> + <string name="stop_scan" msgid="527546916633745779">"Detener búsqueda"</string> </resources> diff --git a/tests/res/values-fr/strings.xml b/tests/res/values-fr/strings.xml index cc76bbf..35dbfd8 100644 --- a/tests/res/values-fr/strings.xml +++ b/tests/res/values-fr/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Identifiable"</string> + <string name="start_scan" msgid="6035699220942169744">"Démarrer la recherche"</string> + <string name="stop_scan" msgid="527546916633745779">"Arrêter la recherche"</string> </resources> diff --git a/tests/res/values-it/strings.xml b/tests/res/values-it/strings.xml index 86b6087..fb1516c 100644 --- a/tests/res/values-it/strings.xml +++ b/tests/res/values-it/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Rilevabile"</string> + <string name="start_scan" msgid="6035699220942169744">"Inizia scansione"</string> + <string name="stop_scan" msgid="527546916633745779">"Interrompi scansione"</string> </resources> diff --git a/tests/res/values-ja/strings.xml b/tests/res/values-ja/strings.xml index 692399e..8393110 100644 --- a/tests/res/values-ja/strings.xml +++ b/tests/res/values-ja/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"検出可能"</string> + <string name="start_scan" msgid="6035699220942169744">"スキャンを開始"</string> + <string name="stop_scan" msgid="527546916633745779">"スキャンを停止"</string> </resources> diff --git a/tests/res/values-ko/strings.xml b/tests/res/values-ko/strings.xml index 385b9b4..31516c6 100644 --- a/tests/res/values-ko/strings.xml +++ b/tests/res/values-ko/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="discoverable" msgid="3169265480789026010">"검색가능"</string> + <string name="discoverable" msgid="3169265480789026010">"검색 가능"</string> + <string name="start_scan" msgid="6035699220942169744">"검색 시작"</string> + <string name="stop_scan" msgid="527546916633745779">"검색 중지"</string> </resources> diff --git a/tests/res/values-nb/strings.xml b/tests/res/values-nb/strings.xml index cec9aff..c33b4ca 100644 --- a/tests/res/values-nb/strings.xml +++ b/tests/res/values-nb/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Synlig"</string> + <string name="start_scan" msgid="6035699220942169744">"Start skanning"</string> + <string name="stop_scan" msgid="527546916633745779">"Stopp skanning"</string> </resources> diff --git a/tests/res/values-nl/strings.xml b/tests/res/values-nl/strings.xml index d2152af..970cf8a 100644 --- a/tests/res/values-nl/strings.xml +++ b/tests/res/values-nl/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Vindbaar"</string> + <string name="start_scan" msgid="6035699220942169744">"Scan starten"</string> + <string name="stop_scan" msgid="527546916633745779">"Scan stoppen"</string> </resources> diff --git a/tests/res/values-pl/strings.xml b/tests/res/values-pl/strings.xml index 8cdfda4..151a1f3 100644 --- a/tests/res/values-pl/strings.xml +++ b/tests/res/values-pl/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Wykrywalny"</string> + <string name="start_scan" msgid="6035699220942169744">"Rozpocznij skanowanie"</string> + <string name="stop_scan" msgid="527546916633745779">"Zatrzymaj skanowanie"</string> </resources> diff --git a/tests/res/values-pt-rPT/strings.xml b/tests/res/values-pt-rPT/strings.xml index 6dc9a96..5b31f6f 100644 --- a/tests/res/values-pt-rPT/strings.xml +++ b/tests/res/values-pt-rPT/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Detectável"</string> + <string name="start_scan" msgid="6035699220942169744">"Iniciar análise"</string> + <string name="stop_scan" msgid="527546916633745779">"Parar análise"</string> </resources> diff --git a/tests/res/values-pt/strings.xml b/tests/res/values-pt/strings.xml index 6dc9a96..2db3708 100644 --- a/tests/res/values-pt/strings.xml +++ b/tests/res/values-pt/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Detectável"</string> + <string name="start_scan" msgid="6035699220942169744">"Iniciar verificação"</string> + <string name="stop_scan" msgid="527546916633745779">"Parar verificação"</string> </resources> diff --git a/tests/res/values-ru/strings.xml b/tests/res/values-ru/strings.xml index e0b5e9f..c0378b5 100644 --- a/tests/res/values-ru/strings.xml +++ b/tests/res/values-ru/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Видимый"</string> + <string name="start_scan" msgid="6035699220942169744">"Начать поиск"</string> + <string name="stop_scan" msgid="527546916633745779">"Остановить поиск"</string> </resources> diff --git a/tests/res/values-sv/strings.xml b/tests/res/values-sv/strings.xml index 8ab9e5d..0dce252 100644 --- a/tests/res/values-sv/strings.xml +++ b/tests/res/values-sv/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Synlighet"</string> + <string name="start_scan" msgid="6035699220942169744">"Starta sökning"</string> + <string name="stop_scan" msgid="527546916633745779">"Stoppa sökningen"</string> </resources> diff --git a/tests/res/values-tr/strings.xml b/tests/res/values-tr/strings.xml index 957a7ad..cd415e2 100644 --- a/tests/res/values-tr/strings.xml +++ b/tests/res/values-tr/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="discoverable" msgid="3169265480789026010">"Keşfedilebilir"</string> + <string name="start_scan" msgid="6035699220942169744">"Taramayı başlat"</string> + <string name="stop_scan" msgid="527546916633745779">"Taramayı durdur"</string> </resources> diff --git a/tests/res/values-zh-rCN/strings.xml b/tests/res/values-zh-rCN/strings.xml index 9b01b67..d17ee92 100644 --- a/tests/res/values-zh-rCN/strings.xml +++ b/tests/res/values-zh-rCN/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="discoverable" msgid="3169265480789026010">"可检测到"</string> + <string name="discoverable" msgid="3169265480789026010">"可检测性"</string> + <string name="start_scan" msgid="6035699220942169744">"开始扫描"</string> + <string name="stop_scan" msgid="527546916633745779">"停止扫描"</string> </resources> diff --git a/tests/res/values-zh-rTW/strings.xml b/tests/res/values-zh-rTW/strings.xml index 28ccde7..d570132 100644 --- a/tests/res/values-zh-rTW/strings.xml +++ b/tests/res/values-zh-rTW/strings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- Copyright (C) 2009 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,8 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> + --> + <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="discoverable" msgid="3169265480789026010">"可供偵測"</string> + <string name="discoverable" msgid="3169265480789026010">"可偵測性"</string> + <string name="start_scan" msgid="6035699220942169744">"開始掃瞄"</string> + <string name="stop_scan" msgid="527546916633745779">"停止掃瞄"</string> </resources> diff --git a/tests/res/values/strings.xml b/tests/res/values/strings.xml index cd94a2d..9fb98f9 100644 --- a/tests/res/values/strings.xml +++ b/tests/res/values/strings.xml @@ -20,6 +20,8 @@ <!-- Test only. Do not translate. --> <string name="enable">Enable</string> <string name="discoverable">Discoverable</string> + <string name="start_scan">Start scan</string> + <string name="stop_scan">Stop scan</string> <string name="operator_hello">Hello Operator!</string> <string name="operator_settings_title">Operator</string> <string name="operator_settings_summary">Operator hook that can be used to start activity of choice</string> diff --git a/tests/src/com/android/settings/tests/BluetoothRequestPermissionTest.java b/tests/src/com/android/settings/tests/BluetoothRequestPermissionTest.java index 105c98e..8064e3a 100644 --- a/tests/src/com/android/settings/tests/BluetoothRequestPermissionTest.java +++ b/tests/src/com/android/settings/tests/BluetoothRequestPermissionTest.java @@ -33,7 +33,7 @@ import android.widget.ListView; public class BluetoothRequestPermissionTest extends Activity { private static final String TAG = "BluetoothRequestPermissionTest"; - + BluetoothAdapter mAdapter; private ArrayAdapter<String> mMsgAdapter; private class BtOnClickListener implements OnClickListener { @@ -48,23 +48,50 @@ public class BluetoothRequestPermissionTest extends Activity { } } + private class BtScanOnClickListener implements OnClickListener { + public void onClick(View v) { + Button scanButton = (Button) v; + if (mAdapter.isDiscovering()) { + mAdapter.cancelDiscovery(); + scanButton.setText(R.string.start_scan); + } else { + mAdapter.startDiscovery(); + scanButton.setText(R.string.stop_scan); + } + } + } + @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.bluetooth_request_permission_test); + mAdapter = BluetoothAdapter.getDefaultAdapter(); Button enable = (Button) findViewById(R.id.enable); enable.setOnClickListener(new BtOnClickListener(true /* enable */)); - Button discover = (Button) findViewById(R.id.discover); - discover.setOnClickListener(new BtOnClickListener(false /* enable & discoverable */)); + Button discoverable = (Button) findViewById(R.id.discoverable); + discoverable.setOnClickListener(new BtOnClickListener(false /* enable & discoverable */)); + + Button scanButton = (Button) findViewById(R.id.scan); + scanButton.setOnClickListener(new BtScanOnClickListener()); + if (mAdapter.isDiscovering()) { + scanButton.setText(R.string.stop_scan); + } else { + scanButton.setText(R.string.start_scan); + } mMsgAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1); ListView listView = (ListView) findViewById(R.id.msg_container); listView.setAdapter(mMsgAdapter); - registerReceiver(mReceiver, new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED)); + IntentFilter filter = new IntentFilter(); + filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED); + filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); + filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED); + filter.addAction(BluetoothDevice.ACTION_FOUND); + registerReceiver(mReceiver, filter); addMsg("Initialized"); } @@ -113,7 +140,8 @@ public class BluetoothRequestPermissionTest extends Activity { public void onReceive(Context context, Intent intent) { if (intent == null) return; - if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(intent.getAction())) { + String action = intent.getAction(); + if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(action)) { String stateStr = "???"; switch (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothDevice.ERROR)) { case BluetoothAdapter.STATE_OFF: @@ -130,6 +158,13 @@ public class BluetoothRequestPermissionTest extends Activity { break; } addMsg("Bluetooth status = " + stateStr); + } else if (action.equals(BluetoothDevice.ACTION_FOUND)) { + String name = intent.getStringExtra(BluetoothDevice.EXTRA_NAME); + addMsg("Found: " + name); + } else if (action.equals(BluetoothAdapter.ACTION_DISCOVERY_STARTED)) { + addMsg("Scan started..."); + } else if (action.equals(BluetoothAdapter.ACTION_DISCOVERY_FINISHED)) { + addMsg("Scan ended"); } } }; |