Merge "Fix alert dialogs in VpnSettings." into honeycomb
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 5556fe7..e07f38e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1079,7 +1079,7 @@
         <activity android:name=".CryptKeeper"
                   android:immersive="true"
                   android:launchMode="singleTop"
-                  android:theme="@android:style/Theme.Holo.NoActionBar"
+                  android:theme="@style/CryptKeeperTheme"
                   android:windowSoftInputMode="stateAlwaysHidden">
             <intent-filter android:priority="10">
                 <action android:name="android.intent.action.MAIN" />
@@ -1088,6 +1088,12 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".CryptKeeper$Blank"
+            android:immersive="true"
+            android:launchMode="singleTop"
+            android:theme="@style/CryptKeeperBlankTheme"
+        />
+
         <!-- Pseudo-activity used to provide an intent-filter entry point to encryption settings -->
         <activity android:name="Settings$CryptKeeperSettingsActivity"
                 android:theme="@android:style/Theme.Holo"
diff --git a/res/anim/crypt_keeper_exit.xml b/res/anim/crypt_keeper_exit.xml
new file mode 100644
index 0000000..3ab34e9
--- /dev/null
+++ b/res/anim/crypt_keeper_exit.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:anim/accelerate_interpolator"
+>
+
+    <scale
+        android:fromXScale="1.0"
+        android:toXScale="0.0"
+        android:fromYScale="1.0"
+        android:toYScale="0.0"
+        android:pivotX="50%"
+        android:pivotY="50%"
+        android:fillAfter="false"
+        android:duration="500"
+    />
+
+</set>
+
diff --git a/res/layout-xlarge-land/choose_lock_password.xml b/res/layout-xlarge-land/choose_lock_password.xml
index 586e7d5..9518672 100644
--- a/res/layout-xlarge-land/choose_lock_password.xml
+++ b/res/layout-xlarge-land/choose_lock_password.xml
@@ -64,26 +64,19 @@
 
     <!-- confirm / restart buttons -->
     <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        style="@style/SecurityPreferenceButtonContainer"
         android:layout_alignParentRight="true"
         android:layout_alignParentBottom="true"
         android:orientation="horizontal">
 
         <!-- left / top button: skip, or re-try -->
         <Button android:id="@+id/cancel_button"
-            android:layout_width="140dip"
-            android:layout_height="wrap_content"
-            android:ellipsize="marquee"
-            android:singleLine="true"
+            style="@style/SecurityPreferenceButton"
             android:text="@string/lockpassword_cancel_label"/>
 
         <!-- right / bottom button: confirm or ok -->
         <Button android:id="@+id/next_button"
-            android:layout_width="140dip"
-            android:layout_height="wrap_content"
-            android:ellipsize="marquee"
-            android:singleLine="true"
+            style="@style/SecurityPreferenceButton"
             android:text="@string/lockpassword_continue_label"/>
 
     </LinearLayout>
diff --git a/res/layout-xlarge-land/choose_lock_pattern.xml b/res/layout-xlarge-land/choose_lock_pattern.xml
index e2cbdab..fc5e787 100644
--- a/res/layout-xlarge-land/choose_lock_pattern.xml
+++ b/res/layout-xlarge-land/choose_lock_pattern.xml
@@ -59,26 +59,19 @@
 
         <!-- confirm / restart buttons -->
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            style="@style/SecurityPreferenceButtonContainer"
             android:layout_alignParentRight="true"
             android:layout_alignParentBottom="true"
             android:orientation="horizontal">
 
             <!-- left / top button: skip, or re-try -->
             <Button android:id="@+id/footerLeftButton"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_restart_button_text"/>
 
             <!-- right / bottom button: confirm or ok -->
             <Button android:id="@+id/footerRightButton"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_confirm_button_text"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge-land/choose_lock_pattern_tutorial.xml b/res/layout-xlarge-land/choose_lock_pattern_tutorial.xml
index 56addbb..32b452d 100644
--- a/res/layout-xlarge-land/choose_lock_pattern_tutorial.xml
+++ b/res/layout-xlarge-land/choose_lock_pattern_tutorial.xml
@@ -48,26 +48,19 @@
             android:textSize="22sp"/>
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            style="@style/SecurityPreferenceButtonContainer"
             android:layout_alignParentRight="true"
             android:layout_alignParentBottom="true"
             android:orientation="horizontal">
 
             <!-- left / top button: skip, or re-try -->
             <Button android:id="@+id/skip_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_tutorial_cancel_label"/>
 
             <!-- right / bottom button: confirm or ok -->
             <Button android:id="@+id/next_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_tutorial_continue_label"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge-land/confirm_lock_password.xml b/res/layout-xlarge-land/confirm_lock_password.xml
index 7ae8944..3874f11 100644
--- a/res/layout-xlarge-land/confirm_lock_password.xml
+++ b/res/layout-xlarge-land/confirm_lock_password.xml
@@ -65,26 +65,19 @@
 
     <!-- confirm / restart buttons -->
     <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        style="@style/SecurityPreferenceButtonContainer"
         android:layout_alignParentRight="true"
         android:layout_alignParentBottom="true"
         android:orientation="horizontal">
 
         <!-- left / top button: skip, or re-try -->
         <Button android:id="@+id/cancel_button"
-            android:layout_width="140dip"
-            android:layout_height="wrap_content"
-            android:ellipsize="marquee"
-            android:singleLine="true"
+            style="@style/SecurityPreferenceButton"
             android:text="@string/lockpassword_cancel_label"/>
 
         <!-- right / bottom button: confirm or ok -->
         <Button android:id="@+id/next_button"
-            android:layout_width="140dip"
-            android:layout_height="wrap_content"
-            android:ellipsize="marquee"
-            android:singleLine="true"
+            style="@style/SecurityPreferenceButton"
             android:text="@string/lockpassword_continue_label"/>
 
     </LinearLayout>
diff --git a/res/layout-xlarge-land/crypt_keeper_password_entry.xml b/res/layout-xlarge-land/crypt_keeper_password_entry.xml
index 76d2278..ffbdf89 100644
--- a/res/layout-xlarge-land/crypt_keeper_password_entry.xml
+++ b/res/layout-xlarge-land/crypt_keeper_password_entry.xml
@@ -20,51 +20,53 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="horizontal"
+    android:orientation="vertical"
 >
-    <LinearLayout
-           android:layout_height="match_parent"
-           android:layout_weight="1"
-           android:layout_width="0dip"
-           android:orientation="vertical"
-           android:gravity="center_vertical"
-               >
-       <include layout="@layout/crypt_keeper_status" />
-   </LinearLayout>
-   
-   <!-- right side: password -->
-   <LinearLayout
-       android:layout_width="0dip"
-       android:layout_height="match_parent"
-       android:orientation="vertical"
-       android:layout_weight="1"
-       android:gravity="center">
 
-       <!-- Password entry field -->
-       <EditText android:id="@+id/passwordEntry"
-           android:layout_height="wrap_content"
-           android:layout_width="450dip"
-           android:singleLine="true"
-           android:textStyle="normal"
-           android:inputType="textPassword"
-           android:gravity="center"
-           android:layout_gravity="center"
-           android:textSize="24sp"
-           android:layout_marginTop="120dip"
-           android:layout_marginBottom="5dip"
-           android:textAppearance="?android:attr/textAppearanceMedium"
-           android:textColor="#ffffffff"
-           android:editable="false"
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="0dip"
+        android:layout_weight="1"
+    >
+        <!-- left side: status -->
+        <include layout="@layout/crypt_keeper_status"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="102dip"
+            android:layout_marginTop="20dip"
+            android:gravity="left"
+            android:paddingTop="50dip"
+            android:layout_centerVertical="true"
+            android:layout_alignParentLeft="true"
         />
 
-       <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
-           android:layout_width="450dip"
-           android:layout_height="230dip"
-           android:background="#00000000"
-           android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
-           android:visibility="visible"
-       />
-       
-   </LinearLayout>
-    
+        <!-- Password entry field -->
+        <EditText android:id="@+id/passwordEntry"
+            android:layout_height="wrap_content"
+            android:layout_width="450dip"
+            android:layout_marginRight="155dip"
+            android:layout_alignParentRight="true"
+            android:singleLine="true"
+            android:textStyle="normal"
+            android:inputType="textPassword"
+            android:gravity="center"
+            android:layout_gravity="center"
+            android:textSize="24sp"
+            android:layout_marginTop="120dip"
+            android:layout_marginBottom="5dip"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textColor="#ffffffff"
+            android:editable="false"
+        />
+
+    </RelativeLayout>
+
+    <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="#00000000"
+        android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
+        android:visibility="visible"
+    />
+
 </LinearLayout>
\ No newline at end of file
diff --git a/res/layout-xlarge/choose_lock_password.xml b/res/layout-xlarge/choose_lock_password.xml
index f923971..c8a0866 100644
--- a/res/layout-xlarge/choose_lock_password.xml
+++ b/res/layout-xlarge/choose_lock_password.xml
@@ -84,23 +84,16 @@
         android:layout_width="match_parent">
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            style="@style/SecurityPreferenceButtonContainer"
             android:layout_alignParentRight="true"
             android:orientation="horizontal">
 
             <Button android:id="@+id/cancel_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpassword_cancel_label"/>
 
             <Button android:id="@+id/next_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpassword_continue_label"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge/choose_lock_pattern.xml b/res/layout-xlarge/choose_lock_pattern.xml
index 5995c26..6b7b90e 100644
--- a/res/layout-xlarge/choose_lock_pattern.xml
+++ b/res/layout-xlarge/choose_lock_pattern.xml
@@ -54,25 +54,18 @@
         android:layout_height="wrap_content">
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            style="@style/SecurityPreferenceButtonContainer"
             android:layout_alignParentRight="true"
             android:orientation="horizontal">
 
             <!-- left / top button: skip, or re-try -->
             <Button android:id="@+id/footerLeftButton"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_restart_button_text"/>
 
             <!-- right / bottom button: confirm or ok -->
             <Button android:id="@+id/footerRightButton"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_confirm_button_text"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge/choose_lock_pattern_tutorial.xml b/res/layout-xlarge/choose_lock_pattern_tutorial.xml
index ea09727..c7bdc88 100644
--- a/res/layout-xlarge/choose_lock_pattern_tutorial.xml
+++ b/res/layout-xlarge/choose_lock_pattern_tutorial.xml
@@ -47,25 +47,18 @@
         android:layout_height="wrap_content">
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            style="@style/SecurityPreferenceButtonContainer"
             android:layout_alignParentRight="true"
             android:orientation="horizontal">
 
             <!-- left / top button: skip, or re-try -->
             <Button android:id="@+id/skip_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_tutorial_cancel_label"/>
 
             <!-- right / bottom button: confirm or ok -->
             <Button android:id="@+id/next_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpattern_tutorial_continue_label"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge/confirm_lock_password.xml b/res/layout-xlarge/confirm_lock_password.xml
index abb0d79..5ffc5e7 100644
--- a/res/layout-xlarge/confirm_lock_password.xml
+++ b/res/layout-xlarge/confirm_lock_password.xml
@@ -87,23 +87,16 @@
         android:layout_width="match_parent">
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            style="@style/SecurityPreferenceButtonContainer"
             android:layout_alignParentRight="true"
             android:orientation="horizontal">
 
             <Button android:id="@+id/cancel_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpassword_cancel_label"/>
 
             <Button android:id="@+id/next_button"
-                android:layout_width="140dip"
-                android:layout_height="wrap_content"
-                android:ellipsize="marquee"
-                android:singleLine="true"
+                style="@style/SecurityPreferenceButton"
                 android:text="@string/lockpassword_continue_label"/>
 
         </LinearLayout>
diff --git a/res/layout-xlarge/crypt_keeper_password_entry.xml b/res/layout-xlarge/crypt_keeper_password_entry.xml
index 4dce67a..b67eed0 100644
--- a/res/layout-xlarge/crypt_keeper_password_entry.xml
+++ b/res/layout-xlarge/crypt_keeper_password_entry.xml
@@ -17,52 +17,49 @@
 */
 -->
 
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical"
+    android:gravity="center_horizontal"
 >
-    <LinearLayout
-           android:layout_height="wrap_content"
-           android:layout_width="match_parent"
-           android:orientation="vertical"
-           android:gravity="center_vertical"
-               >
-       <include layout="@layout/crypt_keeper_status" />
-   </LinearLayout>
-   
-   <!-- right side: password -->
-   <LinearLayout
-       android:layout_width="match_parent"
-       android:layout_height="match_parent"
-       android:orientation="vertical"
-       android:gravity="center">
 
-       <!-- Password entry field -->
-       <EditText android:id="@+id/passwordEntry"
-           android:layout_height="wrap_content"
-           android:layout_width="450dip"
-           android:singleLine="true"
-           android:textStyle="normal"
-           android:inputType="textPassword"
-           android:gravity="center"
-           android:layout_gravity="center"
-           android:textSize="24sp"
-           android:layout_marginTop="120dip"
-           android:layout_marginBottom="5dip"
-           android:textAppearance="?android:attr/textAppearanceMedium"
-           android:textColor="#ffffffff"
-           android:editable="false"
-        />
+    <!-- left side: status -->
+    <include layout="@layout/crypt_keeper_status"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="134dip"
+        android:paddingTop="50dip"
+        android:layout_alignParentTop="true"
+        android:layout_gravity="center_horizontal"
+        android:layout_centerHorizontal="true"
+    />
 
-       <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
-           android:layout_width="450dip"
-           android:layout_height="230dip"
-           android:background="#00000000"
-           android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
-           android:visibility="visible"
-       />
-       
-   </LinearLayout>
-    
-</LinearLayout>
\ No newline at end of file
+    <!-- Password entry field -->
+    <EditText android:id="@+id/passwordEntry"
+        android:layout_above="@id/keyboard"
+        android:layout_height="wrap_content"
+        android:layout_width="450dip"
+        android:singleLine="true"
+        android:textStyle="normal"
+        android:inputType="textPassword"
+        android:gravity="center"
+        android:layout_gravity="center_horizontal"
+        android:layout_centerHorizontal="true"
+        android:textSize="24sp"
+        android:layout_marginTop="120dip"
+        android:layout_marginBottom="5dip"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:textColor="#ffffffff"
+        android:editable="false"
+    />
+
+    <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:background="#00000000"
+        android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
+        android:visibility="visible"
+    />
+
+</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/crypt_keeper_status.xml b/res/layout/crypt_keeper_status.xml
index ba2584f..d106c69 100644
--- a/res/layout/crypt_keeper_status.xml
+++ b/res/layout/crypt_keeper_status.xml
@@ -23,10 +23,7 @@
         android:orientation="vertical"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginLeft="140dip"
-        android:layout_marginTop="20dip"
-        android:gravity="left"
-        >
+>
 
     <com.android.internal.widget.DigitalClock android:id="@+id/time"
         android:layout_width="wrap_content"
diff --git a/res/layout/preference_bluetooth.xml b/res/layout/preference_bluetooth.xml
index d363dc9..bd437a9 100644
--- a/res/layout/preference_bluetooth.xml
+++ b/res/layout/preference_bluetooth.xml
@@ -31,7 +31,6 @@
         android:id="@+id/divider"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginRight="8dip"
         android:layout_gravity="center_vertical"
         android:src="@drawable/nav_divider"
          />
@@ -42,6 +41,8 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical"
+        android:padding="8dip"
+        android:background="?android:attr/selectableItemBackground"
         android:src="@drawable/ic_bt_config" />
 
 </LinearLayout>
diff --git a/res/layout/preference_bluetooth_profile.xml b/res/layout/preference_bluetooth_profile.xml
index 03f598a..4b6f1dd 100644
--- a/res/layout/preference_bluetooth_profile.xml
+++ b/res/layout/preference_bluetooth_profile.xml
@@ -24,7 +24,6 @@
         android:id="@+id/divider"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginRight="8dip"
         android:layout_gravity="center_vertical"
         android:src="@drawable/nav_divider"
          />
@@ -35,6 +34,8 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical"
+        android:padding="8dip"
+        android:background="?android:attr/selectableItemBackground"
         android:src="@drawable/icon" />
 
 </LinearLayout>
diff --git a/res/layout/user_dictionary_item.xml b/res/layout/user_dictionary_item.xml
index 926068f..3cdeb08 100644
--- a/res/layout/user_dictionary_item.xml
+++ b/res/layout/user_dictionary_item.xml
@@ -41,13 +41,10 @@
     <ImageView
             android:id="@+id/delete_button"
             android:layout_width="wrap_content"
-            android:layout_height="match_parent"
+            android:layout_height="wrap_content"
             android:layout_gravity="center"
-            android:paddingLeft="16dip"
-            android:paddingRight="16dip"
-            android:paddingTop="8dip"
-            android:paddingBottom="8dip"
+            android:padding="8dip"
             android:src="@drawable/ic_item_delete"
-            android:background="@android:drawable/list_selector_background"
+            android:background="?android:attr/selectableItemBackground"
         />
 </LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index df11d4f..eed510b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -583,11 +583,17 @@
     <string name="security_passwords_title">Passwords</string>
 
     <string name="crypt_keeper_settings_title">Device encryption</string>
+
     <string name="crypt_keeper_encrypt_title">Encrypt data on device</string>
     <string name="crypt_keeper_encrypt_summary">Requires you to set a device unlock pin or password</string>
-    <string name="crypt_keeper_confirm_title">Confirm encrypt</string>
+    <string name="crypt_keeper_encrypted_summary">Encrypted</string>
+
+    <string name="crypt_keeper_confirm_title">Confirm encryption</string>
+
     
-    <string name="crypt_keeper_desc">You can encrypt your accounts, settings, downloaded applications and their data, media, and other files. Once you encrypt your tablet, you can\'t unencrypt it except by performing a factory data reset, erasing all the data on your tablet.\n\nEncryption takes up to an hour. You must start with a charged battery and keep your tablet plugged in until encryption is complete. If you interrupt the encryption process, you will lose some or all of your data.</string>
+    <string name="crypt_keeper_desc" product="tablet">You can encrypt your accounts, settings, downloaded applications and their data, media, and other files. Once you encrypt your tablet, you can\'t unencrypt it except by performing a factory data reset, erasing all the data on your tablet.\n\nEncryption takes up to an hour. You must start with a charged battery and keep your tablet plugged in until encryption is complete. If you interrupt the encryption process, you will lose some or all of your data.</string>
+    <string name="crypt_keeper_desc" product="default">You can encrypt your accounts, settings, downloaded applications and their data, media, and other files. Once you encrypt your phone, you can\'t unencrypt it except by performing a factory data reset, erasing all the data on your phone.\n\nEncryption takes up to an hour. You must start with a charged battery and keep your phone plugged in until encryption is complete. If you interrupt the encryption process, you will lose some or all of your data.</string>
+
     
     <string name="crypt_keeper_button_text" product="tablet">Encrypt tablet</string>
     <string name="crypt_keeper_button_text" product="default">Encrypt phone</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index a49cd0a..eb39aa2 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -50,7 +50,7 @@
         <item name="android:layout_width">wrap_content</item>
         <item name="android:layout_height">wrap_content</item>
     </style>
-    
+
     <style name="form_value">
         <item name="android:layout_height">wrap_content</item>
         <item name="android:layout_width">match_parent</item>
@@ -78,7 +78,7 @@
     <style name="TallTitleBarTheme" parent="android:Theme.NoTitleBar">
         <item name="android:windowContentOverlay">@null</item>
     </style>
-    
+
     <style name="Theme.CreateShortCut" parent="android:Theme.Holo.DialogWhenLarge">
     </style>
 
@@ -120,4 +120,30 @@
         <item name="android:windowNoTitle">true</item>
         <item name="android:windowIsFloating">true</item>
     </style>
+
+    <style name="CryptKeeperTheme" parent="@android:style/Theme.Holo.NoActionBar">
+        <item name="android:windowAnimationStyle">@style/CryptKeeperAnimation</item>
+    </style>
+
+    <style name="CryptKeeperBlankTheme" parent="@android:style/Theme.Holo.NoActionBar">
+        <item name="android:background">#ff000000</item>
+    </style>
+
+    <style name="CryptKeeperAnimation">
+        <item name="android:windowExitAnimation">@anim/crypt_keeper_exit</item>
+    </style>
+
+    <style name="SecurityPreferenceButtonContainer" parent="@android:style/Holo.SegmentedButton">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:dividerPadding">8dip</item>
+    </style>
+
+    <style name="SecurityPreferenceButton" parent="@android:style/Widget.Holo.Button.Borderless">
+        <item name="android:layout_width">140dip</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:ellipsize">marquee</item>
+        <item name="android:singleLine">true</item>
+    </style>
+
 </resources>
diff --git a/res/xml/application_settings.xml b/res/xml/application_settings.xml
index a06377d..4e77a93 100644
--- a/res/xml/application_settings.xml
+++ b/res/xml/application_settings.xml
@@ -19,32 +19,6 @@
         android:summary="@string/applications_settings_summary"
         android:key="applications_settings">
 
-    <CheckBoxPreference
-            android:key="toggle_install_applications"
-            android:title="@string/install_applications"
-            android:summaryOff="@string/install_unknown_applications"
-            android:summaryOn="@string/install_unknown_applications"
-            android:persistent="false" />
-
-    <ListPreference
-        android:key="app_install_location"
-        android:title="@string/app_install_location_title"
-        android:summary="@string/app_install_location_summary"
-        android:persistent="false"
-        android:entries="@array/app_install_location_entries"
-        android:entryValues="@array/app_install_location_values"/>
-
-    <!-- Disabled quick launch settings pending UI redesign.
-    <PreferenceScreen
-            android:key="quick_launch"
-            android:title="@string/quick_launch_title"
-            android:summary="@string/quick_launch_summary">
-        <intent android:action="android.intent.action.MAIN"
-                android:targetPackage="com.android.settings"
-                android:targetClass="com.android.settings.quicklaunch.QuickLaunchSettings" />
-    </PreferenceScreen>
-    -->
-
     <PreferenceScreen
             android:fragment="com.android.settings.applications.ManageApplications"
             android:title="@string/manageapplications_settings_title"
@@ -73,11 +47,38 @@
             android:summary="@string/power_usage_summary">
     </PreferenceScreen>
 
+    <CheckBoxPreference
+            android:key="toggle_install_applications"
+            android:title="@string/install_applications"
+            android:summaryOff="@string/install_unknown_applications"
+            android:summaryOn="@string/install_unknown_applications"
+            android:persistent="false" />
+
+    <ListPreference
+        android:key="app_install_location"
+        android:title="@string/app_install_location_title"
+        android:summary="@string/app_install_location_summary"
+        android:persistent="false"
+        android:entries="@array/app_install_location_entries"
+        android:entryValues="@array/app_install_location_values"/>
+
+    <!-- Disabled quick launch settings pending UI redesign.
+    <PreferenceScreen
+            android:key="quick_launch"
+            android:title="@string/quick_launch_title"
+            android:summary="@string/quick_launch_summary">
+        <intent android:action="android.intent.action.MAIN"
+                android:targetPackage="com.android.settings"
+                android:targetClass="com.android.settings.quicklaunch.QuickLaunchSettings" />
+    </PreferenceScreen>
+    -->
+
+
     <PreferenceScreen 
             android:title="@string/development_settings_title" 
             android:summary="@string/development_settings_summary"
             android:fragment="com.android.settings.DevelopmentSettings">
     </PreferenceScreen>
-    
+
 </PreferenceScreen>
 
diff --git a/res/xml/bluetooth_device_advanced.xml b/res/xml/bluetooth_device_advanced.xml
index b4a0978..6610a69 100644
--- a/res/xml/bluetooth_device_advanced.xml
+++ b/res/xml/bluetooth_device_advanced.xml
@@ -28,12 +28,6 @@
             android:order="20"
             android:persistent="false" />
 
-    <CheckBoxPreference
-            android:key="allow_incoming"
-            android:title="@string/bluetooth_device_advanced_enable_opp_title"
-            android:order="30"
-            android:persistent="false" />
-
     <Preference
             android:key="unpair"
             android:title="@string/bluetooth_device_context_unpair"
diff --git a/res/xml/security_settings_encrypted.xml b/res/xml/security_settings_encrypted.xml
new file mode 100644
index 0000000..e82dc56
--- /dev/null
+++ b/res/xml/security_settings_encrypted.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <PreferenceCategory
+        android:key="security_category"
+        android:title="@string/crypt_keeper_settings_title"
+    >
+        <Preference
+            style="?android:preferenceInformationStyle"
+            android:title="@string/crypt_keeper_encrypt_title"
+            android:summary="@string/crypt_keeper_encrypted_summary"
+        />
+
+    </PreferenceCategory>
+
+
+</PreferenceScreen>
diff --git a/res/xml/security_settings_encryption.xml b/res/xml/security_settings_unencrypted.xml
similarity index 100%
rename from res/xml/security_settings_encryption.xml
rename to res/xml/security_settings_unencrypted.xml
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index 3917b76..5afc3f6 100644
--- a/src/com/android/settings/CryptKeeper.java
+++ b/src/com/android/settings/CryptKeeper.java
@@ -57,6 +57,9 @@
     private static final int COOL_DOWN_ATTEMPTS = 10;
     private static final int COOL_DOWN_INTERVAL = 30; // 30 seconds
 
+    // This activity is used to fade the screen to black after the password is entered.
+    public static class Blank extends Activity {
+    }
 
     private Handler mHandler = new Handler() {
         @Override
@@ -103,7 +106,6 @@
         }
     };
 
-    private int mFailedAttempts = 0;
     private int mCooldown;
 
     @Override
@@ -143,7 +145,7 @@
         // is encrypted.
 
         PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
-        PowerManager.WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
+        PowerManager.WakeLock wakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, TAG);
 
         wakeLock.acquire();
 
@@ -192,15 +194,20 @@
 
             IMountService service = getMountService();
             try {
-                service.decryptStorage(password);
+                int failedAttempts = service.decryptStorage(password);
 
-                if (mFailedAttempts == 0) {
-                    // Success. Do something here within 2 seconds
-
-                } else if (mFailedAttempts == MAX_FAILED_ATTEMPTS) {
+                if (failedAttempts == 0) {
+                    // The password was entered successfully. Start the Blank activity
+                    // so this activity animates to black before the devices starts. Note
+                    // It has 1 second to complete the animation or it will be frozen
+                    // until the boot animation comes back up.
+                    Intent intent = new Intent(this, Blank.class);
+                    finish();
+                    startActivity(intent);
+                } else if (failedAttempts == MAX_FAILED_ATTEMPTS) {
                     // Factory reset the device.
                     sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR"));
-                } else if ((mFailedAttempts % COOL_DOWN_ATTEMPTS) == 0) {
+                } else if ((failedAttempts % COOL_DOWN_ATTEMPTS) == 0) {
                     mCooldown = COOL_DOWN_INTERVAL;
                     EditText passwordEntry = (EditText) findViewById(R.id.passwordEntry);
                     passwordEntry.setEnabled(false);
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index aaaf265..e413915 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -29,6 +29,7 @@
 import android.database.Cursor;
 import android.location.LocationManager;
 import android.os.Bundle;
+import android.os.SystemProperties;
 import android.os.Vibrator;
 import android.preference.CheckBoxPreference;
 import android.preference.ListPreference;
@@ -50,7 +51,6 @@
  */
 public class SecuritySettings extends SettingsPreferenceFragment
         implements OnPreferenceChangeListener {
-    private static final String KEY_ENCRYPTION = "encryption";
 
     // Lock Settings
     private static final String KEY_UNLOCK_SET_OR_CHANGE = "unlock_set_or_change";
@@ -161,12 +161,6 @@
             mUseLocation = useLocation;
         }
 
-        // Add options for device encryption
-        // TODO: It still needs to be determined how a device specifies that it supports
-        // encryption. That mechanism needs to be checked before adding the following code
-        
-        addPreferencesFromResource(R.xml.security_settings_encryption);
-
         // Add options for lock/unlock screen
         int resid = 0;
         if (!mLockPatternUtils.isSecure()) {
@@ -192,6 +186,19 @@
         }
         addPreferencesFromResource(resid);
 
+
+        // Add options for device encryption
+
+        String status = SystemProperties.get("ro.crypto.state", "unsupported");
+        if ("encrypted".equalsIgnoreCase(status)) {
+            // The device is currently encrypted
+            addPreferencesFromResource(R.xml.security_settings_encrypted);
+        } else if ("unencrypted".equalsIgnoreCase(status)) {
+            // This device support encryption but isn't encrypted
+            addPreferencesFromResource(R.xml.security_settings_unencrypted);
+        }
+
+
         // lock after preference
         mLockAfter = (ListPreference) root.findPreference(KEY_LOCK_AFTER_TIMEOUT);
         if (mLockAfter != null) {
diff --git a/src/com/android/settings/applications/RunningServiceDetails.java b/src/com/android/settings/applications/RunningServiceDetails.java
index eccff93..631e747 100644
--- a/src/com/android/settings/applications/RunningServiceDetails.java
+++ b/src/com/android/settings/applications/RunningServiceDetails.java
@@ -2,6 +2,7 @@
 
 import com.android.settings.R;
 
+import android.app.Activity;
 import android.app.ActivityManager;
 import android.app.AlertDialog;
 import android.app.ApplicationErrorReport;
@@ -23,6 +24,7 @@
 import android.content.res.Resources;
 import android.os.Bundle;
 import android.os.Debug;
+import android.os.Handler;
 import android.os.SystemClock;
 import android.provider.Settings;
 import android.util.Log;
@@ -406,7 +408,15 @@
     }
     
     private void finish() {
-        getActivity().onBackPressed();
+        (new Handler()).post(new Runnable() {
+            @Override
+            public void run() {
+                Activity a = getActivity();
+                if (a != null) {
+                    a.onBackPressed();
+                }
+            }
+        });
     }
     
     @Override
diff --git a/src/com/android/settings/bluetooth/BluetoothProfilePreference.java b/src/com/android/settings/bluetooth/BluetoothProfilePreference.java
index 6be1480..c74012a 100644
--- a/src/com/android/settings/bluetooth/BluetoothProfilePreference.java
+++ b/src/com/android/settings/bluetooth/BluetoothProfilePreference.java
@@ -80,9 +80,9 @@
         } else {
             mProfileExpandView.setOnClickListener(this);
             mProfileExpandView.setTag(mProfile);
-
-            mProfileExpandView.setImageResource(mExpanded ? R.drawable.ic_preferences_expanded
-                : R.drawable.ic_preferences_collapsed);
+            mProfileExpandView.setImageResource(mExpanded
+                    ? com.android.internal.R.drawable.expander_open_holo_dark
+                    : com.android.internal.R.drawable.expander_close_holo_dark);
         }
     }
 
diff --git a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
index 479cbe0..f39eabd 100644
--- a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
+++ b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
@@ -58,7 +58,6 @@
     private CachedBluetoothDevice mCachedDevice;
 
     private PreferenceGroup mProfileContainer;
-    private CheckBoxPreference mAllowIncomingPref;
     private EditTextPreference mDeviceNamePref;
     private final HashMap<String,CheckBoxPreference> mAutoConnectPrefs
             = new HashMap<String,CheckBoxPreference>();
@@ -93,17 +92,6 @@
         getPreferenceScreen().setOrderingAsAdded(false);
 
         mProfileContainer = (PreferenceGroup) findPreference(KEY_PROFILE_CONTAINER);
-        mAllowIncomingPref = (CheckBoxPreference) findPreference(KEY_ALLOW_INCOMING);
-
-        // Configure incoming file transfer preference if device supports OPP
-        // or else remove the preference item
-        if (isObjectPushSupported(device)) {
-            mAllowIncomingPref.setChecked(isIncomingFileTransfersAllowed());
-            mAllowIncomingPref.setOnPreferenceChangeListener(this);
-        } else {
-            getPreferenceScreen().removePreference(mAllowIncomingPref);
-            mAllowIncomingPref = null;
-        }
 
         mDeviceNamePref = (EditTextPreference) findPreference(KEY_RENAME_DEVICE);
         mDeviceNamePref.setSummary(mCachedDevice.getName());
@@ -210,9 +198,7 @@
     }
 
     public boolean onPreferenceChange(Preference preference, Object newValue) {
-        if (preference == mAllowIncomingPref) {
-            setIncomingFileTransfersAllowed((Boolean) newValue);
-        } else if (preference == mDeviceNamePref) {
+        if (preference == mDeviceNamePref) {
             mCachedDevice.setName((String) newValue);
         } else if (preference instanceof CheckBoxPreference) {
             boolean autoConnect = (Boolean) newValue;
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index ccc40fb..2e26eba 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -265,7 +265,15 @@
                 }
                 return true;
             case MENU_ID_ADVANCED:
-                startFragment(this, AdvancedSettings.class.getCanonicalName(), -1, null);
+                if (getActivity() instanceof PreferenceActivity) {
+                    ((PreferenceActivity) getActivity()).startPreferencePanel(
+                            AdvancedSettings.class.getCanonicalName(),
+                            null,
+                            R.string.wifi_advanced_titlebar, null,
+                            this, 0);
+                } else {
+                    startFragment(this, AdvancedSettings.class.getCanonicalName(), -1, null);
+                }
                 return true;
         }
         return super.onOptionsItemSelected(item);