diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 6637d7e..f6c7957 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1885,7 +1885,8 @@
                 android:label="@string/development_settings_title"
                 android:icon="@drawable/ic_settings_development"
                 android:taskAffinity="com.android.settings"
-                android:parentActivityName="Settings">
+                android:parentActivityName="Settings"
+                android:enabled="false">
             <intent-filter android:priority="1">
                 <action android:name="android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
                 <action android:name="com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 3eb6d3d..0ce9075 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2120,7 +2120,7 @@
     <!-- Wallpaper settings fragment title [CHAR LIMIT=30] -->
     <string name="wallpaper_settings_fragment_title">Choose wallpaper from</string>
     <!-- Display settings screen, trigger for screen saver options -->
-    <string name="screensaver_settings_title">Daydream</string>
+    <string name="screensaver_settings_title">Screen saver</string>
     <!-- Display settings screen, summary fragment for screen saver options, activated when docked or asleep and charging -->
     <string name="screensaver_settings_summary_either_long">When docked or asleep and charging</string>
     <!-- Dream settings screen, dialog option, activated when docked or asleep and charging -->
@@ -2132,9 +2132,9 @@
     <!-- Display settings screen, summary for screen saver options, screen saver is turned off -->
     <string name="screensaver_settings_summary_off">Off</string>
     <!-- Dream settings screen, caption for when dreams are disabled -->
-    <string name="screensaver_settings_disabled_prompt">To control what happens when the phone is docked and/or sleeping, turn Daydream on.</string>
+    <string name="screensaver_settings_disabled_prompt">To control what happens when the phone is docked and/or sleeping, turn screen saver on.</string>
     <!-- Dream settings screen, action label, when to dream -->
-    <string name="screensaver_settings_when_to_dream">When to daydream</string>
+    <string name="screensaver_settings_when_to_dream">When to turn screen saver on</string>
     <!-- Dream settings screen, button label to start dreaming -->
     <string name="screensaver_settings_dream_start">Start now</string>
     <!-- Dream settings screen, button label for settings for a specific screensaver -->
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 53c97b5..616fe39 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -1096,8 +1096,7 @@
             enabled = false;
         }
         int state = pm.getComponentEnabledSetting(component);
-        boolean isEnabled = state == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
-                || state == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
+        boolean isEnabled = state == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
         if (isEnabled != enabled) {
             pm.setComponentEnabledSetting(component, enabled
                     ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index e0a2844..1a3c850 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -187,9 +187,7 @@
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
-        if (!TextUtils.isEmpty(mHelpUri)) {
-            setHasOptionsMenu(true);
-        }
+        setHasOptionsMenu(true);
     }
 
     @Override
diff --git a/src/com/android/settings/dashboard/SummaryLoader.java b/src/com/android/settings/dashboard/SummaryLoader.java
index 55d97df..780d68e 100644
--- a/src/com/android/settings/dashboard/SummaryLoader.java
+++ b/src/com/android/settings/dashboard/SummaryLoader.java
@@ -16,8 +16,14 @@
 package com.android.settings.dashboard;
 
 import android.app.Activity;
+import android.content.BroadcastReceiver;
 import android.content.ComponentName;
-import android.os.*;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Looper;
+import android.os.Message;
 import android.os.Process;
 import android.util.ArrayMap;
 import android.util.Log;
@@ -45,6 +51,7 @@
 
     private DashboardAdapter mAdapter;
     private boolean mListening;
+    private ArrayList<BroadcastReceiver> mReceivers = new ArrayList<>();
 
     public SummaryLoader(Activity activity, List<DashboardCategory> categories) {
         mHandler = new Handler();
@@ -88,6 +95,14 @@
     }
 
     public void setListening(boolean listening) {
+        synchronized (mReceivers) {
+            // Unregister listeners immediately.
+            mListening = false;
+            for (int i = 0; i < mReceivers.size(); i++) {
+                mActivity.unregisterReceiver(mReceivers.get(i));
+            }
+            mReceivers.clear();
+        }
         mWorker.obtainMessage(Worker.MSG_SET_LISTENING, listening ? 1 : 0, 0).sendToTarget();
     }
 
@@ -128,13 +143,28 @@
         return tile.metaData;
     }
 
+    /**
+     * Registers a receiver and automatically unregisters it when the activity is stopping.
+     * This ensures that the receivers are unregistered immediately, since most summary loader
+     * operations are asynchronous.
+     */
+    public void registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
+        synchronized (mReceivers) {
+            if (!mListening) {
+                return;
+            }
+            mReceivers.add(receiver);
+            mActivity.registerReceiver(receiver, filter);
+        }
+    }
+
     private synchronized void setListeningW(boolean listening) {
         if (mListening == listening) return;
         if (DEBUG) Log.d(TAG, "Listening " + listening);
+        mListening = listening;
         for (SummaryProvider p : mSummaryMap.keySet()) {
             p.setListening(listening);
         }
-        mListening = listening;
     }
 
     private synchronized void makeProviderW(Tile tile) {
diff --git a/src/com/android/settings/datausage/AppDataUsage.java b/src/com/android/settings/datausage/AppDataUsage.java
index 037614e..0bd0615 100644
--- a/src/com/android/settings/datausage/AppDataUsage.java
+++ b/src/com/android/settings/datausage/AppDataUsage.java
@@ -54,7 +54,8 @@
 import static android.net.NetworkPolicyManager.POLICY_NONE;
 import static android.net.NetworkPolicyManager.POLICY_REJECT_METERED_BACKGROUND;
 
-public class AppDataUsage extends DataUsageBase implements Preference.OnPreferenceChangeListener {
+public class AppDataUsage extends DataUsageBase implements Preference.OnPreferenceChangeListener,
+        DataSaverBackend.Listener {
 
     public static final String ARG_APP_ITEM = "app_item";
     public static final String ARG_NETWORK_TEMPLATE = "network_template";
@@ -207,6 +208,7 @@
     @Override
     public void onResume() {
         super.onResume();
+        mDataSaverBackend.addListener(this);
         mPolicy = services.mPolicyEditor.getPolicy(mTemplate);
         getLoaderManager().restartLoader(LOADER_CHART_DATA,
                 ChartDataLoader.buildArgs(mTemplate, mAppItem), mChartDataCallbacks);
@@ -214,10 +216,15 @@
     }
 
     @Override
+    public void onPause() {
+        super.onPause();
+        mDataSaverBackend.remListener(this);
+    }
+
+    @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
         if (preference == mRestrictBackground) {
             mDataSaverBackend.setIsBlacklisted(mAppItem.key, mPackageName, !(Boolean) newValue);
-            updatePrefs();        // TODO: should have been notified by NPMS instead
             return true;
         } else if (preference == mUnrestrictedData) {
             mDataSaverBackend.setIsWhitelisted(mAppItem.key, mPackageName, (Boolean) newValue);
@@ -238,15 +245,19 @@
     }
 
     private void updatePrefs() {
+        updatePrefs(getAppRestrictBackground(), getUnrestrictData());
+    }
+
+    private void updatePrefs(boolean restrictBackground, boolean unrestrictData) {
         if (mRestrictBackground != null) {
-            mRestrictBackground.setChecked(!getAppRestrictBackground());
+            mRestrictBackground.setChecked(!restrictBackground);
         }
         if (mUnrestrictedData != null) {
-            if (getAppRestrictBackground()) {
+            if (restrictBackground) {
                 mUnrestrictedData.setVisible(false);
             } else {
                 mUnrestrictedData.setVisible(true);
-                mUnrestrictedData.setChecked(mDataSaverBackend.isWhitelisted(mAppItem.key));
+                mUnrestrictedData.setChecked(unrestrictData);
             }
         }
     }
@@ -288,6 +299,10 @@
         return (uidPolicy & POLICY_REJECT_METERED_BACKGROUND) != 0;
     }
 
+    private boolean getUnrestrictData() {
+        return mDataSaverBackend.isWhitelisted(mAppItem.key);
+    }
+
     @Override
     public void onViewCreated(View view, Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
@@ -368,4 +383,23 @@
             }
         }
     }
+
+    @Override
+    public void onDataSaverChanged(boolean isDataSaving) {
+
+    }
+
+    @Override
+    public void onWhitelistStatusChanged(int uid, boolean isWhitelisted) {
+        if (mAppItem.uids.get(uid, false)) {
+            updatePrefs(getAppRestrictBackground(), isWhitelisted);
+        }
+    }
+
+    @Override
+    public void onBlacklistStatusChanged(int uid, boolean isBlacklisted) {
+        if (mAppItem.uids.get(uid, false)) {
+            updatePrefs(isBlacklisted, getUnrestrictData());
+        }
+    }
 }
diff --git a/src/com/android/settings/datausage/DataSaverBackend.java b/src/com/android/settings/datausage/DataSaverBackend.java
index 55521a8..eb62ad7 100644
--- a/src/com/android/settings/datausage/DataSaverBackend.java
+++ b/src/com/android/settings/datausage/DataSaverBackend.java
@@ -160,10 +160,46 @@
         }
     }
 
+    private void handleWhitelistChanged(int uid, boolean isWhitelisted) {
+        for (int i = 0; i < mListeners.size(); i++) {
+            mListeners.get(i).onWhitelistStatusChanged(uid, isWhitelisted);
+        }
+    }
+
+    private void handleBlacklistChanged(int uid, boolean isBlacklisted) {
+        for (int i = 0; i < mListeners.size(); i++) {
+            mListeners.get(i).onBlacklistStatusChanged(uid, isBlacklisted);
+        }
+    }
+
     private final INetworkPolicyListener mPolicyListener = new INetworkPolicyListener.Stub() {
         @Override
-        public void onUidRulesChanged(int uid, int uidRules) throws RemoteException {
-            // TODO: update UI accordingly
+        public void onUidRulesChanged(final int uid, int uidRules) throws RemoteException {
+            if (mBlacklist == null) {
+                loadBlacklist();
+            }
+            final boolean isBlacklisted = uidRules == POLICY_REJECT_METERED_BACKGROUND;
+            mBlacklist.put(uid, isBlacklisted);
+            mHandler.post(new Runnable() {
+                @Override
+                public void run() {
+                    handleBlacklistChanged(uid, isBlacklisted);
+                }
+            });
+        }
+
+        @Override
+        public void onRestrictBackgroundWhitelistChanged(final int uid, final boolean whitelisted) {
+            if (mWhitelist == null) {
+                loadWhitelist();
+            }
+            mWhitelist.put(uid, whitelisted);
+            mHandler.post(new Runnable() {
+                @Override
+                public void run() {
+                    handleWhitelistChanged(uid, whitelisted);
+                }
+            });
         }
 
         @Override
@@ -183,5 +219,7 @@
 
     public interface Listener {
         void onDataSaverChanged(boolean isDataSaving);
+        void onWhitelistStatusChanged(int uid, boolean isWhitelisted);
+        void onBlacklistStatusChanged(int uid, boolean isBlacklisted);
     }
 }
diff --git a/src/com/android/settings/datausage/DataSaverPreference.java b/src/com/android/settings/datausage/DataSaverPreference.java
index c286d95..13ef9d7 100644
--- a/src/com/android/settings/datausage/DataSaverPreference.java
+++ b/src/com/android/settings/datausage/DataSaverPreference.java
@@ -44,4 +44,12 @@
     public void onDataSaverChanged(boolean isDataSaving) {
         setSummary(isDataSaving ? R.string.data_saver_on : R.string.data_saver_off);
     }
+
+    @Override
+    public void onWhitelistStatusChanged(int uid, boolean isWhitelisted) {
+    }
+
+    @Override
+    public void onBlacklistStatusChanged(int uid, boolean isBlacklisted) {
+    }
 }
diff --git a/src/com/android/settings/datausage/DataSaverSummary.java b/src/com/android/settings/datausage/DataSaverSummary.java
index 591f2c5..8dfbad5 100644
--- a/src/com/android/settings/datausage/DataSaverSummary.java
+++ b/src/com/android/settings/datausage/DataSaverSummary.java
@@ -100,6 +100,14 @@
     }
 
     @Override
+    public void onWhitelistStatusChanged(int uid, boolean isWhitelisted) {
+    }
+
+    @Override
+    public void onBlacklistStatusChanged(int uid, boolean isBlacklisted) {
+    }
+
+    @Override
     public void onExtraInfoUpdated() {
         if (!isAdded()) {
             return;
diff --git a/src/com/android/settings/datausage/UnrestrictedDataAccess.java b/src/com/android/settings/datausage/UnrestrictedDataAccess.java
index 650b0b2..740fe06 100644
--- a/src/com/android/settings/datausage/UnrestrictedDataAccess.java
+++ b/src/com/android/settings/datausage/UnrestrictedDataAccess.java
@@ -41,7 +41,8 @@
 import java.util.ArrayList;
 
 public class UnrestrictedDataAccess extends SettingsPreferenceFragment
-        implements ApplicationsState.Callbacks, AppStateBaseBridge.Callback, Preference.OnPreferenceChangeListener {
+        implements ApplicationsState.Callbacks, AppStateBaseBridge.Callback,
+        Preference.OnPreferenceChangeListener {
 
     private static final int MENU_SHOW_SYSTEM = Menu.FIRST + 42;
     private static final String EXTRA_SHOW_SYSTEM = "show_system";
@@ -214,7 +215,7 @@
         return false;
     }
 
-    private class AccessPreference extends SwitchPreference {
+    private class AccessPreference extends SwitchPreference implements DataSaverBackend.Listener {
         private final AppEntry mEntry;
         private final DataUsageState mState;
 
@@ -230,6 +231,18 @@
         }
 
         @Override
+        public void onAttached() {
+            super.onAttached();
+            mDataSaverBackend.addListener(this);
+        }
+
+        @Override
+        public void onDetached() {
+            mDataSaverBackend.remListener(this);
+            super.onDetached();
+        }
+
+        @Override
         protected void onClick() {
             if (mState.isDataSaverBlacklisted) {
                 // app is blacklisted, launch App Data Usage screen
@@ -246,17 +259,13 @@
         // Sets UI state based on whitelist/blacklist status.
         private void setState() {
             setTitle(mEntry.label);
-            // TODO: state is cached, so if blacklist/whitelist changes, it's not updated.
-            // For example, if the initial state is blacklisted, the user taps the preference,
-            // removes the blacklist, and then taps back, the state is not refreshed.
-            // The proper fix for this problem is to implement onUidRulesChanged() on
-            // DataSaverBackend and update the UI accordingly.
             if (mState != null) {
                 setChecked(mState.isDataSaverWhitelisted);
                 if (mState.isDataSaverBlacklisted) {
                     setSummary(R.string.restrict_background_blacklisted);
+                } else {
+                    setSummary("");
                 }
-                // TODO: might need to reset summary once it listens to onUidRulesChanged()
             }
         }
 
@@ -280,9 +289,30 @@
                 });
             }
             holder.findViewById(android.R.id.widget_frame)
-                    .setVisibility(mState.isDataSaverBlacklisted ? View.INVISIBLE : View.VISIBLE);
+                    .setVisibility(mState != null && mState.isDataSaverBlacklisted
+                            ? View.INVISIBLE : View.VISIBLE);
             super.onBindViewHolder(holder);
         }
+
+        @Override
+        public void onDataSaverChanged(boolean isDataSaving) {
+        }
+
+        @Override
+        public void onWhitelistStatusChanged(int uid, boolean isWhitelisted) {
+            if (mState != null && mEntry.info.uid == uid) {
+                mState.isDataSaverWhitelisted = isWhitelisted;
+                reuse();
+            }
+        }
+
+        @Override
+        public void onBlacklistStatusChanged(int uid, boolean isBlacklisted) {
+            if (mState != null && mEntry.info.uid == uid) {
+                mState.isDataSaverBlacklisted = isBlacklisted;
+                reuse();
+            }
+        }
     }
 
 }
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
index 5f5975d..66026eb 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
@@ -326,6 +326,12 @@
     }
 
     @Override
+    public void onAttach(Context context) {
+        super.onAttach(context);
+        mDetached = false;
+    }
+
+    @Override
     public void onDetach() {
         super.onDetach();
         mDetached = true;
diff --git a/src/com/android/settings/deviceinfo/SimStatus.java b/src/com/android/settings/deviceinfo/SimStatus.java
index 80dfc58..0acad37 100644
--- a/src/com/android/settings/deviceinfo/SimStatus.java
+++ b/src/com/android/settings/deviceinfo/SimStatus.java
@@ -151,7 +151,7 @@
             mSir = mSelectableSubInfos.size() > 0 ? mSelectableSubInfos.get(0) : null;
 
             if (mSelectableSubInfos.size() > 1) {
-                setContentView(com.android.internal.R.layout.common_tab_settings);
+                setContentView(R.layout.icc_lock_tabs);
 
                 mTabHost = (TabHost) findViewById(android.R.id.tabhost);
                 mTabWidget = (TabWidget) findViewById(android.R.id.tabs);
diff --git a/src/com/android/settings/deviceinfo/StorageSettings.java b/src/com/android/settings/deviceinfo/StorageSettings.java
index 9774db9..902ca07 100644
--- a/src/com/android/settings/deviceinfo/StorageSettings.java
+++ b/src/com/android/settings/deviceinfo/StorageSettings.java
@@ -248,6 +248,10 @@
             // Picked a normal volume
             final VolumeInfo vol = mStorageManager.findVolumeById(key);
 
+            if (vol == null) {
+                return false;
+            }
+
             if (vol.getState() == VolumeInfo.STATE_UNMOUNTED) {
                 VolumeUnmountedFragment.show(this, vol.getId());
                 return true;
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 08e27ec..8eb1759 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -28,7 +28,6 @@
 import android.content.pm.PackageManager;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 import android.net.NetworkInfo.State;
@@ -39,15 +38,12 @@
 import android.os.Bundle;
 import android.os.HandlerThread;
 import android.os.Process;
-import android.os.RemoteException;
-import android.os.UserHandle;
 import android.provider.Settings;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceViewHolder;
 import android.text.Spannable;
 import android.text.style.TextAppearanceSpan;
 import android.util.Log;
-import android.util.TypedValue;
 import android.view.ContextMenu;
 import android.view.ContextMenu.ContextMenuInfo;
 import android.view.Menu;
@@ -58,7 +54,6 @@
 import android.widget.TextView;
 import android.widget.TextView.BufferType;
 import android.widget.Toast;
-
 import com.android.internal.logging.MetricsLogger;
 import com.android.internal.logging.MetricsProto.MetricsEvent;
 import com.android.settings.LinkifyUtils;
@@ -999,9 +994,7 @@
                 filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
                 filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
                 filter.addAction(WifiManager.RSSI_CHANGED_ACTION);
-                mContext.registerReceiver(this, filter);
-            } else {
-                mContext.unregisterReceiver(this);
+                mSummaryLoader.registerReceiver(this, filter);
             }
         }
 
