diff --git a/res/drawable-nodpi/gesture_ambient_lift b/res/drawable-nodpi/gesture_ambient_lift
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/res/drawable-nodpi/gesture_ambient_lift
diff --git a/res/drawable-nodpi/gesture_ambient_tap b/res/drawable-nodpi/gesture_ambient_tap
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/res/drawable-nodpi/gesture_ambient_tap
diff --git a/res/drawable-nodpi/gesture_double_tap b/res/drawable-nodpi/gesture_double_tap
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/res/drawable-nodpi/gesture_double_tap
diff --git a/res/drawable-nodpi/gesture_fingerprint_swipe b/res/drawable-nodpi/gesture_fingerprint_swipe
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/res/drawable-nodpi/gesture_fingerprint_swipe
diff --git a/res/drawable-nodpi/gesture_twist b/res/drawable-nodpi/gesture_twist
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/res/drawable-nodpi/gesture_twist
diff --git a/res/layout/gesture_preference.xml b/res/layout/gesture_preference.xml
index d5685ea..ccbc42a 100644
--- a/res/layout/gesture_preference.xml
+++ b/res/layout/gesture_preference.xml
@@ -74,6 +74,7 @@
                 android:id="@+id/gesture_image"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
+                android:scaleType="fitXY"
                 android:background="@color/gestures_setting_background_color"/>
 
             <ImageView
diff --git a/res/layout/support_tile.xml b/res/layout/support_tile.xml
index e5e49f4..e294868 100644
--- a/res/layout/support_tile.xml
+++ b/res/layout/support_tile.xml
@@ -34,7 +34,7 @@
         android:id="@+id/tile_title"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:singleLine="true"
+        android:maxLines="2"
         android:textAppearance="@style/TextAppearance.TileTitle"
         android:ellipsize="end"
         android:fadingEdge="horizontal"/>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 218d7f2..6df41d2 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -139,6 +139,7 @@
     <!-- For GesturePreference -->
     <declare-styleable name="GesturePreference">
         <attr name="animation" format="reference" />
+        <attr name="preview" format="reference" />
     </declare-styleable>
 
     <!-- For AspectRatioFrameLayout -->
diff --git a/res/values/config.xml b/res/values/config.xml
index 6d56e18..75d8697 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -52,17 +52,10 @@
     <string name="gesture_double_twist_sensor_name" translatable="false"></string>
     <string name="gesture_double_twist_sensor_vendor" translatable="false"></string>
 
-    <!-- Pickup sensor name and vendor used by gesture setting -->
-    <string name="gesture_pickup_sensor_name" translatable="false"></string>
-    <string name="gesture_pickup_sensor_vendor" translatable="false"></string>
-
     <!-- When true enable gesture setting. -->
     <bool name="config_gesture_settings_enabled">false</bool>
 
     <!-- If the Storage Manager settings are enabled. -->
     <bool name="config_storage_manager_settings_enabled">false</bool>
 
-    <!-- When true show double-tap gesture setting. -->
-    <bool name="config_gesture_double_tap_settings_enabled">false</bool>
-
 </resources>
diff --git a/res/values/themes.xml b/res/values/themes.xml
index 0009bed..ffe802e 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -124,6 +124,7 @@
 
     <style name="SetupWizardAccessibilitySwitchBarTheme" parent="ThemeOverlay.SwitchBar.Settings">
         <item name="switchBarBackgroundColor">@color/material_blue_500</item>
+        <item name="android:colorControlActivated">@android:color/white</item>
     </style>
 
     <!-- Theme with no local references, used by AccountPreferenceBase where we have to inflate
diff --git a/res/xml/gesture_settings.xml b/res/xml/gesture_settings.xml
index af365bf..8954916 100644
--- a/res/xml/gesture_settings.xml
+++ b/res/xml/gesture_settings.xml
@@ -23,30 +23,35 @@
         android:key="gesture_swipe_down_fingerprint"
         android:title="@string/fingerprint_swipe_for_notifications_title"
         android:summary="@string/fingerprint_swipe_for_notifications_summary"
-        settings:animation="@raw/gesture_fingerprint_swipe"/>
+        settings:animation="@raw/gesture_fingerprint_swipe"
+        settings:preview="@drawable/gesture_fingerprint_swipe"/>
 
     <com.android.settings.gestures.GesturePreference
         android:key="gesture_double_tap_power"
         android:title="@string/double_tap_power_for_camera_title"
         android:summary="@string/double_tap_power_for_camera_summary"
-        settings:animation="@raw/gesture_double_tap"/>
+        settings:animation="@raw/gesture_double_tap"
+        settings:preview="@drawable/gesture_double_tap"/>
 
     <com.android.settings.gestures.GesturePreference
         android:key="gesture_double_twist"
         android:title="@string/double_twist_for_camera_mode_title"
         android:summary="@string/double_twist_for_camera_mode_summary"
-        settings:animation="@raw/gesture_twist"/>
+        settings:animation="@raw/gesture_twist"
+        settings:preview="@drawable/gesture_twist"/>
 
     <com.android.settings.gestures.GesturePreference
         android:key="gesture_double_tap_screen"
         android:title="@string/ambient_display_title"
         android:summary="@string/ambient_display_summary"
-        settings:animation="@raw/gesture_ambient_tap"/>
+        settings:animation="@raw/gesture_ambient_tap"
+        settings:preview="@drawable/gesture_ambient_tap"/>
 
     <com.android.settings.gestures.GesturePreference
         android:key="gesture_pick_up"
         android:title="@string/ambient_display_pickup_title"
         android:summary="@string/ambient_display_pickup_summary"
-        settings:animation="@raw/gesture_ambient_lift"/>
+        settings:animation="@raw/gesture_ambient_lift"
+        settings:preview="@drawable/gesture_ambient_lift"/>
 
 </PreferenceScreen>
\ No newline at end of file
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
index dd8064f..de62f92 100644
--- a/src/com/android/settings/DeviceInfoSettings.java
+++ b/src/com/android/settings/DeviceInfoSettings.java
@@ -277,6 +277,13 @@
                         Toast.LENGTH_LONG);
                 mDevHitToast.show();
             }
+        } else if (preference.getKey().equals(KEY_SECURITY_PATCH)) {
+            if (getPackageManager().queryIntentActivities(preference.getIntent(), 0).isEmpty()) {
+                // Don't send out the intent to stop crash
+                Log.w(LOG_TAG, "Stop click action on " + KEY_SECURITY_PATCH + ": "
+                        + "queryIntentActivities() returns empty" );
+                return true;
+            }
         } else if (preference.getKey().equals(KEY_DEVICE_FEEDBACK)) {
             sendFeedback();
         } else if(preference.getKey().equals(KEY_SYSTEM_UPDATE_SETTINGS)) {
diff --git a/src/com/android/settings/datausage/CellDataPreference.java b/src/com/android/settings/datausage/CellDataPreference.java
index b6daa4a..510d8a1 100644
--- a/src/com/android/settings/datausage/CellDataPreference.java
+++ b/src/com/android/settings/datausage/CellDataPreference.java
@@ -111,11 +111,10 @@
     @Override
     protected void performClick(View view) {
         MetricsLogger.action(getContext(), MetricsEvent.ACTION_CELL_DATA_TOGGLE, !mChecked);
+        final SubscriptionInfo currentSir = mSubscriptionManager.getActiveSubscriptionInfo(
+                mSubId);
+        final SubscriptionInfo nextSir = mSubscriptionManager.getDefaultDataSubscriptionInfo();
         if (mChecked) {
-            final SubscriptionInfo currentSir = mSubscriptionManager.getActiveSubscriptionInfo(
-                    mSubId);
-            final SubscriptionInfo nextSir = mSubscriptionManager.getDefaultDataSubscriptionInfo();
-
             // If the device is single SIM or is enabling data on the active data SIM then forgo
             // the pop-up.
             if (!Utils.showSimCardTile(getContext()) ||
@@ -136,6 +135,12 @@
             // If we are showing the Sim Card tile then we are a Multi-Sim device.
             if (Utils.showSimCardTile(getContext())) {
                 mMultiSimDialog = true;
+                if (nextSir != null && currentSir != null &&
+                        currentSir.getSubscriptionId() == nextSir.getSubscriptionId()) {
+                    setMobileDataEnabled(true);
+                    disableDataForOtherSubscriptions(mSubId);
+                    return;
+                }
                 super.performClick(view);
             } else {
                 setMobileDataEnabled(true);
diff --git a/src/com/android/settings/datausage/DataUsageSummary.java b/src/com/android/settings/datausage/DataUsageSummary.java
index fb05699..af7b92c 100644
--- a/src/com/android/settings/datausage/DataUsageSummary.java
+++ b/src/com/android/settings/datausage/DataUsageSummary.java
@@ -77,6 +77,11 @@
     private int mDataUsageTemplate;
 
     @Override
+    protected int getHelpResource() {
+        return R.string.help_url_data_usage;
+    }
+
+    @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
 
diff --git a/src/com/android/settings/gestures/GesturePreference.java b/src/com/android/settings/gestures/GesturePreference.java
index 4536aa2..5a64a5a 100644
--- a/src/com/android/settings/gestures/GesturePreference.java
+++ b/src/com/android/settings/gestures/GesturePreference.java
@@ -14,18 +14,12 @@
 
 package com.android.settings.gestures;
 
-import android.app.LoaderManager;
 import android.content.ContentResolver;
 import android.content.Context;
-import android.content.Loader;
 import android.content.res.TypedArray;
-import android.graphics.Bitmap;
-import android.graphics.drawable.BitmapDrawable;
 import android.graphics.SurfaceTexture;
-import android.media.MediaMetadataRetriever;
 import android.media.MediaPlayer;
 import android.net.Uri;
-import android.os.Bundle;
 import android.support.v14.preference.SwitchPreference;
 import android.support.v7.preference.PreferenceViewHolder;
 import android.view.View;
@@ -36,15 +30,13 @@
 import android.util.Log;
 
 import com.android.settings.R;
-import com.android.settings.utils.AsyncLoader;
 
 /**
  * Preference item for a gesture with a switch to signify if it should be enabled.
  * This shows the title and description of the gesture along with an animation showing how to do
  * the gesture
  */
-public final class GesturePreference extends SwitchPreference implements
-        LoaderManager.LoaderCallbacks<Bitmap> {
+public final class GesturePreference extends SwitchPreference {
     private static final String TAG = "GesturePreference";
     private final Context mContext;
 
@@ -53,7 +45,7 @@
     private boolean mAnimationAvailable;
     private boolean mVideoReady;
     private boolean mScrolling;
-    private BitmapDrawable mPreviewImage;
+    private int mPreviewResource;
 
     public GesturePreference(Context context, AttributeSet attrs) {
         super(context, attrs);
@@ -71,6 +63,10 @@
             mMediaPlayer = MediaPlayer.create(mContext, mVideoPath);
             if (mMediaPlayer != null && mMediaPlayer.getDuration() > 0) {
                 setLayoutResource(R.layout.gesture_preference);
+
+                mPreviewResource = attributes.getResourceId(
+                        R.styleable.GesturePreference_preview, 0);
+
                 mMediaPlayer.setOnSeekCompleteListener(new MediaPlayer.OnSeekCompleteListener() {
                     @Override
                     public void onSeekComplete(MediaPlayer mp) {
@@ -103,6 +99,7 @@
 
         final TextureView video = (TextureView) holder.findViewById(R.id.gesture_video);
         final ImageView imageView = (ImageView) holder.findViewById(R.id.gesture_image);
+        imageView.setImageResource(mPreviewResource);
         final ImageView playButton = (ImageView) holder.findViewById(R.id.gesture_play_button);
 
         video.setOnClickListener(new View.OnClickListener() {
@@ -138,9 +135,6 @@
 
             @Override
             public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
-                if (mPreviewImage != null && imageView.getDrawable() == null) {
-                    imageView.setImageDrawable(mPreviewImage);
-                }
                 imageView.setVisibility(View.VISIBLE);
                 return false;
             }
@@ -156,13 +150,13 @@
                         playButton.setVisibility(View.VISIBLE);
                     }
                 }
+                if (mMediaPlayer != null && !mMediaPlayer.isPlaying() &&
+                        playButton.getVisibility() != View.VISIBLE) {
+                    playButton.setVisibility(View.VISIBLE);
+                }
             }
         });
 
-        if (mPreviewImage != null) {
-            imageView.setImageDrawable(mPreviewImage);
-        }
-
     }
 
     @Override
@@ -179,63 +173,16 @@
         mScrolling = scrolling;
     }
 
-    void loadPreview(LoaderManager manager, int id) {
-        if (mAnimationAvailable) {
-            Loader<Bitmap> loader = manager.initLoader(id, Bundle.EMPTY, this);
-        }
-    }
-
     void onViewVisible() {
         if (mVideoReady && mMediaPlayer != null && !mMediaPlayer.isPlaying()) {
             mMediaPlayer.seekTo(0);
         }
     }
 
-    private static final class PreviewRetriever extends AsyncLoader<Bitmap> {
-        private Uri mVideoPath;
-
-        public PreviewRetriever(Context context, Uri videoPath) {
-            super(context);
-            mVideoPath = videoPath;
+    void onViewInvisible() {
+        if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
+            mMediaPlayer.pause();
         }
-
-        @Override
-        public Bitmap loadInBackground() {
-            MediaMetadataRetriever mediaMetadata = new MediaMetadataRetriever();
-            try {
-                mediaMetadata.setDataSource(getContext(), mVideoPath);
-                return mediaMetadata.getFrameAtTime(0);
-            } catch (Exception e) {
-                Log.w(TAG, "Unable to get animation preview.");
-            } finally {
-                mediaMetadata.release();
-            }
-            return null;
-        }
-
-        @Override
-        public void onDiscardResult(final Bitmap result) {
-            if (result != null && !result.isRecycled()) {
-                result.recycle();
-            }
-        }
-
-    }
-
-    @Override
-    public Loader<Bitmap> onCreateLoader(int id, Bundle args) {
-        return new PreviewRetriever(mContext, mVideoPath);
-    }
-
-    @Override
-    public void onLoadFinished(final Loader<Bitmap> loader, final Bitmap bitmap) {
-        if (bitmap != null) {
-            mPreviewImage = new BitmapDrawable(mContext.getResources(), bitmap);
-        }
-    }
-
-    @Override
-    public void onLoaderReset(Loader<Bitmap> loader) {
     }
 
 }
diff --git a/src/com/android/settings/gestures/GestureSettings.java b/src/com/android/settings/gestures/GestureSettings.java
index 14df471..c03c5e1 100644
--- a/src/com/android/settings/gestures/GestureSettings.java
+++ b/src/com/android/settings/gestures/GestureSettings.java
@@ -20,9 +20,8 @@
 import android.content.res.Resources;
 import android.hardware.Sensor;
 import android.hardware.SensorManager;
-import android.os.Build;
 import android.os.Bundle;
-import android.os.SystemProperties;
+import android.os.UserHandle;
 import android.provider.SearchIndexableResource;
 import android.provider.Settings.Secure;
 import android.support.v7.preference.Preference;
@@ -32,6 +31,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 
+import com.android.internal.hardware.AmbientDisplayConfiguration;
 import com.android.internal.logging.MetricsProto.MetricsEvent;
 import com.android.settings.R;
 import com.android.settings.search.BaseSearchIndexProvider;
@@ -56,14 +56,11 @@
     private static final String PREF_KEY_SWIPE_DOWN_FINGERPRINT = "gesture_swipe_down_fingerprint";
     private static final String PREF_KEY_DOUBLE_TAP_SCREEN = "gesture_double_tap_screen";
     private static final String DEBUG_DOZE_COMPONENT = "debug.doze.component";
-    private static final int PREF_ID_DOUBLE_TAP_POWER = 0;
-    private static final int PREF_ID_DOUBLE_TWIST = 1;
-    private static final int PREF_ID_PICK_UP = 2;
-    private static final int PREF_ID_SWIPE_DOWN_FINGERPRINT = 3;
-    private static final int PREF_ID_DOUBLE_TAP_SCREEN = 4;
 
     private List<GesturePreference> mPreferences;
 
+    private AmbientDisplayConfiguration mAmbientConfig;
+
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -75,30 +72,29 @@
         if (isCameraDoubleTapPowerGestureAvailable(getResources())) {
             int cameraDisabled = Secure.getInt(
                     getContentResolver(), Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 0);
-            addPreference(PREF_KEY_DOUBLE_TAP_POWER, cameraDisabled == 0, PREF_ID_DOUBLE_TAP_POWER);
+            addPreference(PREF_KEY_DOUBLE_TAP_POWER, cameraDisabled == 0);
         } else {
             removePreference(PREF_KEY_DOUBLE_TAP_POWER);
         }
 
         // Ambient Display
-        boolean dozeEnabled = isDozeAvailable(context);
-        if (dozeEnabled && isPickupAvailable(context)) {
-            int pickup = Secure.getInt(getContentResolver(), Secure.DOZE_PULSE_ON_PICK_UP, 1);
-            addPreference(PREF_KEY_PICK_UP, pickup != 0, PREF_ID_PICK_UP);
+        mAmbientConfig = new AmbientDisplayConfiguration(context);
+        if (mAmbientConfig.pulseOnPickupAvailable()) {
+            boolean pickup = mAmbientConfig.pulseOnPickupEnabled(UserHandle.myUserId());
+            addPreference(PREF_KEY_PICK_UP, pickup);
         } else {
             removePreference(PREF_KEY_PICK_UP);
         }
-        if (dozeEnabled && isDoubleTapAvailable(context)) {
-            int doubleTap = Secure.getInt(getContentResolver(), Secure.DOZE_PULSE_ON_DOUBLE_TAP, 1);
-            addPreference(PREF_KEY_DOUBLE_TAP_SCREEN, doubleTap != 0, PREF_ID_DOUBLE_TAP_SCREEN);
+        if (mAmbientConfig.pulseOnDoubleTapAvailable()) {
+            boolean doubleTap = mAmbientConfig.pulseOnDoubleTapEnabled(UserHandle.myUserId());
+            addPreference(PREF_KEY_DOUBLE_TAP_SCREEN, doubleTap);
         } else {
             removePreference(PREF_KEY_DOUBLE_TAP_SCREEN);
         }
 
         // Fingerprint slide for notifications
         if (isSystemUINavigationAvailable(context)) {
-            addPreference(PREF_KEY_SWIPE_DOWN_FINGERPRINT, isSystemUINavigationEnabled(context),
-                    PREF_ID_SWIPE_DOWN_FINGERPRINT);
+            addPreference(PREF_KEY_SWIPE_DOWN_FINGERPRINT, isSystemUINavigationEnabled(context));
         } else {
             removePreference(PREF_KEY_SWIPE_DOWN_FINGERPRINT);
         }
@@ -107,7 +103,7 @@
         if (isDoubleTwistAvailable(context)) {
             int doubleTwistEnabled = Secure.getInt(
                     getContentResolver(), Secure.CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, 1);
-            addPreference(PREF_KEY_DOUBLE_TWIST, doubleTwistEnabled != 0, PREF_ID_DOUBLE_TWIST);
+            addPreference(PREF_KEY_DOUBLE_TWIST, doubleTwistEnabled != 0);
         } else {
             removePreference(PREF_KEY_DOUBLE_TWIST);
         }
@@ -149,6 +145,14 @@
     }
 
     @Override
+    public void onStop() {
+        super.onStop();
+        for (GesturePreference preference : mPreferences) {
+            preference.onViewInvisible();
+        }
+    }
+
+    @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
         boolean enabled = (boolean) newValue;
         String key = preference.getKey();
@@ -184,15 +188,6 @@
                 com.android.internal.R.bool.config_cameraDoubleTapPowerGestureEnabled);
     }
 
-    private static boolean isDozeAvailable(Context context) {
-        String name = Build.IS_DEBUGGABLE ? SystemProperties.get(DEBUG_DOZE_COMPONENT) : null;
-        if (TextUtils.isEmpty(name)) {
-            name = context.getResources().getString(
-                    com.android.internal.R.string.config_dozeComponent);
-        }
-        return !TextUtils.isEmpty(name);
-    }
-
     private static boolean isSystemUINavigationAvailable(Context context) {
         return context.getResources().getBoolean(
                 com.android.internal.R.bool.config_supportSystemNavigationKeys);
@@ -208,11 +203,6 @@
                 R.string.gesture_double_twist_sensor_vendor);
     }
 
-    private static boolean isPickupAvailable(Context context) {
-        return hasSensor(context, R.string.gesture_pickup_sensor_name,
-                R.string.gesture_pickup_sensor_vendor);
-    }
-
     private static boolean hasSensor(Context context, int nameResId, int vendorResId) {
         Resources resources = context.getResources();
         String name = resources.getString(nameResId);
@@ -229,16 +219,10 @@
         return false;
     }
 
-    private static boolean isDoubleTapAvailable(Context context) {
-        return context.getResources().getBoolean(
-                R.bool.config_gesture_double_tap_settings_enabled);
-    }
-
-    private void addPreference(String key, boolean enabled, int id) {
+    private void addPreference(String key, boolean enabled) {
         GesturePreference preference = (GesturePreference) findPreference(key);
         preference.setChecked(enabled);
         preference.setOnPreferenceChangeListener(this);
-        preference.loadPreview(getLoaderManager(), id);
         mPreferences.add(preference);
     }
 
@@ -260,13 +244,15 @@
             @Override
             public List<String> getNonIndexableKeys(Context context) {
                 ArrayList<String> result = new ArrayList<String>();
+                AmbientDisplayConfiguration ambientConfig
+                        = new AmbientDisplayConfiguration(context);
                 if (!isCameraDoubleTapPowerGestureAvailable(context.getResources())) {
                     result.add(PREF_KEY_DOUBLE_TAP_POWER);
                 }
-                if (!isDozeAvailable(context) || !isPickupAvailable(context)) {
+                if (!ambientConfig.pulseOnPickupAvailable()) {
                     result.add(PREF_KEY_PICK_UP);
                 }
-                if (!isDozeAvailable(context) || !isDoubleTapAvailable(context)) {
+                if (!ambientConfig.pulseOnDoubleTapAvailable()) {
                     result.add(PREF_KEY_DOUBLE_TAP_SCREEN);
                 }
                 if (!isSystemUINavigationAvailable(context)) {
