Implement Bluetooth device picker

Add Bluetooth device picker in Settings
- add resource to support device picker
- show different UI accroding to start Intent
- add OPP profile manager
This commit is contained in:
Yue Lixin
2009-07-09 16:48:52 +08:00
committed by Nick Pelly
parent 3b94f09756
commit a41e2f94b7
7 changed files with 273 additions and 31 deletions

View File

@@ -215,6 +215,8 @@
<!-- Notification message when a Bluetooth device wants to pair with us -->
<string name="bluetooth_notif_message">Select to pair with\u0020</string>
<!-- Strings for BluetoothDevicePicker -->
<string name="device_picker">Bluetooth device picker</string>
<!-- Do not translate. Used for diagnostic screens, precise translation is not necessary -->
<string name="bluetooth_scan_text">Empty button\u2026</string>
@@ -568,6 +570,8 @@
<string name="bluetooth_profile_a2dp">Media</string>
<!-- Bluetooth settings. The user-visible string that is used whenever referring to the headset or handsfree profile. -->
<string name="bluetooth_profile_headset">Phone</string>
<!-- Bluetooth settings. The user-visible string that is used whenever referring to the OPP profile. -->
<string name="bluetooth_profile_opp">Transfer</string>
<!-- Bluetooth settings. The summary string when a device is connected to the A2DP profile. -->
<string name="bluetooth_summary_connected_to_a2dp">Connected to media audio</string>
@@ -588,11 +592,17 @@
<string name="bluetooth_a2dp_profile_summary_connected">Connected to media audio</string>
<!-- Bluetooth settings. Connection options screen. The summary for the headset checkbox preference when headset is connected. -->
<string name="bluetooth_headset_profile_summary_connected">Connected to phone audio</string>
<!-- Bluetooth settings. Connection options screen. The summary for the OPP checkbox preference when OPP is connected. -->
<string name="bluetooth_opp_profile_summary_connected">Connected to file transfer server</string>
<!-- Bluetooth settings. Connection options screen. The summary for the OPP checkbox preference when OPP is not connected. -->
<string name="bluetooth_opp_profile_summary_not_connected">Not connected to file transfer server</string>
<!-- Bluetooth settings. Connection options screen. The summary for the A2DP checkbox preference that describes how checking it will set the A2DP profile as preferred. -->
<string name="bluetooth_a2dp_profile_summary_use_for">Use for media audio</string>
<!-- Bluetooth settings. Connection options screen. The summary for the headset checkbox preference that describes how checking it will set the headset profile as preferred. -->
<string name="bluetooth_headset_profile_summary_use_for">Use for phone audio</string>
<!-- Bluetooth settings. Connection options screen. The summary for the OPP checkbox preference that describes how checking it will set the OPP profile as preferred. -->
<string name="bluetooth_opp_profile_summary_use_for">Use for file transfer</string>
<!-- Wi-Fi settings -->
<!-- Used in the 2nd-level settings screen to turn on Wi-Fi -->

30
res/xml/device_picker.xml Normal file
View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<Preference
android:key="bt_scan"
android:title="@string/bluetooth_preference_scan_title" />
<com.android.settings.ProgressCategory
android:key="bt_device_list"
android:title="@string/bluetooth_devices"
android:orderingFromXml="false" />
</PreferenceScreen>