Merge "Fix USB tethering"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 4ce4fb9..69ec091 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -347,7 +347,7 @@
</activity>
<activity android:name=".inputmethod.InputMethodAndSubtypeEnablerActivity"
- android:label="@string/input_methods_and_subtype_enabler_title"
+ android:label=""
android:clearTaskOnLaunch="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
diff --git a/res/drawable-hdpi/ic_settings_call.png b/res/drawable-hdpi/ic_settings_call.png
deleted file mode 100755
index f065807..0000000
--- a/res/drawable-hdpi/ic_settings_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-large-mdpi/setups_bg_account.png b/res/drawable-large-mdpi/setups_bg_account.png
deleted file mode 100644
index 42901f7..0000000
--- a/res/drawable-large-mdpi/setups_bg_account.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-large-mdpi/setups_bg_activating.png b/res/drawable-large-mdpi/setups_bg_activating.png
deleted file mode 100644
index 9b797c1..0000000
--- a/res/drawable-large-mdpi/setups_bg_activating.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-large-mdpi/setups_bg_welcome.png b/res/drawable-large-mdpi/setups_bg_welcome.png
deleted file mode 100644
index 8fcb8bf..0000000
--- a/res/drawable-large-mdpi/setups_bg_welcome.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_call.png b/res/drawable-mdpi/ic_settings_call.png
deleted file mode 100755
index b4cf0db..0000000
--- a/res/drawable-mdpi/ic_settings_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-mdpi/setups_bg_account.png b/res/drawable-xlarge-mdpi/setups_bg_account.png
deleted file mode 100644
index 3c95c53..0000000
--- a/res/drawable-xlarge-mdpi/setups_bg_account.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-mdpi/setups_bg_activating.png b/res/drawable-xlarge-mdpi/setups_bg_activating.png
deleted file mode 100644
index f1cb815..0000000
--- a/res/drawable-xlarge-mdpi/setups_bg_activating.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-mdpi/setups_bg_welcome.png b/res/drawable-xlarge-mdpi/setups_bg_welcome.png
deleted file mode 100644
index 5daa1c6..0000000
--- a/res/drawable-xlarge-mdpi/setups_bg_welcome.png
+++ /dev/null
Binary files differ
diff --git a/res/layout/zeroclick.xml b/res/layout/zeroclick.xml
new file mode 100644
index 0000000..99558f3
--- /dev/null
+++ b/res/layout/zeroclick.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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:orientation="vertical"
+ android:paddingLeft="6dip"
+ android:paddingRight="6dip"
+ android:layout_width="match_parent" android:layout_height="wrap_content"
+ android:scrollbars="vertical" >
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fillViewport="true">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <View
+ android:paddingTop="53dip"
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:background="#ff404040"
+ />
+
+ <CheckBox android:id="@+id/zeroclick_checkbox"
+ android:layout_width="match_parent"
+ android:layout_height="64dip"
+ android:gravity="center_vertical"
+ android:text="@string/zeroclick_label"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorSecondary"
+ />
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:background="#ff404040"
+ />
+
+ <TextView android:id="@+id/zeroclick_explained"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="20dip"
+ android:gravity="top"
+ android:text="@string/zeroclick_explained"
+ />
+
+
+ </LinearLayout>
+
+ </ScrollView>
+
+</LinearLayout>
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e10d8f7..72db3d0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -349,8 +349,6 @@
<!-- HTTP proxy settings title -->
<string name="proxy_settings_title">Proxy settings</string>
- <!-- HTTP proxy settings summary -->
- <string name="proxy_settings_summary">Set the global HTTP proxy and exclusion lists</string>
<!-- HTTP proxy settings. Button to clear the proxy box. -->
<string name="proxy_clear_text">Clear</string>
<!-- HTTP proxy settings. The port number label. -->
@@ -541,12 +539,6 @@
<string name="settings_shortcut">Select settings shortcut</string>
<!-- Wireless controls settings screen, setting check box label -->
<string name="airplane_mode">Airplane mode</string>
- <!-- Wireless controls settings screen, setting option summary text -->
- <string name="airplane_mode_summary">Disable all wireless connections</string>
- <!-- Wireless controls settings screen, setting option summary text as airplane mode is being enabled (so it is disabling all wireless connections) -->
- <string name="airplane_mode_turning_on">Disabling wireless connections\u2026</string>
- <!-- Wireless controls settings screen, setting option summary text as airplane mode is being disabled (so it is re-enabling all the wireless conenctions) -->
- <string name="airplane_mode_turning_off">Enabling wireless connections\u2026</string>
<!-- Main Settings screen settings title for things like airplane mode, tethering, NFC, VPN. This will take you to another screen with those settings. -->
<string name="radio_controls_title">More\u2026</string>
<!-- Wireless Settings screen title for things like Wi-Fi, bluetooth, airplane mode. -->
@@ -1095,9 +1087,12 @@
<!-- NFC settings -->
<!-- Used in the 1st-level settings screen to turn on NFC -->
<string name="nfc_quick_toggle_title">NFC</string>
- <!-- Used in the 1st-level settings screen as the turn-on summary -->
- <string name="nfc_quick_toggle_summary">Use Near Field Communication to read and exchange tags</string>
- <string name="nfc_toggle_error" msgid="8998642457947607263">An error occurred.</string>
+ <!-- Used to enter the Zero-click sharing preferences screen -->
+ <string name="zeroclick_settings_title">Zero-click sharing</string>
+ <string name="zeroclick_settings_summary"></string>
+ <!-- Used in the zero-click sharing preferences screen -->
+ <string name="zeroclick_label">Zero-click sharing</string>
+ <string name="zeroclick_explained">Zero-click sharing allows you to share content from applications, just by tapping your NFC-enabled device to another.</string>
<!-- Wi-Fi Settings --> <skip />
<!-- Used in the 1st-level settings screen to turn on Wi-Fi -->
@@ -1772,6 +1767,12 @@
<string name="usb_label_installer_cd">Install Android File Transfer application for Mac</string>
<!-- Storage setting. Label for installer CD [CHAR LIMIT=30]-->
<string name="usb_label_installer_cd_done">Done installing Android File Transfer application for Mac</string>
+ <!-- Installer CD dialog title [CHAR LIMIT=30] -->
+ <string name="dlg_installer_cd_title">Android File Transfer app for Mac</string>
+ <!-- Installer CD dialog text [CHAR LIMIT=NONE] -->
+ <string name="dlg_installer_cd_text">Step 1:\nOn your Mac, double-click androidfiletransfer.msg\n\nStep 2:\nIn the Installer window, drag Android File Transfer to Applications.</string>
+ <!-- Installer CD dialog OK button text [CHAR LIMIT=NONE] -->
+ <string name="dlg_installer_cd_ok">Done following these steps</string>
<!-- Phone info screen, section titles: -->
<string name="battery_status_title">Battery status</string>
@@ -1939,32 +1940,6 @@
<!-- Tethering controls, item title to go into the tethering settings when USB, Bluetooth and Wifi tethering are available [CHAR LIMIT=25]-->
<string name="tether_settings_title_all">Tethering & portable hotspot</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings -->
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when only USB tethering is available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_usb" product="tablet">Share your tablet\'s mobile data connection via USB</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when only USB tethering is available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_usb" product="default">Share your phone\'s mobile data connection via USB</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when only Wifi tethering is available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_wifi">Share your mobile data connection as a portable Wi-Fi hotspot</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when only Bluetooth tethering is available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_bluetooth">Share your mobile data connection via Bluetooth</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when USB and Wifi tethering are available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_usb_wifi" product="tablet">Share your tablet\'s mobile data connection via USB or as a portable Wi-Fi hotspot</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when USB and Wifi tethering are available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_usb_wifi" product="default">Share your phone\'s mobile data connection via USB or as a portable Wi-Fi hotspot</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when USB and Bluetooth tethering are available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_usb_bluetooth" product="tablet">Share your tablet\'s mobile data connection via USB or Bluetooth</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when USB and Bluetooth tethering are available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_usb_bluetooth" product="default">Share your phone\'s mobile data connection via USB or Bluetooth</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when Bluetooth and Wifi tethering are available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_wifi_bluetooth" product="tablet">Share your tablet\'s mobile data connection via Bluetooth or as a portable Wi-Fi hotspot</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when Bluetooth and Wifi tethering are available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_wifi_bluetooth" product="default">Share your phone\'s mobile data connection via Bluetooth or as a portable Wi-Fi hotspot</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when USB, Wifi, and Bluetooth tethering are available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_all" product="tablet">Share your tablet\'s mobile data connection via USB, Wi-Fi, or Bluetooth</string>
- <!-- Tethering controls, the item summary for the user to go into the tethering settings when USB, Wifi, and Bluetooth tethering are available [CHAR LIMIT=100]-->
- <string name="tether_settings_summary_all" product="default">Share your phone\'s mobile data connection via USB, Wi-Fi, or Bluetooth</string>
-
<!-- USB Tethering options -->
<string name="usb_title">USB</string>
<string name="usb_tethering_button_text">USB tethering</string>
@@ -2008,14 +1983,8 @@
<!-- Tethering help button - calls up a web view with general tethering info -->
<string name="tethering_help_button_text">Help</string>
- <!-- Wireless controls, header for the general category (airplane mode, VPN, NFC, tethering...) [CHAR LIMIT=40]-->
- <string name="wireless_category_general">General</string>
- <!-- Wireless controls, header for the mobile networks category (4G/ network operator...) [CHAR LIMIT=40]-->
- <string name="wireless_category_mobile_networks">Mobile networks</string>
<!-- Wireless controls, item title to go into the network settings -->
<string name="network_settings_title">Mobile networks</string>
- <!-- Wireless controls, the item summary for the user to go into the network settings -->
- <string name="network_settings_summary">Set options for roaming, networks, APNs</string>
<!-- Security & location settings screen, section header for settings relating to location -->
<string name="location_title">My Location</string>
@@ -2383,6 +2352,11 @@
<string name="app_install_location_title">Preferred install location</string>
<!-- Manage applications. application installation location summary -->
<string name="app_install_location_summary">Change the preferred installation location for new applications.</string>
+ <!-- [CHAR LIMIT=30] Manage applications, title for dialog when disabling apps -->
+ <string name="app_disable_dlg_title">Disable built-in app</string>
+ <!-- [CHAR LIMIT=200] Manage applications, text for dialog when disabling apps -->
+ <string name="app_disable_dlg_text">Disabling a built-in application may cause other applications
+ to misbehave. Are you sure?</string>
<!-- [CHAR LIMIT=25] Services settings screen, setting option name for the user to go to the screen to view app storage use -->
<string name="storageuse_settings_title">Storage use</string>
@@ -2726,6 +2700,8 @@
<string name="accessibility_power_button_ends_call">Power button ends call</string>
<!-- Accessibility settings: power button behavior summary text -->
<string name="accessibility_power_button_ends_call_summary">During a call, pressing Power ends call instead of turning off screen</string>
+ <!-- Accessibility settings: touch exploration state -->
+ <string name="accessibility_touch_exploration_enabled">Touch exploration</string>
<!-- Accessibility settings: button for lauching settings for an accessibility service -->
<string name="settings_button">Settings</string>
@@ -3013,8 +2989,6 @@
<!-- Title of preference to enter the VPN settings activity -->
<string name="vpn_settings_title">VPN settings</string>
- <!-- Summary of preference to enter the VPN settings activity -->
- <string name="vpn_settings_summary">Set up & manage Virtual Private Networks (VPNs)</string>
<!-- Title of preference group for credential storage settings [CHAR LIMIT=30] -->
<string name="credentials_title">Credential storage</string>
@@ -3557,7 +3531,7 @@
<string name="trusted_credentials_remove_confirmation">Permanently remove the user CA certificate?</string>
<!-- Title for the touch exploration tutorial. [CHAR LIMIT=40] -->
- <string name="accessibility_tutorial_title">Touch exploration tutorial</string>
+ <string name="accessibility_tutorial_title">Talk As I Touch tutorial</string>
<!-- Button label to go to the next touch exploration tutorial lesson. [CHAR LIMIT=10] -->
<string name="accessibility_tutorial_next">Next</string>
<!-- Button label to go back to the previous touch explorationtutorial lesson. [CHAR LIMIT=10] -->
@@ -3568,31 +3542,31 @@
<string name="accessibility_tutorial_skip">Skip tutorial</string>
<!-- Title for touch exploration tutorial lesson 1. -->
- <string name="accessibility_tutorial_lesson_1_title">Exploring the screen</string>
+ <string name="accessibility_tutorial_lesson_1_title">Lesson 1: Exploring the screen</string>
<!-- Instruction for touch exploration tutorial lesson 1. -->
- <string name="accessibility_tutorial_lesson_1_text_1">When touch exploration is enabled, you can touch the screen to hear spoken descriptions of the content under your finger. The screen currently contains a list of application icons. Find one of them by placing a finger on the screen and sliding it around.</string>
+ <string name="accessibility_tutorial_lesson_1_text_1">After you turn on Talk As I Touch, you can touch the screen to hear a description of what’s under your finger. For example, the current screen contains application icons. Find one of them by touching the screen and sliding your finger around.</string>
<!-- Instruction for touch exploration tutorial lesson 1, displayed after the user touches one icon. -->
- <string name="accessibility_tutorial_lesson_1_text_2_more">Good, keep your finger on the screen and keep sliding around to find at least one more icon.</string>
+ <string name="accessibility_tutorial_lesson_1_text_2_more">Good. Keep sliding your finger around the screen until you find at least one more icon.</string>
<!-- Instruction for touch exploration tutorial lesson 1, displayed after the user touches a second icon. -->
- <string name="accessibility_tutorial_lesson_1_text_3">When you\'ve found a widget that you want to click on, you can tap once to activate it. Slide your finger to find the icon for <xliff:g id="app_name" example="Browser">%s</xliff:g>.</string>
+ <string name="accessibility_tutorial_lesson_1_text_3">To activate something that you’re touching, tap it. Slide your finger until you find the icon for the <xliff:g id="app_name" example="Browser">%s</xliff:g>. Then tap the icon once to activate it.</string>
<!-- Instruction for touch exploration tutorial lesson 1, displayed if the user touched the target area and stays inside it. -->
- <string name="accessibility_tutorial_lesson_1_text_4">Your finger is on top of the <xliff:g id="app_name" example="Browser">%s</xliff:g> icon. Tap once to activate the icon.</string>
+ <string name="accessibility_tutorial_lesson_1_text_4">Your finger is touching the <xliff:g id="app_name" example="Browser">%s</xliff:g> icon. Tap once to activate the icon.</string>
<!-- Instruction for touch exploration tutorial lesson 1, displayed if the user touches inside the target area but moves outside. -->
- <string name="accessibility_tutorial_lesson_1_text_4_exited">You\'ve entered and left the <xliff:g id="app_name" example="Browser">%s</xliff:g> icon. Slowly explore again to find the icon while keeping your finger on the screen.</string>
+ <string name="accessibility_tutorial_lesson_1_text_4_exited">Your finger moved over the <xliff:g id="app_name" example="Browser">%s</xliff:g> icon, and then moved away. Slowly slide your finger around the screen until you find the Browser icon again.</string>
<!-- Instruction for touch exploration tutorial lesson 1, displayed after the user has tapped the target icon. -->
- <string name="accessibility_tutorial_lesson_1_text_5">Good. To move to the next section, find and activate the button labeled \"<xliff:g id="next" example="Next">%s</xliff:g>\" that\'s located near the bottom-right of the screen.</string>
+ <string name="accessibility_tutorial_lesson_1_text_5">Good. To move to the next lesson, find and activate the "<xliff:g id="next" example="Next">%s</xliff:g> button," located near the bottom-right corner of the screen.</string>
<!-- Title for touch exploration tutorial lesson 2. -->
- <string name="accessibility_tutorial_lesson_2_title">Scrolling using two fingers</string>
+ <string name="accessibility_tutorial_lesson_2_title">Lesson 2: Scrolling using two fingers</string>
<!-- Instruction for touch exploration tutorial lesson 2. -->
- <string name="accessibility_tutorial_lesson_2_text_1">To perform single-finger gestures like scrolling, you can place two fingers on the screen. The screen currently contains a scrollable list of application names. First, try exploring a few of the list items using one finger.</string>
+ <string name="accessibility_tutorial_lesson_2_text_1">To scroll through a list, you can slide two fingers along the screen. For example, the current screen contains a list of application names that can scroll up or down. First, try to identify a few items in the list by sliding one finger around.</string>
<!-- Instruction for touch exploration tutorial lesson 2, displayed after the user touches one list item. -->
- <string name="accessibility_tutorial_lesson_2_text_2_more">Good, keep sliding your finger around to find at least one more list item.</string>
+ <string name="accessibility_tutorial_lesson_2_text_2_more">Good. Keep sliding your finger around to find at least one more item.</string>
<!-- Instruction for touch exploration tutorial lesson 2, displayed after the user touches a second list item. -->
- <string name="accessibility_tutorial_lesson_2_text_3">Now scroll through the list by placing two fingers on a list item and sliding your fingers up. If you reach the top of the screen, you can place your fingers back on the list and continue.</string>
+ <string name="accessibility_tutorial_lesson_2_text_3">Now place two fingers on an item in the list and slide both fingers up. If you reach the top of the screen, lift your fingers, place them lower on the list, and continue sliding up.</string>
<!-- Instruction for touch exploration tutorial lesson 2, displayed after the user scrolls a small amount. -->
- <string name="accessibility_tutorial_lesson_2_text_3_more">Good, keep sliding your fingers up to scroll some more.</string>
+ <string name="accessibility_tutorial_lesson_2_text_3_more">Good. Keep sliding your fingers up to scroll some more.</string>
<!-- Instruction for touch exploration tutorial lesson 2, displayed after the user has scrolled a large amount. -->
- <string name="accessibility_tutorial_lesson_2_text_4">You have completed the touch exploration tutorial. To exit, find and click the button labeled \"<xliff:g id="finish" example="Finish">%s</xliff:g>.\"</string>
+ <string name="accessibility_tutorial_lesson_2_text_4">You have completed the tutorial. To exit and return to the Talk As I Touch setting, find and tap the <xliff:g id="finish" example="Finish">%s</xliff:g> button.</string>
</resources>
diff --git a/res/xml/accessibility_settings.xml b/res/xml/accessibility_settings.xml
index 90aef84..feb5fb1 100644
--- a/res/xml/accessibility_settings.xml
+++ b/res/xml/accessibility_settings.xml
@@ -56,6 +56,10 @@
android:entries="@array/long_press_timeout_selector_titles"
android:entryValues="@array/long_press_timeout_selector_values"
android:defaultValue="@string/long_press_timeout_selector_default_value"/>
+ <CheckBoxPreference
+ android:key="touch_exploration_enabled"
+ android:title="@string/accessibility_touch_exploration_enabled"
+ android:persistent="false" />
</PreferenceCategory>
</PreferenceScreen>
diff --git a/res/xml/wireless_settings.xml b/res/xml/wireless_settings.xml
index 0488e02..c0e4a5a 100644
--- a/res/xml/wireless_settings.xml
+++ b/res/xml/wireless_settings.xml
@@ -17,43 +17,38 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/wireless_networks_settings_title">
- <PreferenceCategory
- android:title="@string/wireless_category_general" />
-
<CheckBoxPreference
android:key="toggle_airplane"
android:title="@string/airplane_mode"
- android:summary="@string/airplane_mode_summary"
android:persistent="false"
android:disableDependentsState="true" />
- <CheckBoxPreference
- android:key="toggle_nfc"
- android:title="@string/nfc_quick_toggle_title"
- android:summary="@string/nfc_quick_toggle_summary"
- android:persistent="false" />
-
<PreferenceScreen
android:fragment="com.android.settings.vpn2.VpnSettings"
android:key="vpn_settings"
- android:title="@string/vpn_settings_title"
- android:summary="@string/vpn_settings_summary" >
- </PreferenceScreen>
+ android:title="@string/vpn_settings_title" />
<PreferenceScreen
android:fragment="com.android.settings.TetherSettings"
android:key="tether_settings"
- android:title="@string/tether_settings_title_all"
- android:summary="@string/tether_settings_summary_all">
+ android:title="@string/tether_settings_title_all" />
+
+ <CheckBoxPreference
+ android:key="toggle_nfc"
+ android:title="@string/nfc_quick_toggle_title"
+ android:persistent="false" />
+
+ <PreferenceScreen
+ android:fragment="com.android.settings.nfc.ZeroClick"
+ android:key="zeroclick_settings"
+ android:title="@string/zeroclick_settings_title"
+ android:summary="@string/zeroclick_settings_summary" >
</PreferenceScreen>
- <PreferenceCategory
- android:title="@string/wireless_category_mobile_networks" />
<PreferenceScreen
android:key="mobile_network_settings"
android:title="@string/network_settings_title"
- android:summary="@string/network_settings_summary"
android:dependency="toggle_airplane">
<intent
android:action="android.intent.action.MAIN"
@@ -64,8 +59,6 @@
<PreferenceScreen
android:fragment="com.android.settings.ProxySelector"
android:key="proxy_settings"
- android:title="@string/proxy_settings_title"
- android:summary="@string/proxy_settings_summary" >
- </PreferenceScreen>
+ android:title="@string/proxy_settings_title" />
</PreferenceScreen>
diff --git a/src/com/android/settings/AccessibilitySettings.java b/src/com/android/settings/AccessibilitySettings.java
index 06fc5d6..578268d 100644
--- a/src/com/android/settings/AccessibilitySettings.java
+++ b/src/com/android/settings/AccessibilitySettings.java
@@ -75,6 +75,9 @@
private static final String POWER_BUTTON_ENDS_CALL_CHECKBOX =
"power_button_ends_call";
+ private static final String TOUCH_EXPLORATION_ENABLED_CHECKBOX =
+ "touch_exploration_enabled";
+
private static final String KEY_TOGGLE_ACCESSIBILITY_SERVICE_CHECKBOX =
"key_toggle_accessibility_service_checkbox";
@@ -93,6 +96,7 @@
private PreferenceCategory mPowerButtonCategory;
private CheckBoxPreference mPowerButtonEndsCallCheckBox;
+ private CheckBoxPreference mTouchExplorationEnabledCheckBox;
private PreferenceGroup mAccessibilityServicesCategory;
@@ -128,6 +132,9 @@
mPowerButtonEndsCallCheckBox = (CheckBoxPreference) findPreference(
POWER_BUTTON_ENDS_CALL_CHECKBOX);
+ mTouchExplorationEnabledCheckBox = (CheckBoxPreference) findPreference(
+ TOUCH_EXPLORATION_ENABLED_CHECKBOX);
+
mLongPressTimeoutListPreference = (ListPreference) findPreference(
KEY_LONG_PRESS_TIMEOUT_LIST_PREFERENCE);
@@ -155,6 +162,10 @@
getPreferenceScreen().removePreference(mPowerButtonCategory);
}
+ boolean touchExplorationEnabled = (Settings.Secure.getInt(getContentResolver(),
+ Settings.Secure.TOUCH_EXPLORATION_REQUESTED, 0) == 1);
+ mTouchExplorationEnabledCheckBox.setChecked(touchExplorationEnabled);
+
mLongPressTimeoutListPreference.setOnPreferenceChangeListener(this);
}
@@ -284,7 +295,7 @@
try {
mCurConfig.fontScale = mToggleLargeTextCheckBox.isChecked()
? LARGE_FONT_SCALE : 1;
- ActivityManagerNative.getDefault().updateConfiguration(mCurConfig);
+ ActivityManagerNative.getDefault().updatePersistentConfiguration(mCurConfig);
} catch (RemoteException e) {
}
} else if (POWER_BUTTON_ENDS_CALL_CHECKBOX.equals(key)) {
@@ -296,6 +307,10 @@
Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR,
(isChecked ? Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_HANGUP
: Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF));
+ } else if (TOUCH_EXPLORATION_ENABLED_CHECKBOX.equals(key)) {
+ final int touchExplorationState = ((CheckBoxPreference) preference).isChecked() ? 1 : 0;
+ Settings.Secure.putInt(getContentResolver(),
+ Settings.Secure.TOUCH_EXPLORATION_REQUESTED, touchExplorationState);
} else if (TOGGLE_ACCESSIBILITY_SCRIPT_INJECTION_CHECKBOX.equals(key)) {
handleToggleAccessibilityScriptInjection((CheckBoxPreference) preference);
} else if (preference instanceof CheckBoxPreference) {
diff --git a/src/com/android/settings/AirplaneModeEnabler.java b/src/com/android/settings/AirplaneModeEnabler.java
index 00c416f..94ba5a1 100644
--- a/src/com/android/settings/AirplaneModeEnabler.java
+++ b/src/com/android/settings/AirplaneModeEnabler.java
@@ -16,8 +16,6 @@
package com.android.settings;
-import com.android.internal.telephony.PhoneStateIntentReceiver;
-
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
@@ -27,8 +25,8 @@
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.provider.Settings;
-import android.telephony.ServiceState;
+import com.android.internal.telephony.PhoneStateIntentReceiver;
import com.android.internal.telephony.TelephonyProperties;
public class AirplaneModeEnabler implements Preference.OnPreferenceChangeListener {
@@ -93,10 +91,6 @@
}
private void setAirplaneModeOn(boolean enabling) {
-
- mCheckBoxPref.setSummary(enabling ? R.string.airplane_mode_turning_on
- : R.string.airplane_mode_turning_off);
-
// Change the system setting
Settings.System.putInt(mContext.getContentResolver(), Settings.System.AIRPLANE_MODE_ON,
enabling ? 1 : 0);
@@ -118,10 +112,7 @@
* - mobile does not send failure notification, fail on timeout.
*/
private void onAirplaneModeChanged() {
- boolean airplaneModeEnabled = isAirplaneModeOn(mContext);
mCheckBoxPref.setChecked(isAirplaneModeOn(mContext));
- mCheckBoxPref.setSummary(airplaneModeEnabled ? null :
- mContext.getString(R.string.airplane_mode_summary));
}
/**
diff --git a/src/com/android/settings/Display.java b/src/com/android/settings/Display.java
index f90e0f0..fa29318 100644
--- a/src/com/android/settings/Display.java
+++ b/src/com/android/settings/Display.java
@@ -105,7 +105,7 @@
public void onClick(View v) {
try {
- ActivityManagerNative.getDefault().updateConfiguration(mCurConfig);
+ ActivityManagerNative.getDefault().updatePersistentConfiguration(mCurConfig);
} catch (RemoteException e) {
}
finish();
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index 6ab88d0..ae7a4ef 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -203,7 +203,7 @@
public void writeFontSizePreference(Object objValue) {
try {
mCurConfig.fontScale = Float.parseFloat(objValue.toString());
- ActivityManagerNative.getDefault().updateConfiguration(mCurConfig);
+ ActivityManagerNative.getDefault().updatePersistentConfiguration(mCurConfig);
} catch (RemoteException e) {
Log.w(TAG, "Unable to save font size");
}
diff --git a/src/com/android/settings/RingerVolumePreference.java b/src/com/android/settings/RingerVolumePreference.java
index b546265..f850b08 100644
--- a/src/com/android/settings/RingerVolumePreference.java
+++ b/src/com/android/settings/RingerVolumePreference.java
@@ -171,12 +171,15 @@
mNotificationsUseRingVolumeCheckbox =
(CheckBox) view.findViewById(R.id.same_notification_volume);
mNotificationsUseRingVolumeCheckbox.setOnCheckedChangeListener(this);
- mNotificationsUseRingVolumeCheckbox.setChecked(
- Utils.isVoiceCapable(getContext())
- && Settings.System.getInt(
+ mNotificationsUseRingVolumeCheckbox.setChecked(Settings.System.getInt(
getContext().getContentResolver(),
Settings.System.NOTIFICATIONS_USE_RING_VOLUME, 1) == 1);
- setNotificationVolumeVisibility(!mNotificationsUseRingVolumeCheckbox.isChecked());
+ // Notification volume always visible for non voice capable devices
+ if (Utils.isVoiceCapable(getContext())) {
+ setNotificationVolumeVisibility(!mNotificationsUseRingVolumeCheckbox.isChecked());
+ } else {
+ setNotificationVolumeVisibility(true);
+ }
disableSettingsThatNeedVoice(view);
// Register callbacks for mute/unmute buttons
@@ -240,16 +243,19 @@
}
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- setNotificationVolumeVisibility(!isChecked);
+ // ignore R.id.same_notification_volume checkbox for non voice capable devices
+ if (Utils.isVoiceCapable(getContext())) {
+ setNotificationVolumeVisibility(!isChecked);
- Settings.System.putInt(getContext().getContentResolver(),
- Settings.System.NOTIFICATIONS_USE_RING_VOLUME, isChecked ? 1 : 0);
+ Settings.System.putInt(getContext().getContentResolver(),
+ Settings.System.NOTIFICATIONS_USE_RING_VOLUME, isChecked ? 1 : 0);
- if (isChecked) {
- // The user wants the notification to be same as ring, so do a
- // one-time sync right now
- mAudioManager.setStreamVolume(AudioManager.STREAM_NOTIFICATION,
- mAudioManager.getStreamVolume(AudioManager.STREAM_RING), 0);
+ if (isChecked) {
+ // The user wants the notification to be same as ring, so do a
+ // one-time sync right now
+ mAudioManager.setStreamVolume(AudioManager.STREAM_NOTIFICATION,
+ mAudioManager.getStreamVolume(AudioManager.STREAM_RING), 0);
+ }
}
}
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 057e5de..9a83311 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -237,7 +237,7 @@
private void updateLockAfterPreferenceSummary() {
// Update summary message with current value
long currentTimeout = Settings.Secure.getLong(getContentResolver(),
- Settings.Secure.LOCK_SCREEN_LOCK_AFTER_TIMEOUT, 0);
+ Settings.Secure.LOCK_SCREEN_LOCK_AFTER_TIMEOUT, 5000);
final CharSequence[] entries = mLockAfter.getEntries();
final CharSequence[] values = mLockAfter.getEntryValues();
int best = 0;
diff --git a/src/com/android/settings/UserDictionarySettings.java b/src/com/android/settings/UserDictionarySettings.java
index e5002c9..3b61064 100644
--- a/src/com/android/settings/UserDictionarySettings.java
+++ b/src/com/android/settings/UserDictionarySettings.java
@@ -223,6 +223,7 @@
}
private String getWord(int position) {
+ if (null == mCursor) return null;
mCursor.moveToPosition(position);
// Handle a possible race-condition
if (mCursor.isAfterLast()) return null;
@@ -298,7 +299,7 @@
FREQUENCY_FOR_USER_DICTIONARY_ADDS, UserDictionary.Words.LOCALE_TYPE_CURRENT);
Locale.setDefault(prevLocale);
}
- if (!mCursor.requery()) {
+ if (null != mCursor && !mCursor.requery()) {
throw new IllegalStateException("can't requery on already-closed cursor.");
}
mAddedWordAlready = true;
@@ -333,23 +334,25 @@
super(context, layout, c, from, to);
mSettings = settings;
- 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);
+ if (null != c) {
+ final String alphabet = context.getString(
+ com.android.internal.R.string.fast_scroll_alphabet);
+ final int wordColIndex = c.getColumnIndexOrThrow(UserDictionary.Words.WORD);
+ mIndexer = new AlphabetIndexer(c, wordColIndex, alphabet);
+ }
setViewBinder(mViewBinder);
}
public int getPositionForSection(int section) {
- return mIndexer.getPositionForSection(section);
+ return null == mIndexer ? 0 : mIndexer.getPositionForSection(section);
}
public int getSectionForPosition(int position) {
- return mIndexer.getSectionForPosition(position);
+ return null == mIndexer ? 0 : mIndexer.getSectionForPosition(position);
}
public Object[] getSections() {
- return mIndexer.getSections();
+ return null == mIndexer ? null : mIndexer.getSections();
}
public void onClick(View v) {
diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java
index d09fcc5..c07388e 100644
--- a/src/com/android/settings/WirelessSettings.java
+++ b/src/com/android/settings/WirelessSettings.java
@@ -37,6 +37,7 @@
private static final String KEY_TOGGLE_AIRPLANE = "toggle_airplane";
private static final String KEY_TOGGLE_NFC = "toggle_nfc";
+ private static final String KEY_ZEROCLICK_SETTINGS = "zeroclick_settings";
private static final String KEY_VPN_SETTINGS = "vpn_settings";
private static final String KEY_TETHER_SETTINGS = "tether_settings";
private static final String KEY_PROXY_SETTINGS = "proxy_settings";
@@ -87,9 +88,11 @@
final Activity activity = getActivity();
mAirplaneModePreference = (CheckBoxPreference) findPreference(KEY_TOGGLE_AIRPLANE);
CheckBoxPreference nfc = (CheckBoxPreference) findPreference(KEY_TOGGLE_NFC);
+ PreferenceScreen zeroclick = (PreferenceScreen)
+ findPreference(KEY_ZEROCLICK_SETTINGS);
mAirplaneModeEnabler = new AirplaneModeEnabler(activity, mAirplaneModePreference);
- mNfcEnabler = new NfcEnabler(activity, nfc);
+ mNfcEnabler = new NfcEnabler(activity, nfc, zeroclick);
String toggleable = Settings.System.getString(activity.getContentResolver(),
Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
@@ -107,6 +110,7 @@
// Remove NFC if its not available
if (NfcAdapter.getDefaultAdapter(activity) == null) {
getPreferenceScreen().removePreference(nfc);
+ getPreferenceScreen().removePreference(zeroclick);
}
// Remove Mobile Network Settings if it's a wifi-only device.
@@ -139,25 +143,18 @@
Preference p = findPreference(KEY_TETHER_SETTINGS);
if (wifiAvailable && usbAvailable && bluetoothAvailable) {
p.setTitle(R.string.tether_settings_title_all);
- p.setSummary(R.string.tether_settings_summary_all);
} else if (wifiAvailable && usbAvailable) {
p.setTitle(R.string.tether_settings_title_all);
- p.setSummary(R.string.tether_settings_summary_usb_wifi);
} else if (wifiAvailable && bluetoothAvailable) {
p.setTitle(R.string.tether_settings_title_all);
- p.setSummary(R.string.tether_settings_summary_wifi_bluetooth);
} else if (wifiAvailable) {
p.setTitle(R.string.tether_settings_title_wifi);
- p.setSummary(R.string.tether_settings_summary_wifi);
} else if (usbAvailable && bluetoothAvailable) {
p.setTitle(R.string.tether_settings_title_usb_bluetooth);
- p.setSummary(R.string.tether_settings_summary_usb_bluetooth);
} else if (usbAvailable) {
p.setTitle(R.string.tether_settings_title_usb);
- p.setSummary(R.string.tether_settings_summary_usb);
} else {
p.setTitle(R.string.tether_settings_title_bluetooth);
- p.setSummary(R.string.tether_settings_summary_bluetooth);
}
}
}
diff --git a/src/com/android/settings/accounts/AddAccountSettings.java b/src/com/android/settings/accounts/AddAccountSettings.java
index 72ef130..382481e 100644
--- a/src/com/android/settings/accounts/AddAccountSettings.java
+++ b/src/com/android/settings/accounts/AddAccountSettings.java
@@ -22,6 +22,7 @@
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.app.Activity;
+import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
@@ -44,18 +45,37 @@
* when returning from each account setup, which doesn't look good.
*/
public class AddAccountSettings extends Activity {
+ /**
+ *
+ */
+ private static final String KEY_ADD_CALLED = "AddAccountCalled";
+
+ /**
+ * Extra parameter to identify the caller. Applications may display a
+ * different UI if the calls is made from Settings or from a specific
+ * application.
+ */
+ private static final String KEY_CALLER_IDENTITY = "pendingIntent";
+
private static final String TAG = "AccountSettings";
/* package */ static final String EXTRA_SELECTED_ACCOUNT = "selected_account";
private static final int CHOOSE_ACCOUNT_REQUEST = 1;
+ private PendingIntent mPendingIntent;
+
private AccountManagerCallback<Bundle> mCallback = new AccountManagerCallback<Bundle>() {
public void run(AccountManagerFuture<Bundle> future) {
try {
Bundle bundle = future.getResult();
bundle.keySet();
setResult(RESULT_OK);
+
+ if (mPendingIntent != null) {
+ mPendingIntent.cancel();
+ }
+
if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "account added: " + bundle);
} catch (OperationCanceledException e) {
if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "addAccount was canceled");
@@ -69,10 +89,22 @@
}
};
+ private boolean mAddAccountCalled = false;
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ if (savedInstanceState != null) {
+ mAddAccountCalled = savedInstanceState.getBoolean(KEY_ADD_CALLED);
+ if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "restored");
+ }
+
+ if (mAddAccountCalled) {
+ // We already called add account - maybe the callback was lost.
+ finish();
+ return;
+ }
final String[] authorities =
getIntent().getStringArrayExtra(AccountPreferenceBase.AUTHORITIES_FILTER_KEY);
final String[] accountTypes =
@@ -102,14 +134,24 @@
}
}
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putBoolean(KEY_ADD_CALLED, mAddAccountCalled);
+ if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "saved");
+ }
+
private void addAccount(String accountType) {
+ Bundle addAccountOptions = new Bundle();
+ mPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(), 0);
+ addAccountOptions.putParcelable(KEY_CALLER_IDENTITY, mPendingIntent);
AccountManager.get(this).addAccount(
accountType,
null, /* authTokenType */
null, /* requiredFeatures */
- null, /* addAccountOptions */
+ addAccountOptions,
this,
mCallback,
null /* handler */);
+ mAddAccountCalled = true;
}
}
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index ab46661..a84b8bb 100644
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -147,6 +147,7 @@
private static final int DLG_CANNOT_CLEAR_DATA = DLG_BASE + 4;
private static final int DLG_FORCE_STOP = DLG_BASE + 5;
private static final int DLG_MOVE_FAILED = DLG_BASE + 6;
+ private static final int DLG_DISABLE = DLG_BASE + 7;
private Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
@@ -754,6 +755,22 @@
.setMessage(msg)
.setNeutralButton(R.string.dlg_ok, null)
.create();
+ case DLG_DISABLE:
+ return new AlertDialog.Builder(getActivity())
+ .setTitle(getActivity().getText(R.string.app_disable_dlg_title))
+ .setIcon(android.R.drawable.ic_dialog_alert)
+ .setMessage(getActivity().getText(R.string.app_disable_dlg_text))
+ .setPositiveButton(R.string.dlg_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ // Disable the app
+ new DisableChanger(getOwner(), getOwner().mAppEntry.info,
+ PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER)
+ .execute((Object)null);
+ }
+ })
+ .setNegativeButton(R.string.dlg_cancel, null)
+ .create();
}
throw new IllegalArgumentException("unknown id " + id);
}
@@ -837,9 +854,13 @@
showDialogInner(DLG_FACTORY_RESET, 0);
} else {
if ((mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
- new DisableChanger(this, mAppEntry.info, mAppEntry.info.enabled ?
- PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER
- : PackageManager.COMPONENT_ENABLED_STATE_DEFAULT).execute((Object)null);
+ if (mAppEntry.info.enabled) {
+ showDialogInner(DLG_DISABLE, 0);
+ } else {
+ new DisableChanger(this, mAppEntry.info,
+ PackageManager.COMPONENT_ENABLED_STATE_DEFAULT)
+ .execute((Object)null);
+ }
} else {
uninstallPkg(packageName);
}
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
old mode 100644
new mode 100755
index 1ec8ff2..1cdd41a
--- a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
@@ -297,8 +297,8 @@
}
public void afterTextChanged(Editable s) {
- if (s.length() > 0) {
- mOkButton.setEnabled(true);
+ if (mOkButton != null) {
+ mOkButton.setEnabled(s.length() > 0);
}
}
diff --git a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
old mode 100644
new mode 100755
index ecb7112..cee2a53
--- a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
+++ b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
@@ -30,7 +30,11 @@
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
-
+import android.widget.EditText;
+import android.text.TextWatcher;
+import android.app.Dialog;
+import android.widget.Button;
+import android.text.Editable;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -53,7 +57,7 @@
//private static final String KEY_ALLOW_INCOMING = "allow_incoming";
public static final String EXTRA_DEVICE = "device";
-
+ private RenameEditTextPreference mRenameDeviceNamePref;
private LocalBluetoothManager mManager;
private CachedBluetoothDevice mCachedDevice;
private LocalBluetoothProfileManager mProfileManager;
@@ -65,7 +69,24 @@
= new HashMap<LocalBluetoothProfile, CheckBoxPreference>();
private AlertDialog mDisconnectDialog;
+ private class RenameEditTextPreference implements TextWatcher{
+ public void afterTextChanged(Editable s) {
+ Dialog d = mDeviceNamePref.getDialog();
+ if (d instanceof AlertDialog) {
+ ((AlertDialog) d).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(s.length() > 0);
+ }
+ }
+ // TextWatcher interface
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ // not used
+ }
+
+ // TextWatcher interface
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ // not used
+ }
+ }
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -88,7 +109,7 @@
finish();
return; // TODO: test this failure path
}
-
+ mRenameDeviceNamePref = new RenameEditTextPreference();
mManager = LocalBluetoothManager.getInstance(getActivity());
CachedBluetoothDeviceManager deviceManager =
mManager.getCachedDeviceManager();
@@ -135,8 +156,18 @@
mManager.setForegroundActivity(getActivity());
mCachedDevice.registerCallback(this);
-
+ if(mCachedDevice.getBondState() == BluetoothDevice.BOND_NONE)
+ finish();
refresh();
+ EditText et = mDeviceNamePref.getEditText();
+ if (et != null) {
+ et.addTextChangedListener(mRenameDeviceNamePref);
+ Dialog d = mDeviceNamePref.getDialog();
+ if (d instanceof AlertDialog) {
+ Button b = ((AlertDialog) d).getButton(AlertDialog.BUTTON_POSITIVE);
+ b.setEnabled(et.getText().length() > 0);
+ }
+ }
}
@Override
@@ -171,7 +202,7 @@
pref.setOrder(getProfilePreferenceIndex(profile.getOrdinal()));
pref.setOnExpandClickListener(this);
- int iconResource = profile.getDrawableResource(null); // FIXME: get BT class for this?
+ int iconResource = profile.getDrawableResource(mCachedDevice.getBtClass());
if (iconResource != 0) {
pref.setProfileDrawable(getResources().getDrawable(iconResource));
}
diff --git a/src/com/android/settings/deviceinfo/UsbSettings.java b/src/com/android/settings/deviceinfo/UsbSettings.java
index ca6a0cc..4820234 100644
--- a/src/com/android/settings/deviceinfo/UsbSettings.java
+++ b/src/com/android/settings/deviceinfo/UsbSettings.java
@@ -16,10 +16,13 @@
package com.android.settings.deviceinfo;
+import android.app.AlertDialog;
+import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.ContentQueryMap;
import android.content.ContentResolver;
import android.content.Context;
+import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.usb.UsbManager;
@@ -52,6 +55,8 @@
private static final String KEY_INSTALLER_CD = "usb_installer_cd";
private static final int MENU_ID_INSTALLER_CD = Menu.FIRST;
+ private static final int DLG_INSTALLER_CD = 1;
+
private UsbManager mUsbManager;
private String mInstallerImagePath;
private CheckBoxPreference mMtp;
@@ -60,6 +65,9 @@
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
public void onReceive(Context content, Intent intent) {
+ if (!intent.getBooleanExtra(UsbManager.USB_CONNECTED, false)) {
+ removeDialog(DLG_INSTALLER_CD);
+ }
updateToggles();
}
};
@@ -108,6 +116,24 @@
new IntentFilter(UsbManager.ACTION_USB_STATE));
}
+ @Override
+ public Dialog onCreateDialog(int id) {
+ switch (id) {
+ case DLG_INSTALLER_CD:
+ return new AlertDialog.Builder(getActivity())
+ .setTitle(R.string.dlg_installer_cd_title)
+ .setMessage(R.string.dlg_installer_cd_text)
+ .setPositiveButton(R.string.dlg_installer_cd_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ // Disable installer CD, return to default function.
+ mUsbManager.setCurrentFunction(null, false);
+ }})
+ .create();
+ }
+ return null;
+ }
+
private void updateToggles() {
if (mUsbManager.isFunctionEnabled(UsbManager.USB_FUNCTION_MTP)) {
mMtp.setChecked(true);
@@ -164,10 +190,12 @@
if (mUsbManager.isFunctionEnabled(UsbManager.USB_FUNCTION_MASS_STORAGE)) {
// Disable installer CD, return to default function.
mUsbManager.setCurrentFunction(null, false);
+ removeDialog(DLG_INSTALLER_CD);
} else {
// Enable installer CD. Don't set as default function.
mUsbManager.setCurrentFunction(UsbManager.USB_FUNCTION_MASS_STORAGE, false);
mUsbManager.setMassStorageBackingFile(mInstallerImagePath);
+ showDialog(DLG_INSTALLER_CD);
}
updateToggles();
return true;
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
index 4ccebf0..e966ec7 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
@@ -126,7 +126,12 @@
private void updateUserDictionaryPreference(Preference userDictionaryPreference) {
final Activity activity = getActivity();
final Set<String> localeList = UserDictionaryList.getUserDictionaryLocalesList(activity);
- if (localeList.size() <= 1) {
+ if (null == localeList) {
+ // The locale list is null if and only if the user dictionary service is
+ // not present or disabled. In this case we need to remove the preference.
+ ((PreferenceGroup)findPreference("language_settings_category")).removePreference(
+ userDictionaryPreference);
+ } else if (localeList.size() <= 1) {
userDictionaryPreference.setTitle(R.string.user_dict_single_settings_title);
userDictionaryPreference.setFragment(UserDictionarySettings.class.getName());
// If the size of localeList is 0, we don't set the locale parameter in the
diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
index 43d54a2..b5353d6 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
@@ -22,6 +22,7 @@
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
+import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.os.Bundle;
@@ -56,19 +57,29 @@
Configuration config = getResources().getConfiguration();
mHaveHardKeyboard = (config.keyboard == Configuration.KEYBOARD_QWERTY);
+ final Bundle arguments = getArguments();
// Input method id should be available from an Intent when this preference is launched as a
// single Activity (see InputMethodAndSubtypeEnablerActivity). It should be available
// from a preference argument when the preference is launched as a part of the other
// Activity (like a right pane of 2-pane Settings app)
mInputMethodId = getActivity().getIntent().getStringExtra(
android.provider.Settings.EXTRA_INPUT_METHOD_ID);
- if (mInputMethodId == null && (getArguments() != null)) {
+ if (mInputMethodId == null && (arguments != null)) {
final String inputMethodId =
- getArguments().getString(android.provider.Settings.EXTRA_INPUT_METHOD_ID);
+ arguments.getString(android.provider.Settings.EXTRA_INPUT_METHOD_ID);
if (inputMethodId != null) {
mInputMethodId = inputMethodId;
}
}
+ CharSequence title = getActivity().getIntent().getStringExtra(
+ Intent.EXTRA_TITLE);
+ if (title == null && (arguments != null)) {
+ title = arguments.getString(Intent.EXTRA_TITLE);
+ }
+
+ if (!TextUtils.isEmpty(title)) {
+ getActivity().setTitle(title);
+ }
onCreateIMM();
setPreferenceScreen(createPreferenceHierarchy());
diff --git a/src/com/android/settings/inputmethod/UserDictionaryList.java b/src/com/android/settings/inputmethod/UserDictionaryList.java
index 5db2841..e0afe48 100644
--- a/src/com/android/settings/inputmethod/UserDictionaryList.java
+++ b/src/com/android/settings/inputmethod/UserDictionaryList.java
@@ -49,7 +49,10 @@
new String[] { UserDictionary.Words.LOCALE },
null, null, null);
final Set<String> localeList = new TreeSet<String>();
- if (cursor.moveToFirst()) {
+ if (null == cursor) {
+ // The user dictionary service is not present or disabled. Return null.
+ return null;
+ } else if (cursor.moveToFirst()) {
final int columnIndex = cursor.getColumnIndex(UserDictionary.Words.LOCALE);
do {
String locale = cursor.getString(columnIndex);
diff --git a/src/com/android/settings/nfc/NfcEnabler.java b/src/com/android/settings/nfc/NfcEnabler.java
index d1cec13..99cf8f0 100644
--- a/src/com/android/settings/nfc/NfcEnabler.java
+++ b/src/com/android/settings/nfc/NfcEnabler.java
@@ -16,8 +16,6 @@
package com.android.settings.nfc;
-import com.android.settings.R;
-
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -26,7 +24,7 @@
import android.os.Handler;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
-import android.provider.Settings;
+import android.preference.PreferenceScreen;
import android.util.Log;
/**
@@ -39,6 +37,7 @@
private final Context mContext;
private final CheckBoxPreference mCheckbox;
+ private final PreferenceScreen mZeroClick;
private final NfcAdapter mNfcAdapter;
private final IntentFilter mIntentFilter;
private final Handler mHandler = new Handler();
@@ -57,9 +56,11 @@
private boolean mNfcState;
- public NfcEnabler(Context context, CheckBoxPreference checkBoxPreference) {
+ public NfcEnabler(Context context, CheckBoxPreference checkBoxPreference,
+ PreferenceScreen zeroclick) {
mContext = context;
mCheckbox = checkBoxPreference;
+ mZeroClick = zeroclick;
mNfcAdapter = NfcAdapter.getDefaultAdapter(context);
if (mNfcAdapter == null) {
@@ -98,6 +99,7 @@
// Start async update of the NFC adapter state, as the API is
// unfortunately blocking...
new Thread("toggleNFC") {
+ @Override
public void run() {
Log.d(TAG, "Setting NFC enabled state to: " + desiredState);
boolean success = false;
@@ -118,7 +120,6 @@
mHandler.post(new Runnable() {
public void run() {
mCheckbox.setEnabled(true);
- mCheckbox.setSummary(R.string.nfc_toggle_error);
}
});
}
@@ -130,6 +131,6 @@
private void handleNfcStateChanged(boolean newState) {
mCheckbox.setChecked(newState);
mCheckbox.setEnabled(true);
- mCheckbox.setSummary(R.string.nfc_quick_toggle_summary);
+ mZeroClick.setEnabled(newState);
}
}
diff --git a/src/com/android/settings/nfc/ZeroClick.java b/src/com/android/settings/nfc/ZeroClick.java
new file mode 100644
index 0000000..7868662
--- /dev/null
+++ b/src/com/android/settings/nfc/ZeroClick.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+package com.android.settings.nfc;
+
+import android.app.Fragment;
+import android.content.ContentResolver;
+import android.nfc.NfcAdapter;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.Preference;
+import android.provider.Settings;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.EditText;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.util.Log;
+import com.android.settings.R;
+
+public class ZeroClick extends Fragment
+ implements CompoundButton.OnCheckedChangeListener {
+ private View mView;
+ private CheckBox mCheckbox;
+ private NfcAdapter mNfcAdapter;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ mView = inflater.inflate(R.layout.zeroclick, container, false);
+ initView(mView);
+ return mView;
+ }
+
+ private void initView(View view) {
+ mCheckbox = (CheckBox) mView.findViewById(R.id.zeroclick_checkbox);
+ mCheckbox.setOnCheckedChangeListener(this);
+ mNfcAdapter = NfcAdapter.getDefaultAdapter(getActivity());
+ mCheckbox.setChecked(mNfcAdapter.zeroClickEnabled());
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ }
+
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean desiredState) {
+ boolean success = false;
+ mCheckbox.setEnabled(false);
+ if (desiredState) {
+ success = mNfcAdapter.enableZeroClick();
+ } else {
+ success = mNfcAdapter.disableZeroClick();
+ }
+ if (success) {
+ mCheckbox.setChecked(desiredState);
+ }
+ mCheckbox.setEnabled(true);
+ }
+}
diff --git a/tests/res/drawable/ic_settings_applications.png b/tests/res/drawable-hdpi/ic_settings_applications.png
similarity index 100%
rename from tests/res/drawable/ic_settings_applications.png
rename to tests/res/drawable-hdpi/ic_settings_applications.png
Binary files differ
diff --git a/tests/res/drawable-mdpi/ic_settings_applications.png b/tests/res/drawable-mdpi/ic_settings_applications.png
new file mode 100755
index 0000000..745ff2a
--- /dev/null
+++ b/tests/res/drawable-mdpi/ic_settings_applications.png
Binary files differ