auto import from //branches/cupcake/...@127436

This commit is contained in:
The Android Open Source Project
2009-01-22 00:13:44 -08:00
parent 01f172366c
commit 590c0a97ff
34 changed files with 894 additions and 101 deletions

View File

@@ -28,6 +28,8 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_APN_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES"/>
<uses-permission android:name="android.permission.READ_USER_DICTIONARY"/>
<uses-permission android:name="android.permission.WRITE_USER_DICTIONARY"/>
<application android:label="@string/settings_label" android:icon="@drawable/ic_launcher_settings">
@@ -150,6 +152,14 @@
</intent-filter>
</activity>
<activity android:name="UserDictionarySettings" android:icon="@drawable/app_settings"
android:label="@string/user_dict_settings_titlebar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.VOICE_LAUNCH" />
</intent-filter>
</activity>
<activity android:name="SoundAndDisplaySettings" android:label="@string/sound_and_display_settings"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>

BIN
res/drawable/ic_menu_add.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dip"
android:paddingRight="8dip">
<EditText
android:id="@+id/edittext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawSelectorOnTop="false"
/>
<TextView android:id="@+id/empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dip"
android:gravity="center"
android:visibility="gone" />
</FrameLayout>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"Neznámé"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"Znak „.“ lze vložit dvěma stisky klávesy Mezerník."</string>
<string name="show_password">"Zobrazování hesel"</string>
<string name="show_password_summary">"Zadávané heslo je zobrazováno"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"Testování"</string>
<string name="testing_phone_info">"Info o telefonu"</string>
<string name="testing_battery_info">"Info o baterii"</string>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"Unbekannt"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"Leertaste zweimal drücken, um \".\" hinzuzufügen"</string>
<string name="show_password">"Sichtbare Passwörter"</string>
<string name="show_password_summary">"Passwort bei der Eingabe anzeigen"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"Test"</string>
<string name="testing_phone_info">"Telefoninformation"</string>
<string name="testing_battery_info">"Akkuinformationen"</string>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"Desconocido"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"Pulse la tecla Espacio dos veces para insertar el carácter \".\"."</string>
<string name="show_password">"Contraseñas visibles"</string>
<string name="show_password_summary">"Mostrar contraseña mientras se escribe"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"Prueba"</string>
<string name="testing_phone_info">"Información sobre el teléfono"</string>
<string name="testing_battery_info">"Información sobre la batería"</string>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"Inconnu"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"Appuyez deux fois sur la touche Espace pour insérer \".\""</string>
<string name="show_password">"Mots de passe visibles"</string>
<string name="show_password_summary">"Afficher le mot de passe lors de la saisie"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"Test"</string>
<string name="testing_phone_info">"Informations sur le téléphone"</string>
<string name="testing_battery_info">"Informations sur la batterie"</string>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"Sconosciuto"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"Premi due volte la barra spaziatrice per inserire \".\""</string>
<string name="show_password">"Password visibili"</string>
<string name="show_password_summary">"Mostra la password durante la digitazione"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"Verifica in corso"</string>
<string name="testing_phone_info">"Informazioni telefono"</string>
<string name="testing_battery_info">"Informazioni batteria"</string>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"不明"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"Spaceキーを2回押して「。」を挿入"</string>
<string name="show_password">"パスワードを表示"</string>
<string name="show_password_summary">"入力中のパスワードを表示"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"テスト中"</string>
<string name="testing_phone_info">"携帯電話情報"</string>
<string name="testing_battery_info">"バッテリ情報"</string>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"Onbekend"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"Druk twee keer op de spatiebalk om \'.\' in te voegen"</string>
<string name="show_password">"Zichtbare wachtwoorden"</string>
<string name="show_password_summary">"Wachtwoord weergeven tijdens het typen"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"Testen"</string>
<string name="testing_phone_info">"Telefooninformatie"</string>
<string name="testing_battery_info">"Accu-informatie"</string>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"Nieznany"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"Naciśnij klawisz spacji dwukrotnie, aby wstawić „.”"</string>
<string name="show_password">"Widoczne hasła"</string>
<string name="show_password_summary">"Pokazuj hasło podczas wpisywania"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"Testowanie"</string>
<string name="testing_phone_info">"Informacje o telefonie"</string>
<string name="testing_battery_info">"Informacje o baterii"</string>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"Неизвестно"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"Чтобы вставить символ \".\", дважды нажмите пробел."</string>
<string name="show_password">"Показывать пароли"</string>
<string name="show_password_summary">"Показывать пароль при вводе"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"Тестирование"</string>
<string name="testing_phone_info">"Сведения о телефоне"</string>
<string name="testing_battery_info">"Сведения о батарее"</string>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"未知"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"按两次空格键来插入“。”"</string>
<string name="show_password">"可见的密码"</string>
<string name="show_password_summary">"键入时显示密码"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"测试"</string>
<string name="testing_phone_info">"手机信息"</string>
<string name="testing_battery_info">"电池信息"</string>

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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-array name="timezone_filters">

View File

@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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="device_info_default">"未知的"</string>
@@ -632,6 +646,22 @@
<string name="auto_punctuate_summary">"按空白鍵兩次可插入「.」"</string>
<string name="show_password">"密碼可見"</string>
<string name="show_password_summary">"顯示輸入的密碼"</string>
<!-- no translation found for user_dict_settings_titlebar (765659257455000490) -->
<skip />
<!-- no translation found for user_dict_settings_title (8357027437499042191) -->
<skip />
<!-- no translation found for user_dict_settings_summary (2460427065601355471) -->
<skip />
<!-- no translation found for user_dict_settings_add_menu_title (4056762757149923551) -->
<skip />
<!-- no translation found for user_dict_settings_add_dialog_title (4702613990174126482) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_edit_title (2210564879320004837) -->
<skip />
<!-- no translation found for user_dict_settings_context_menu_delete_title (9140703913776549054) -->
<skip />
<!-- no translation found for user_dict_settings_empty_text (6209268025109242806) -->
<skip />
<string name="testing">"測試中"</string>
<string name="testing_phone_info">"手機資訊"</string>
<string name="testing_battery_info">"電池資訊"</string>

View File

@@ -1525,6 +1525,24 @@ found in the list of installed applications.</string>
<!-- On Security & location settings screen, setting check box summary. Summary for the visible passwords setting. -->
<string name="show_password_summary">Show password as you type</string>
<!-- User dictionary settings --><skip />
<!-- User dictionary settings, The titlebar text of the User dictionary settings screen. -->
<string name="user_dict_settings_titlebar">User dictionary</string>
<!-- User dictionary settings, The title of the list item to go into the User dictionary settings screen. -->
<string name="user_dict_settings_title">User dictionary</string>
<!-- User dictionary settings. The summary of the listem item to go into the User dictionary settings screen. -->
<string name="user_dict_settings_summary">Add &amp; remove words from user dictionary</string>
<!-- User dictionary settings. The title of the menu item to add a new word to the user dictionary. -->
<string name="user_dict_settings_add_menu_title">Add</string>
<!-- User dictionary settings. The title of the dialog to add a new word to the user dictionary. -->
<string name="user_dict_settings_add_dialog_title">Add to dictionary</string>
<!-- User dictionary settings. The title of the context menu item to edit the current word -->
<string name="user_dict_settings_context_menu_edit_title">Edit</string>
<!-- User dictionary settings. The title of the context menu item to delete the current word -->
<string name="user_dict_settings_context_menu_delete_title">Delete</string>
<!-- User dictionary settings. The text to show when there are no user-defined words in the dictionary -->
<string name="user_dict_settings_empty_text">You do not have any words in the user dictionary. You can add a word through the menu.</string>
<!-- This is for diagnostics screen. The title of a screen with various items realted to launching screens that will giev the user info. For example, it contains "Phone information" and "Battery information" -->
<string name="testing">Testing</string>
<!-- In the Testing screen. The item title of the activity that shows a bunch of phone-related information. -->

View File

@@ -42,6 +42,13 @@
android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.InputMethodsSettings" />
</PreferenceScreen>
<PreferenceScreen
android:title="@string/user_dict_settings_title"
android:summary="@string/user_dict_settings_summary">
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.UserDictionarySettings" />
</PreferenceScreen>
<CheckBoxPreference
android:key="auto_replace"
android:title="@string/auto_replace"

View File

@@ -0,0 +1,242 @@
/**
* Copyright (C) 2007 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, 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.
*/
package com.android.settings;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ListActivity;
import android.content.Context;
import android.content.DialogInterface;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.UserDictionary;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ContextMenu.ContextMenuInfo;
import android.widget.AlphabetIndexer;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SectionIndexer;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import java.util.Locale;
public class UserDictionarySettings extends ListActivity {
private static final String INSTANCE_KEY_DIALOG_EDITING_WORD = "DIALOG_EDITING_WORD";
private static final String[] QUERY_PROJECTION = {
UserDictionary.Words._ID, UserDictionary.Words.WORD
};
// Either the locale is empty (means the word is applicable to all locales)
// or the word equals our current locale
private static final String QUERY_SELECTION = UserDictionary.Words.LOCALE + "=? OR "
+ UserDictionary.Words.LOCALE + " is null";
private static final String DELETE_SELECTION = UserDictionary.Words.WORD + "=?";
private static final int CONTEXT_MENU_EDIT = Menu.FIRST;
private static final int CONTEXT_MENU_DELETE = Menu.FIRST + 1;
private static final int OPTIONS_MENU_ADD = Menu.FIRST;
private static final int DIALOG_ADD_OR_EDIT = 0;
/** The word being edited in the dialog (null means the user is adding a word). */
private String mDialogEditingWord;
private Cursor mCursor;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_content_with_empty_view);
mCursor = createCursor();
setListAdapter(createAdapter());
TextView emptyView = (TextView) findViewById(R.id.empty);
emptyView.setText(R.string.user_dict_settings_empty_text);
ListView listView = getListView();
listView.setFastScrollEnabled(true);
listView.setEmptyView(emptyView);
registerForContextMenu(listView);
}
@Override
protected void onRestoreInstanceState(Bundle state) {
super.onRestoreInstanceState(state);
mDialogEditingWord = state.getString(INSTANCE_KEY_DIALOG_EDITING_WORD);
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(INSTANCE_KEY_DIALOG_EDITING_WORD, mDialogEditingWord);
}
private Cursor createCursor() {
String currentLocale = Locale.getDefault().toString();
// Case-insensitive sort
return managedQuery(UserDictionary.Words.CONTENT_URI, QUERY_PROJECTION,
QUERY_SELECTION, new String[] { currentLocale },
"UPPER(" + UserDictionary.Words.WORD + ")");
}
private ListAdapter createAdapter() {
return new MyAdapter(this,
android.R.layout.simple_list_item_1, mCursor,
new String[] { UserDictionary.Words.WORD },
new int[] { android.R.id.text1 });
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
showAddOrEditDialog(getWord(position));
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
if (!(menuInfo instanceof AdapterContextMenuInfo)) return;
AdapterContextMenuInfo adapterMenuInfo = (AdapterContextMenuInfo) menuInfo;
menu.setHeaderTitle(getWord(adapterMenuInfo.position));
menu.add(0, CONTEXT_MENU_EDIT, 0, R.string.user_dict_settings_context_menu_edit_title);
menu.add(0, CONTEXT_MENU_DELETE, 0, R.string.user_dict_settings_context_menu_delete_title);
}
@Override
public boolean onContextItemSelected(MenuItem item) {
ContextMenuInfo menuInfo = item.getMenuInfo();
if (!(menuInfo instanceof AdapterContextMenuInfo)) return false;
AdapterContextMenuInfo adapterMenuInfo = (AdapterContextMenuInfo) menuInfo;
String word = getWord(adapterMenuInfo.position);
switch (item.getItemId()) {
case CONTEXT_MENU_DELETE:
deleteWord(word);
return true;
case CONTEXT_MENU_EDIT:
showAddOrEditDialog(word);
return true;
}
return false;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(0, OPTIONS_MENU_ADD, 0, R.string.user_dict_settings_add_menu_title)
.setIcon(R.drawable.ic_menu_add);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
showAddOrEditDialog(null);
return true;
}
private void showAddOrEditDialog(String editingWord) {
mDialogEditingWord = editingWord;
showDialog(DIALOG_ADD_OR_EDIT);
}
private String getWord(int position) {
mCursor.moveToPosition(position);
return mCursor.getString(
mCursor.getColumnIndexOrThrow(UserDictionary.Words.WORD));
}
@Override
protected Dialog onCreateDialog(int id) {
View content = getLayoutInflater().inflate(R.layout.dialog_edittext, null);
final EditText editText = (EditText) content.findViewById(R.id.edittext);
return new AlertDialog.Builder(this)
.setTitle(R.string.user_dict_settings_add_dialog_title)
.setView(content)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
onAddOrEditFinished(editText.getText().toString());
}})
.setNegativeButton(android.R.string.cancel, null)
.create();
}
@Override
protected void onPrepareDialog(int id, Dialog d) {
AlertDialog dialog = (AlertDialog) d;
EditText editText = (EditText) dialog.findViewById(R.id.edittext);
editText.setText(mDialogEditingWord);
}
private void onAddOrEditFinished(String word) {
if (mDialogEditingWord != null) {
// The user was editing a word, so do a delete/add
deleteWord(mDialogEditingWord);
}
// Disallow duplicates
deleteWord(word);
// TODO: present UI for picking whether to add word to all locales, or current.
UserDictionary.Words.addWord(this, word.toString(),
1, UserDictionary.Words.LOCALE_TYPE_ALL);
mCursor.requery();
}
private void deleteWord(String word) {
getContentResolver().delete(UserDictionary.Words.CONTENT_URI, DELETE_SELECTION,
new String[] { word });
}
private static class MyAdapter extends SimpleCursorAdapter implements SectionIndexer {
private AlphabetIndexer mIndexer;
public MyAdapter(Context context, int layout, Cursor c, String[] from, int[] to) {
super(context, layout, c, from, to);
int wordColIndex = c.getColumnIndexOrThrow(UserDictionary.Words.WORD);
String alphabet = context.getString(com.android.internal.R.string.fast_scroll_alphabet);
mIndexer = new AlphabetIndexer(c, wordColIndex, alphabet);
}
public int getPositionForSection(int section) {
return mIndexer.getPositionForSection(section);
}
public int getSectionForPosition(int position) {
return mIndexer.getSectionForPosition(position);
}
public Object[] getSections() {
return mIndexer.getSections();
}
}
}

View File

@@ -21,13 +21,12 @@ import com.android.settings.bluetooth.LocalBluetoothManager.ExtendedBluetoothSta
import android.bluetooth.BluetoothA2dp;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothError;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.IBluetoothDeviceCallback;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Handler;
import android.util.Log;
/**
@@ -40,29 +39,6 @@ public class BluetoothEventRedirector {
private static final boolean V = LocalBluetoothManager.V;
private LocalBluetoothManager mManager;
private Handler mUiHandler = new Handler();
private IBluetoothDeviceCallback mBtDevCallback = new IBluetoothDeviceCallback.Stub() {
public void onCreateBondingResult(final String address, final int result) {
if (V) {
Log.v(TAG, "onCreateBondingResult(" + address + ", " + result + ")");
}
mUiHandler.post(new Runnable() {
public void run() {
boolean wasSuccess = result == BluetoothDevice.RESULT_SUCCESS;
LocalBluetoothDeviceManager deviceManager = mManager.getLocalDeviceManager();
deviceManager.onBondingStateChanged(address, wasSuccess);
if (!wasSuccess) {
deviceManager.onBondingError(address);
}
}
});
}
public void onEnableResult(int result) { }
public void onGetRemoteServiceChannelResult(String address, int channel) { }
};
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
@Override
@@ -91,12 +67,16 @@ public class BluetoothEventRedirector {
mManager.getLocalDeviceManager().onDeviceDisappeared(address);
} else if (action.equals(BluetoothIntent.REMOTE_NAME_UPDATED_ACTION)) {
mManager.getLocalDeviceManager().onDeviceNameUpdated(address);
} else if (action.equals(BluetoothIntent.BONDING_CREATED_ACTION)) {
mManager.getLocalDeviceManager().onBondingStateChanged(address, true);
} else if (action.equals(BluetoothIntent.BONDING_REMOVED_ACTION)) {
mManager.getLocalDeviceManager().onBondingStateChanged(address, false);
} else if (action.equals(BluetoothIntent.BOND_STATE_CHANGED_ACTION)) {
int bondState = intent.getIntExtra(BluetoothIntent.BOND_STATE,
BluetoothError.ERROR);
mManager.getLocalDeviceManager().onBondingStateChanged(address, bondState);
if (bondState == BluetoothDevice.BOND_NOT_BONDED) {
int reason = intent.getIntExtra(BluetoothIntent.REASON, BluetoothError.ERROR);
Log.w(TAG, address + " unbonded with reason " + reason +
", TODO: handle this nicely in the UI"); //TODO
mManager.getLocalDeviceManager().onBondingError(address);
}
} else if (action.equals(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION)) {
mManager.getLocalDeviceManager().onProfileStateChanged(address);
@@ -139,8 +119,7 @@ public class BluetoothEventRedirector {
filter.addAction(BluetoothIntent.REMOTE_NAME_UPDATED_ACTION);
// Pairing broadcasts
filter.addAction(BluetoothIntent.BONDING_CREATED_ACTION);
filter.addAction(BluetoothIntent.BONDING_REMOVED_ACTION);
filter.addAction(BluetoothIntent.BOND_STATE_CHANGED_ACTION);
// Fine-grained state broadcasts
filter.addAction(BluetoothA2dp.SINK_STATE_CHANGED_ACTION);
@@ -152,8 +131,4 @@ public class BluetoothEventRedirector {
public void stop() {
mManager.getContext().unregisterReceiver(mBroadcastReceiver);
}
public IBluetoothDeviceCallback getBluetoothDeviceCallback() {
return mBtDevCallback;
}
}

View File

@@ -60,7 +60,7 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
private boolean mVisible;
private int mPairingStatus;
private int mBondState;
private final LocalBluetoothManager mLocalManager;
@@ -85,13 +85,13 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
}
public void onClicked() {
int pairingStatus = getPairingStatus();
int bondState = getBondState();
if (isConnected()) {
askDisconnect();
} else if (pairingStatus == SettingsBtStatus.PAIRING_STATUS_PAIRED) {
} else if (bondState == BluetoothDevice.BOND_BONDED) {
connect();
} else if (pairingStatus == SettingsBtStatus.PAIRING_STATUS_UNPAIRED) {
} else if (bondState == BluetoothDevice.BOND_NOT_BONDED) {
pair();
}
}
@@ -195,7 +195,7 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
}
private boolean ensurePaired() {
if (getPairingStatus() == SettingsBtStatus.PAIRING_STATUS_UNPAIRED) {
if (getBondState() == BluetoothDevice.BOND_NOT_BONDED) {
pair();
return false;
} else {
@@ -206,26 +206,27 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
public void pair() {
BluetoothDevice manager = mLocalManager.getBluetoothManager();
// Pairing doesn't work if scanning, so cancel
// Pairing is unreliable while scanning, so cancel discovery
if (manager.isDiscovering()) {
manager.cancelDiscovery();
}
if (mLocalManager.createBonding(mAddress)) {
setPairingStatus(SettingsBtStatus.PAIRING_STATUS_PAIRING);
//TODO: consider removing this line - UI will update through Intent
setBondState(BluetoothDevice.BOND_BONDING);
}
}
public void unpair() {
BluetoothDevice manager = mLocalManager.getBluetoothManager();
switch (getPairingStatus()) {
case SettingsBtStatus.PAIRING_STATUS_PAIRED:
manager.removeBonding(mAddress);
switch (getBondState()) {
case BluetoothDevice.BOND_BONDED:
manager.removeBond(mAddress);
break;
case SettingsBtStatus.PAIRING_STATUS_PAIRING:
manager.cancelBondingProcess(mAddress);
case BluetoothDevice.BOND_BONDING:
manager.cancelBondProcess(mAddress);
break;
}
}
@@ -238,9 +239,7 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
LocalBluetoothProfileManager.fill(mBtClass, mProfiles);
mPairingStatus = manager.hasBonding(mAddress)
? SettingsBtStatus.PAIRING_STATUS_PAIRED
: SettingsBtStatus.PAIRING_STATUS_UNPAIRED;
mBondState = manager.getBondState(mAddress);
mVisible = false;
@@ -283,13 +282,13 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
}
}
public int getPairingStatus() {
return mPairingStatus;
public int getBondState() {
return mBondState;
}
void setPairingStatus(int pairingStatus) {
if (mPairingStatus != pairingStatus) {
mPairingStatus = pairingStatus;
void setBondState(int bondState) {
if (mBondState != bondState) {
mBondState = bondState;
dispatchAttributesChanged();
}
}
@@ -327,7 +326,7 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
}
}
if (getPairingStatus() == SettingsBtStatus.PAIRING_STATUS_PAIRING) {
if (getBondState() == BluetoothDevice.BOND_BONDING) {
return true;
}
@@ -375,8 +374,7 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
}
}
int pairingStatus = getPairingStatus();
return SettingsBtStatus.getPairingStatusSummary(pairingStatus);
return SettingsBtStatus.getPairingStatusSummary(getBondState());
}
/**
@@ -430,7 +428,7 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
// No context menu if there are no profiles
if (mProfiles.size() == 0) return;
int pairingStatus = getPairingStatus();
int bondState = getBondState();
boolean isConnected = isConnected();
menu.setHeaderTitle(getName());
@@ -439,13 +437,13 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
menu.add(0, CONTEXT_ITEM_DISCONNECT, 0, R.string.bluetooth_device_context_disconnect);
} else {
// For connection action, show either "Connect" or "Pair & connect"
int connectString = pairingStatus == SettingsBtStatus.PAIRING_STATUS_UNPAIRED
int connectString = (bondState == BluetoothDevice.BOND_NOT_BONDED)
? R.string.bluetooth_device_context_pair_connect
: R.string.bluetooth_device_context_connect;
menu.add(0, CONTEXT_ITEM_CONNECT, 0, connectString);
}
if (pairingStatus == SettingsBtStatus.PAIRING_STATUS_PAIRED) {
if (bondState == BluetoothDevice.BOND_BONDED) {
// For unpair action, show either "Unpair" or "Disconnect & unpair"
int unpairString = isConnected
? R.string.bluetooth_device_context_disconnect_unpair
@@ -540,8 +538,8 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
if (comparison != 0) return comparison;
// Paired above not paired
comparison = (another.mPairingStatus == SettingsBtStatus.PAIRING_STATUS_PAIRED ? 1 : 0) -
(mPairingStatus == SettingsBtStatus.PAIRING_STATUS_PAIRED ? 1 : 0);
comparison = (another.mBondState == BluetoothDevice.BOND_BONDED ? 1 : 0) -
(mBondState == BluetoothDevice.BOND_BONDED ? 1 : 0);
if (comparison != 0) return comparison;
// Visible above not visible

View File

@@ -47,7 +47,7 @@ public class LocalBluetoothDeviceManager {
private synchronized void readPairedDevices() {
BluetoothDevice manager = mLocalManager.getBluetoothManager();
String[] bondedAddresses = manager.listBondings();
String[] bondedAddresses = manager.listBonds();
if (bondedAddresses == null) return;
for (String address : bondedAddresses) {
@@ -97,7 +97,7 @@ public class LocalBluetoothDeviceManager {
}
private void checkForDeviceRemoval(LocalBluetoothDevice device) {
if (device.getPairingStatus() == SettingsBtStatus.PAIRING_STATUS_UNPAIRED &&
if (device.getBondState() == BluetoothDevice.BOND_NOT_BONDED &&
!device.isVisible()) {
// If device isn't paired, remove it altogether
mDevices.remove(device);
@@ -154,7 +154,7 @@ public class LocalBluetoothDeviceManager {
}
}
public synchronized void onBondingStateChanged(String address, boolean created) {
public synchronized void onBondingStateChanged(String address, int bondState) {
LocalBluetoothDevice device = findDevice(address);
if (device == null) {
Log.e(TAG, "Got bonding state changed for " + address +
@@ -162,11 +162,10 @@ public class LocalBluetoothDeviceManager {
return;
}
device.setPairingStatus(created ? SettingsBtStatus.PAIRING_STATUS_PAIRED
: SettingsBtStatus.PAIRING_STATUS_UNPAIRED);
device.setBondState(bondState); //TODO: might be unecessary
checkForDeviceRemoval(device);
if (created) {
if (bondState == BluetoothDevice.BOND_BONDED) {
// Auto-connect after pairing
device.connect();
}

View File

@@ -227,7 +227,7 @@ public class LocalBluetoothManager {
}
public boolean createBonding(String address) {
return mManager.createBonding(address, mEventRedirector.getBluetoothDeviceCallback());
return mManager.createBond(address);
}
public void showError(String address, int titleResId, int messageResId) {

View File

@@ -16,6 +16,8 @@
package com.android.settings.bluetooth;
import android.bluetooth.BluetoothDevice;
import com.android.settings.R;
/**
@@ -64,19 +66,13 @@ public class SettingsBtStatus {
|| connectionStatus == CONNECTION_STATUS_DISCONNECTING;
}
// Pairing status
public static final int PAIRING_STATUS_UNPAIRED = 0;
public static final int PAIRING_STATUS_PAIRED = 1;
public static final int PAIRING_STATUS_PAIRING = 2;
public static final int getPairingStatusSummary(int pairingStatus) {
switch (pairingStatus) {
case PAIRING_STATUS_PAIRED:
public static final int getPairingStatusSummary(int bondState) {
switch (bondState) {
case BluetoothDevice.BOND_BONDED:
return R.string.bluetooth_paired;
case PAIRING_STATUS_PAIRING:
case BluetoothDevice.BOND_BONDING:
return R.string.bluetooth_pairing;
case PAIRING_STATUS_UNPAIRED:
case BluetoothDevice.BOND_NOT_BONDED:
return R.string.bluetooth_not_connected;
default:
return 0;