Merge "wifi: update text displayed during hotspot on/off"
diff --git a/res/layout/data_usage_bytes_editor.xml b/res/layout/data_usage_bytes_editor.xml
index 6207391b..ec6e64f 100644
--- a/res/layout/data_usage_bytes_editor.xml
+++ b/res/layout/data_usage_bytes_editor.xml
@@ -22,7 +22,8 @@
 
     <NumberPicker
         android:id="@+id/bytes"
-        android:layout_width="48dip"
+        android:layout_width="wrap_content"
+        android:minWidth="48dip"
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical"
         android:layout_marginLeft="16dip"
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 434b9fc..653ad92 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -148,7 +148,7 @@
     <string name="bluetooth_ask_enablement_and_discovery" product="default" msgid="3040361003987241057">"Eine App auf Ihrem Telefon versucht, Bluetooth zu aktivieren und Ihr Telefon für <xliff:g id="TIMEOUT">%1$d</xliff:g> Sekunden für andere Telefone sichtbar zu machen. Möchten Sie dies zulassen?"</string>
     <string name="bluetooth_ask_enablement_and_lasting_discovery" product="tablet" msgid="7254712987802497615">"Eine App auf Ihrem Tablet versucht, Bluetooth zu aktivieren und Ihr Tablet für andere Geräte erkennbar zu machen. Zulassen?"</string>
     <string name="bluetooth_ask_enablement_and_lasting_discovery" product="default" msgid="3947789545028519103">"Eine App auf Ihrem Telefon versucht, Bluetooth zu aktivieren und Ihr Telefon für andere Geräte sichtbar zu machen. Möchten Sie dies zulassen?"</string>
-    <string name="bluetooth_turning_on" msgid="4850574877288036646">"Bluetooth aktivieren?"</string>
+    <string name="bluetooth_turning_on" msgid="4850574877288036646">"Bluetooth wird aktiviert..."</string>
     <string name="bluetooth_turning_off" msgid="2337747302892025192">"Bluetooth wird deaktiviert..."</string>
     <string name="bluetooth_auto_connect" msgid="40711424456733571">"Automatische Verbindung"</string>
     <string name="bluetooth_connection_permission_request" msgid="4747918249032890077">"Bluetooth-Verbindungsanfrage"</string>
@@ -492,7 +492,7 @@
     <string name="wifi_settings_category" msgid="2810363951104753710">"WLAN-Einstellungen"</string>
     <string name="wifi_settings_title" msgid="4351120897298124250">"WLAN"</string>
     <string name="wifi_settings_summary" msgid="668767638556052820">"WLAN-Zugangspunkte festlegen und verwalten"</string>
-    <string name="wifi_starting" msgid="6716593470710880000">"WLAN aktivieren?"</string>
+    <string name="wifi_starting" msgid="6716593470710880000">"WLAN wird aktiviert..."</string>
     <string name="wifi_stopping" msgid="244864762599017659">"WLAN wird deaktiviert..."</string>
     <string name="wifi_error" msgid="3207971103917128179">"Fehler"</string>
     <string name="wifi_in_airplane_mode" msgid="8652520421778203796">"Im Flugmodus"</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index a95d75d..cace7e5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -859,7 +859,7 @@
     <!-- Hint shown in dialog screen when password is too short -->
     <string name="lockpassword_password_too_short">Password must be at least %d characters</string>
     <!-- Hint shown in dialog screen when PIN is too short -->
-    <string name="lockpassword_pin_too_short">PIN must be at least %d characters</string>
+    <string name="lockpassword_pin_too_short">PIN must be at least %d digits</string>
 
     <!-- Hint shown after minimum password criteria is met -->
     <string name="lockpassword_press_continue">Touch Continue when done</string>
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index aa3f2e9..2055af0 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -193,9 +193,14 @@
                     ar= (AsyncResult) msg.obj;
                     if (ar.exception == null) {
                         int type = ((int[])ar.result)[0];
+                        if (type >= mPreferredNetworkLabels.length) {
+                            Log.e(TAG, "[RadioInfo] EVENT_QUERY_PREFERRED_TYPE_DONE: unknown " +
+                                    "type=" + type);
+                            type = mPreferredNetworkLabels.length - 1;
+                        }
                         preferredNetworkType.setSelection(type, true);
                     } else {
-                        preferredNetworkType.setSelection(8, true);
+                        preferredNetworkType.setSelection(mPreferredNetworkLabels.length - 1, true);
                     }
                     break;
                 case EVENT_SET_PREFERRED_TYPE_DONE:
@@ -1009,7 +1014,7 @@
             mPreferredNetworkHandler = new AdapterView.OnItemSelectedListener() {
         public void onItemSelected(AdapterView parent, View v, int pos, long id) {
             Message msg = mHandler.obtainMessage(EVENT_SET_PREFERRED_TYPE_DONE);
-            if (pos>=0 && pos<=7) { //IS THIS NEEDED to extend to the entire range of values
+            if (pos>=0 && pos<=(mPreferredNetworkLabels.length - 2)) {
                 phone.setPreferredNetworkType(pos, msg);
             }
         }
@@ -1027,5 +1032,9 @@
             "CDMA only",
             "EvDo only",
             "GSM/CDMA auto (PRL)",
+            "LTE/CDMA auto (PRL)",
+            "LTE/GSM auto (PRL)",
+            "LTE/GSM/CDMA auto (PRL)",
+            "LTE only",
             "Unknown"};
 }
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index f28500e..582891d 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -124,7 +124,7 @@
         // Did not find a matching activity, so remove the preference
         parentPreferenceGroup.removePreference(preference);
 
-        return true;
+        return false;
     }
 
     /**
diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java
index 82f9844..6847607 100644
--- a/src/com/android/settings/accounts/AccountSyncSettings.java
+++ b/src/com/android/settings/accounts/AccountSyncSettings.java
@@ -81,7 +81,7 @@
     private Account[] mAccounts;
     private ArrayList<SyncStateCheckBoxPreference> mCheckBoxes =
                 new ArrayList<SyncStateCheckBoxPreference>();
-    private ArrayList<String> mInvisibleAdapters = Lists.newArrayList();
+    private ArrayList<SyncAdapterType> mInvisibleAdapters = Lists.newArrayList();
 
     @Override
     public Dialog onCreateDialog(final int id) {
@@ -321,8 +321,11 @@
         }
         // plus whatever the system needs to sync, e.g., invisible sync adapters
         if (mAccount != null) {
-            for (String authority : mInvisibleAdapters) {
-                requestOrCancelSync(mAccount, authority, startSync);
+            for (SyncAdapterType syncAdapter : mInvisibleAdapters) {
+                // invisible sync adapters' account type should be same as current account type
+                if (syncAdapter.accountType.equals(mAccount.type)) {
+                    requestOrCancelSync(mAccount, syncAdapter.authority, startSync);
+                }
             }
         }
     }
@@ -449,7 +452,7 @@
             } else {
                 // keep track of invisible sync adapters, so sync now forces
                 // them to sync as well.
-                mInvisibleAdapters.add(sa.authority);
+                mInvisibleAdapters.add(sa);
             }
         }
 
diff --git a/src/com/android/settings/applications/RunningServiceDetails.java b/src/com/android/settings/applications/RunningServiceDetails.java
index 631e747..08cb0e0 100644
--- a/src/com/android/settings/applications/RunningServiceDetails.java
+++ b/src/com/android/settings/applications/RunningServiceDetails.java
@@ -439,7 +439,6 @@
         
         mAllDetails = (ViewGroup)view.findViewById(R.id.all_details);
         mSnippet = (ViewGroup)view.findViewById(R.id.snippet);
-        mSnippet.setBackgroundResource(com.android.internal.R.drawable.title_bar_medium);
         mSnippet.setPadding(0, mSnippet.getPaddingTop(), 0, mSnippet.getPaddingBottom());
         mSnippetViewHolder = new RunningProcessesView.ViewHolder(mSnippet);
         
diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java
index c315acd..434dfe7 100644
--- a/src/com/android/settings/deviceinfo/Status.java
+++ b/src/com/android/settings/deviceinfo/Status.java
@@ -115,7 +115,7 @@
     private Preference mSignalStrength;
     private Preference mUptime;
 
-    private static String sUnknown;
+    private String sUnknown;
 
     private Preference mBatteryStatus;
     private Preference mBatteryLevel;
@@ -188,9 +188,7 @@
         mBatteryStatus = findPreference(KEY_BATTERY_STATUS);
 
         mRes = getResources();
-        if (sUnknown == null) {
-            sUnknown = mRes.getString(R.string.device_info_default);
-        }
+        sUnknown = mRes.getString(R.string.device_info_default);
 
         mPhone = PhoneFactory.getDefaultPhone();
         // Note - missing in zaku build, be careful later...
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
index 4454389..aa2bcf4 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
@@ -172,6 +172,7 @@
     @Override
     public void onResume() {
         super.onResume();
+        mSettingsObserver.resume();
         if (!mIsOnlyImeSettings) {
             if (mLanguagePref != null) {
                 Configuration conf = getResources().getConfiguration();
@@ -207,6 +208,7 @@
     @Override
     public void onPause() {
         super.onPause();
+        mSettingsObserver.pause();
         if (SHOW_INPUT_METHOD_SWITCHER_SETTINGS) {
             mShowInputMethodSelectorPref.setOnPreferenceChangeListener(null);
         }
@@ -359,17 +361,27 @@
     }
 
     private class SettingsObserver extends ContentObserver {
+        private Context mContext;
+
         public SettingsObserver(Handler handler, Context context) {
             super(handler);
-            final ContentResolver cr = context.getContentResolver();
+            mContext = context;
+        }
+
+        @Override public void onChange(boolean selfChange) {
+            updateCurrentImeName();
+        }
+
+        public void resume() {
+            final ContentResolver cr = mContext.getContentResolver();
             cr.registerContentObserver(
                     Settings.Secure.getUriFor(Settings.Secure.DEFAULT_INPUT_METHOD), false, this);
             cr.registerContentObserver(Settings.Secure.getUriFor(
                     Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE), false, this);
         }
 
-        @Override public void onChange(boolean selfChange) {
-            updateCurrentImeName();
+        public void pause() {
+            mContext.getContentResolver().unregisterContentObserver(this);
         }
     }
 }