AI 143370: am: CL 143220 am: CL 143022 New spare parts feature.  Spare parts is only in engineering builds, so I am hoping it is okay to check in -- it's the same as updating sample code etc.
  Original author: hackbod
  Merged from: //branches/cupcake/...
  Original author: android-build
  Merged from: //branches/donutburger/...

Automated import of CL 143370
diff --git a/apps/SpareParts/res/values/strings.xml b/apps/SpareParts/res/values/strings.xml
index 6aecca8..7bd13e5 100644
--- a/apps/SpareParts/res/values/strings.xml
+++ b/apps/SpareParts/res/values/strings.xml
@@ -45,6 +45,10 @@
     <string name="summary_on_fancy_ime_animations">Use fancier animations for input method windows</string>
     <string name="summary_off_fancy_ime_animations">Use normal animations for input method windows</string>
     
+    <string name="title_fancy_rotation_animations">Fancy rotation animations</string>
+    <string name="summary_on_fancy_rotation_animations">Use fancier animations for screen rotation</string>
+    <string name="summary_off_fancy_rotation_animations">Use normal animations for screen rotation</string>
+    
     <string name="title_haptic_feedback">Haptic feedback</string>
     <string name="summary_on_haptic_feedback">Use haptic feedback with user interaction</string>
     <string name="summary_off_haptic_feedback">Use haptic feedback with user interaction</string>
diff --git a/apps/SpareParts/res/xml/spare_parts.xml b/apps/SpareParts/res/xml/spare_parts.xml
index 3e06397..3ef1b79 100644
--- a/apps/SpareParts/res/xml/spare_parts.xml
+++ b/apps/SpareParts/res/xml/spare_parts.xml
@@ -72,6 +72,12 @@
             android:summaryOn="@string/summary_on_fancy_ime_animations"
             android:summaryOff="@string/summary_off_fancy_ime_animations"/>
         
+        <CheckBoxPreference 
+            android:key="fancy_rotation_animations" 
+            android:title="@string/title_fancy_rotation_animations" 
+            android:summaryOn="@string/summary_on_fancy_rotation_animations"
+            android:summaryOff="@string/summary_off_fancy_rotation_animations"/>
+        
         <ListPreference
                 android:key="font_size"
                 android:title="@string/title_font_size"
diff --git a/apps/SpareParts/src/com/android/spare_parts/SpareParts.java b/apps/SpareParts/src/com/android/spare_parts/SpareParts.java
index 2507746..c00cc51 100644
--- a/apps/SpareParts/src/com/android/spare_parts/SpareParts.java
+++ b/apps/SpareParts/src/com/android/spare_parts/SpareParts.java
@@ -54,6 +54,7 @@
     private static final String WINDOW_ANIMATIONS_PREF = "window_animations";
     private static final String TRANSITION_ANIMATIONS_PREF = "transition_animations";
     private static final String FANCY_IME_ANIMATIONS_PREF = "fancy_ime_animations";
+    private static final String FANCY_ROTATION_ANIMATIONS_PREF = "fancy_rotation_animations";
     private static final String HAPTIC_FEEDBACK_PREF = "haptic_feedback";
     private static final String FONT_SIZE_PREF = "font_size";
     private static final String END_BUTTON_PREF = "end_button";
@@ -64,6 +65,7 @@
     private ListPreference mWindowAnimationsPref;
     private ListPreference mTransitionAnimationsPref;
     private CheckBoxPreference mFancyImeAnimationsPref;
+    private CheckBoxPreference mFancyRotationAnimationsPref;
     private CheckBoxPreference mHapticFeedbackPref;
     private ListPreference mFontSizePref;
     private ListPreference mEndButtonPref;
@@ -118,6 +120,7 @@
         mTransitionAnimationsPref = (ListPreference) prefSet.findPreference(TRANSITION_ANIMATIONS_PREF);
         mTransitionAnimationsPref.setOnPreferenceChangeListener(this);
         mFancyImeAnimationsPref = (CheckBoxPreference) prefSet.findPreference(FANCY_IME_ANIMATIONS_PREF);
+        mFancyRotationAnimationsPref = (CheckBoxPreference) prefSet.findPreference(FANCY_ROTATION_ANIMATIONS_PREF);
         mHapticFeedbackPref = (CheckBoxPreference) prefSet.findPreference(HAPTIC_FEEDBACK_PREF);
         mFontSizePref = (ListPreference) prefSet.findPreference(FONT_SIZE_PREF);
         mFontSizePref.setOnPreferenceChangeListener(this);
@@ -143,6 +146,9 @@
             mFancyImeAnimationsPref.setChecked(Settings.System.getInt(
                     getContentResolver(), 
                     Settings.System.FANCY_IME_ANIMATIONS, 0) != 0);
+            mFancyRotationAnimationsPref.setChecked(Settings.System.getInt(
+                    getContentResolver(), 
+                    "fancy_rotation_anim", 0) != 0);
             mHapticFeedbackPref.setChecked(Settings.System.getInt(
                     getContentResolver(), 
                     Settings.System.HAPTIC_FEEDBACK_ENABLED, 0) != 0);
@@ -241,6 +247,10 @@
             Settings.System.putInt(getContentResolver(),
                     Settings.System.FANCY_IME_ANIMATIONS,
                     mFancyImeAnimationsPref.isChecked() ? 1 : 0);
+        } else if (FANCY_ROTATION_ANIMATIONS_PREF.equals(key)) {
+            Settings.System.putInt(getContentResolver(),
+                    "fancy_rotation_anim",
+                    mFancyRotationAnimationsPref.isChecked() ? 1 : 0);
         } else if (HAPTIC_FEEDBACK_PREF.equals(key)) {
             Settings.System.putInt(getContentResolver(),
                     Settings.System.HAPTIC_FEEDBACK_ENABLED,