Merge "Add sd card string, just in case" into mnc-dev
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d1b09cb..f2454ea 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2110,7 +2110,8 @@
                   android:theme="@style/Theme.CryptKeeper"
                   android:configChanges="mnc|mcc|keyboard|keyboardHidden|uiMode"
                   android:windowSoftInputMode="adjustResize"
-                  android:screenOrientation="nosensor">
+                  android:screenOrientation="nosensor"
+                  android:process=":CryptKeeper">
             <intent-filter android:priority="10">
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.HOME" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 3cd4d8a..51e3ef3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1170,6 +1170,9 @@
     <!-- Bluetooth PIN hint text (below the text entry box). [CHAR LIMIT=30] -->
     <string name="bluetooth_pin_values_hint">Usually 0000 or 1234</string>
 
+    <!-- Bluetooth PIN hint text (below the text entry box). [CHAR LIMIT=30] -->
+    <string name="bluetooth_pin_values_hint_16_digits">Must be 16 digits</string>
+
     <!-- Pairing dialog text to remind user to enter the PIN on the other device. [CHAR LIMIT=NONE] -->
     <string name="bluetooth_enter_pin_other_device">You may also need to type this PIN on the other device.</string>
     <!-- Pairing dialog text to remind user to enter the passkey on the other device. [CHAR LIMIT=NONE] -->
@@ -2135,6 +2138,8 @@
     <string name="device_status_summary" product="default">Phone number, signal, etc.</string>
     <!-- Main settings screen item's title to go into the storage settings screen [CHAR LIMIT=25] -->
     <string name="storage_settings" >Storage</string>
+    <!-- Main settings screen item's title to go into the storage & USB settings screen [CHAR LIMIT=25] -->
+    <string name="storage_usb_settings" >Storage &amp; USB</string>
     <!-- Storage settings screen title -->
     <string name="storage_settings_title">Storage settings</string>
     <!-- [CHAR LIMIT=100] Main settings screen item's summary for the SD card and storage settings -->
diff --git a/res/xml/dashboard_categories.xml b/res/xml/dashboard_categories.xml
index c839792..54d1d39 100644
--- a/res/xml/dashboard_categories.xml
+++ b/res/xml/dashboard_categories.xml
@@ -113,7 +113,7 @@
         <!-- Storage -->
         <dashboard-tile
                 android:id="@+id/storage_settings"
-                android:title="@string/storage_settings"
+                android:title="@string/storage_usb_settings"
                 android:fragment="com.android.settings.deviceinfo.StorageSettings"
                 android:icon="@drawable/ic_settings_storage"
                 />
diff --git a/src/com/android/settings/DateTimeSettings.java b/src/com/android/settings/DateTimeSettings.java
index c29dc47..8a9e2ad 100644
--- a/src/com/android/settings/DateTimeSettings.java
+++ b/src/com/android/settings/DateTimeSettings.java
@@ -165,7 +165,7 @@
         Date dummyDate = mDummyDate.getTime();
         mDatePref.setSummary(DateFormat.getLongDateFormat(context).format(now.getTime()));
         mTimePref.setSummary(DateFormat.getTimeFormat(getActivity()).format(now.getTime()));
-        mTimeZone.setSummary(ZoneGetter.getTimeZoneText(now.getTimeZone(), true));
+        mTimeZone.setSummary(ZoneGetter.getTimeZoneOffsetAndName(now.getTimeZone(), now.getTime()));
         mTime24Pref.setSummary(DateFormat.getTimeFormat(getActivity()).format(dummyDate));
     }
 
diff --git a/src/com/android/settings/ZonePicker.java b/src/com/android/settings/ZonePicker.java
index a3c7435..2a61a5a 100644
--- a/src/com/android/settings/ZonePicker.java
+++ b/src/com/android/settings/ZonePicker.java
@@ -87,8 +87,7 @@
 
         final String sortKey = (sortedByName ? ZoneGetter.KEY_DISPLAYNAME : ZoneGetter.KEY_OFFSET);
         final MyComparator comparator = new MyComparator(sortKey);
-        final ZoneGetter zoneGetter = new ZoneGetter();
-        final List<HashMap<String, Object>> sortedList = zoneGetter.getZones(context);
+        final List<Map<String, Object>> sortedList = ZoneGetter.getZonesList(context);
         Collections.sort(sortedList, comparator);
         final SimpleAdapter adapter = new SimpleAdapter(context,
                 sortedList,
@@ -226,7 +225,7 @@
         }
     }
 
-    private static class MyComparator implements Comparator<HashMap<?, ?>> {
+    private static class MyComparator implements Comparator<Map<?, ?>> {
         private String mSortingKey;
 
         public MyComparator(String sortingKey) {
@@ -237,7 +236,7 @@
             mSortingKey = sortingKey;
         }
 
-        public int compare(HashMap<?, ?> map1, HashMap<?, ?> map2) {
+        public int compare(Map<?, ?> map1, Map<?, ?> map2) {
             Object value1 = map1.get(mSortingKey);
             Object value2 = map2.get(mSortingKey);
 
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
index 5785285..ffe4945 100755
--- a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
@@ -116,6 +116,7 @@
 
         switch (mType) {
             case BluetoothDevice.PAIRING_VARIANT_PIN:
+            case BluetoothDevice.PAIRING_VARIANT_PIN_16_DIGITS:
             case BluetoothDevice.PAIRING_VARIANT_PASSKEY:
                 createUserEntryDialog();
                 break;
@@ -181,6 +182,7 @@
     private View createPinEntryView() {
         View view = getLayoutInflater().inflate(R.layout.bluetooth_pin_entry, null);
         TextView messageViewCaption = (TextView) view.findViewById(R.id.message_caption);
+        TextView messageViewCaptionHint = (TextView) view.findViewById(R.id.pin_values_hint);
         TextView messageViewContent = (TextView) view.findViewById(R.id.message_subhead);
         TextView messageView2 = (TextView) view.findViewById(R.id.message_below_pin);
         CheckBox alphanumericPin = (CheckBox) view.findViewById(R.id.alphanumeric_pin);
@@ -190,8 +192,12 @@
 
         int messageId1;
         int messageId2;
+        int messageIdHint = R.string.bluetooth_pin_values_hint;
         int maxLength;
         switch (mType) {
+            case BluetoothDevice.PAIRING_VARIANT_PIN_16_DIGITS:
+                messageIdHint = R.string.bluetooth_pin_values_hint_16_digits;
+                // FALLTHROUGH
             case BluetoothDevice.PAIRING_VARIANT_PIN:
                 messageId1 = R.string.bluetooth_enter_pin_msg;
                 messageId2 = R.string.bluetooth_enter_pin_other_device;
@@ -213,6 +219,7 @@
         }
 
         messageViewCaption.setText(messageId1);
+        messageViewCaptionHint.setText(messageIdHint);
         messageViewContent.setText(mCachedDeviceManager.getName(mDevice));
         messageView2.setText(messageId2);
         mPairingView.setInputType(InputType.TYPE_CLASS_NUMBER);
@@ -316,13 +323,18 @@
 
     public void afterTextChanged(Editable s) {
         if (mOkButton != null) {
-            mOkButton.setEnabled(s.length() > 0);
+            if (mType == BluetoothDevice.PAIRING_VARIANT_PIN_16_DIGITS) {
+                mOkButton.setEnabled(s.length() >= 16);
+            } else {
+                mOkButton.setEnabled(s.length() > 0);
+            }
         }
     }
 
     private void onPair(String value) {
         switch (mType) {
             case BluetoothDevice.PAIRING_VARIANT_PIN:
+            case BluetoothDevice.PAIRING_VARIANT_PIN_16_DIGITS:
                 byte[] pinBytes = BluetoothDevice.convertPinToBytes(value);
                 if (pinBytes == null) {
                     return;
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index 0c423a4..1849a9a 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -773,7 +773,7 @@
             userPreferences.add(pref);
         }
 
-        if (mUserCaps.mCanAddGuest || findGuest() != null) {
+        if (!mUserCaps.mIsGuest && (mUserCaps.mCanAddGuest || findGuest() != null)) {
             // Add a virtual Guest user for guest defaults
             UserPreference pref = new UserPreference(getActivity(), null,
                     UserPreference.USERID_GUEST_DEFAULTS,