diff --git a/src/com/android/settings/core/BasePreferenceController.java b/src/com/android/settings/core/BasePreferenceController.java
index 391dafc..fd17012 100644
--- a/src/com/android/settings/core/BasePreferenceController.java
+++ b/src/com/android/settings/core/BasePreferenceController.java
@@ -72,8 +72,6 @@
 
     protected final String mPreferenceKey;
 
-    protected Lifecycle mLifecycle;
-
     /**
      * Instantiate a controller as specified controller type and user-defined key.
      * <p/>
diff --git a/src/com/android/settings/datausage/DataUsageSummary.java b/src/com/android/settings/datausage/DataUsageSummary.java
index ccfcff1..f0c2549 100644
--- a/src/com/android/settings/datausage/DataUsageSummary.java
+++ b/src/com/android/settings/datausage/DataUsageSummary.java
@@ -155,7 +155,7 @@
         final Activity activity = getActivity();
         final ArrayList<AbstractPreferenceController> controllers = new ArrayList<>();
         mSummaryController =
-                new DataUsageSummaryPreferenceController(context, this, activity);
+                new DataUsageSummaryPreferenceController(activity, getLifecycle(), this);
         controllers.add(mSummaryController);
         getLifecycle().addObserver(mSummaryController);
         return controllers;
diff --git a/src/com/android/settings/datausage/DataUsageSummaryPreferenceController.java b/src/com/android/settings/datausage/DataUsageSummaryPreferenceController.java
index 7fea16d..dea71fe 100644
--- a/src/com/android/settings/datausage/DataUsageSummaryPreferenceController.java
+++ b/src/com/android/settings/datausage/DataUsageSummaryPreferenceController.java
@@ -37,6 +37,7 @@
 import android.util.RecurrenceRule;
 
 import com.android.internal.util.CollectionUtils;
+import android.support.v7.widget.RecyclerView;
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
 import com.android.settings.core.PreferenceControllerMixin;
@@ -63,8 +64,10 @@
     private static final float RELATIVE_SIZE_LARGE = 1.25f * 1.25f;  // (1/0.8)^2
     private static final float RELATIVE_SIZE_SMALL = 1.0f / RELATIVE_SIZE_LARGE;  // 0.8^2
 
-    private final Fragment mFragment;
     private final Activity mActivity;
+    private final EntityHeaderController mEntityHeaderController;
+    private final Lifecycle mLifecycle;
+    private final DataUsageSummary mDataUsageSummary;
     private final DataUsageController mDataUsageController;
     private final DataUsageInfoController mDataInfoController;
     private final NetworkTemplate mDefaultTemplate;
@@ -96,27 +99,30 @@
 
     private Intent mManageSubscriptionIntent;
 
-    public DataUsageSummaryPreferenceController(Context context, Fragment fragment,
-            Activity activity) {
-        super(context, KEY);
+    public DataUsageSummaryPreferenceController(Activity activity,
+            Lifecycle lifecycle, DataUsageSummary dataUsageSummary) {
+        super(activity, KEY);
 
-        mFragment = fragment;
         mActivity = activity;
+        mEntityHeaderController = EntityHeaderController.newInstance(activity,
+                dataUsageSummary, null);
+        mLifecycle = lifecycle;
+        mDataUsageSummary = dataUsageSummary;
 
-        final int defaultSubId = DataUsageUtils.getDefaultSubscriptionId(context);
-        mDefaultTemplate = DataUsageUtils.getDefaultTemplate(context, defaultSubId);
-        NetworkPolicyManager policyManager = NetworkPolicyManager.from(context);
+        final int defaultSubId = DataUsageUtils.getDefaultSubscriptionId(activity);
+        mDefaultTemplate = DataUsageUtils.getDefaultTemplate(activity, defaultSubId);
+        NetworkPolicyManager policyManager = NetworkPolicyManager.from(activity);
         mPolicyEditor = new NetworkPolicyEditor(policyManager);
 
-        mHasMobileData = DataUsageUtils.hasMobileData(context)
+        mHasMobileData = DataUsageUtils.hasMobileData(activity)
                 && defaultSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID;
 
-        mDataUsageController = new DataUsageController(context);
+        mDataUsageController = new DataUsageController(activity);
         mDataInfoController = new DataUsageInfoController();
 
         if (mHasMobileData) {
             mDataUsageTemplate = R.string.cell_data_template;
-        } else if (DataUsageUtils.hasWifiRadio(context)) {
+        } else if (DataUsageUtils.hasWifiRadio(activity)) {
             mDataUsageTemplate = R.string.wifi_data_template;
         } else {
             mDataUsageTemplate = R.string.ethernet_data_template;
@@ -128,15 +134,18 @@
 
     @VisibleForTesting
     DataUsageSummaryPreferenceController(
-            Context context,
             DataUsageController dataUsageController,
             DataUsageInfoController dataInfoController,
             NetworkTemplate defaultTemplate,
             NetworkPolicyEditor policyEditor,
             int dataUsageTemplate,
             boolean hasMobileData,
-            SubscriptionManager subscriptionManager) {
-        super(context, KEY);
+            SubscriptionManager subscriptionManager,
+            Activity activity,
+            Lifecycle lifecycle,
+            EntityHeaderController entityHeaderController,
+            DataUsageSummary dataUsageSummary) {
+        super(activity, KEY);
         mDataUsageController = dataUsageController;
         mDataInfoController = dataInfoController;
         mDefaultTemplate = defaultTemplate;
@@ -144,13 +153,17 @@
         mDataUsageTemplate = dataUsageTemplate;
         mHasMobileData = hasMobileData;
         mSubscriptionManager = subscriptionManager;
-        mFragment = null;
-        mActivity = null;
+        mActivity = activity;
+        mLifecycle = lifecycle;
+        mEntityHeaderController = entityHeaderController;
+        mDataUsageSummary = dataUsageSummary;
     }
 
     @Override
     public void onStart() {
-        EntityHeaderController.newInstance(mActivity, mFragment, null).styleActionBar(mActivity);
+        RecyclerView view = mDataUsageSummary.getListView();
+        mEntityHeaderController.setRecyclerView(view, mLifecycle);
+        mEntityHeaderController.styleActionBar(mActivity);
     }
 
     @VisibleForTesting
diff --git a/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryPreferenceControllerTest.java
index 634fe65..cd7de00 100644
--- a/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryPreferenceControllerTest.java
@@ -25,27 +25,41 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
 import android.net.NetworkTemplate;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
+import com.android.settings.applications.AppInfoWithHeaderTest;
+import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
+import com.android.settings.widget.EntityHeaderController;
 import com.android.settingslib.NetworkPolicyEditor;
+import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.net.DataUsageController;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.mockito.Answers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
+import org.robolectric.Robolectric;
 import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
 
 import java.util.concurrent.TimeUnit;
 
+import android.support.v7.widget.RecyclerView;
+
 @RunWith(SettingsRobolectricTestRunner.class)
+@Config(shadows = ShadowEntityHeaderController.class)
 public class DataUsageSummaryPreferenceControllerTest {
 
     private static final long UPDATE_BACKOFF_MS = TimeUnit.MINUTES.toMillis(13);
@@ -68,7 +82,15 @@
     private NetworkTemplate mNetworkTemplate;
     @Mock
     private SubscriptionManager mSubscriptionManager;
+    @Mock
+    private Lifecycle mLifecycle;
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private EntityHeaderController mHeaderController;
+    @Mock
+    private DataUsageSummary mDataUsageSummary;
 
+    private FakeFeatureFactory mFactory;
+    private Activity mActivity;
     private Context mContext;
     private DataUsageSummaryPreferenceController mController;
 
@@ -79,15 +101,27 @@
 
         doReturn("%1$s %2%s").when(mContext)
             .getString(com.android.internal.R.string.fileSizeSuffix);
+
+        mActivity = Robolectric.setupActivity(Activity.class);
+        mFactory = FakeFeatureFactory.setupForTest();
+        when(mFactory.metricsFeatureProvider.getMetricsCategory(any(Object.class)))
+                .thenReturn(MetricsProto.MetricsEvent.SETTINGS_APP_NOTIF_CATEGORY);
+        ShadowEntityHeaderController.setUseMock(mHeaderController);
+
         mController = new DataUsageSummaryPreferenceController(
-                mContext,
                 mDataUsageController,
                 mDataInfoController,
                 mNetworkTemplate,
                 mPolicyEditor,
                 R.string.cell_data_template,
                 true,
-                null);
+                null,
+                mActivity, null, null, null);
+    }
+
+    @After
+    public void tearDown() {
+        ShadowEntityHeaderController.reset();
     }
 
     @Test
@@ -240,14 +274,14 @@
     @Test
     public void testMobileData_preferenceAvailable() {
         mController = new DataUsageSummaryPreferenceController(
-                mContext,
                 mDataUsageController,
                 mDataInfoController,
                 mNetworkTemplate,
                 mPolicyEditor,
                 R.string.cell_data_template,
                 true,
-                mSubscriptionManager);
+                mSubscriptionManager,
+                mActivity, null, null, null);
 
         final SubscriptionInfo subInfo = new SubscriptionInfo(0, "123456", 0, "name", "carrier",
                 0, 0, "number", 0, null, 123, 456, "ZX");
@@ -258,19 +292,42 @@
     @Test
     public void testMobileData_preferenceDisabled() {
         mController = new DataUsageSummaryPreferenceController(
-                mContext,
                 mDataUsageController,
                 mDataInfoController,
                 mNetworkTemplate,
                 mPolicyEditor,
                 R.string.cell_data_template,
                 true,
-                mSubscriptionManager);
+                mSubscriptionManager,
+                mActivity, null, null, null);
 
         when(mSubscriptionManager.getDefaultDataSubscriptionInfo()).thenReturn(null);
         assertThat(mController.getAvailabilityStatus()).isEqualTo(DISABLED_UNSUPPORTED);
     }
 
+    @Test
+    public void testMobileData_entityHeaderSet() {
+        final RecyclerView recyclerView = new RecyclerView(mActivity);
+
+        mController = new DataUsageSummaryPreferenceController(
+                mDataUsageController,
+                mDataInfoController,
+                mNetworkTemplate,
+                mPolicyEditor,
+                R.string.cell_data_template,
+                true,
+                mSubscriptionManager,
+                mActivity, mLifecycle, mHeaderController, mDataUsageSummary);
+
+        when(mDataUsageSummary.getListView()).thenReturn(recyclerView);
+
+        mController.onStart();
+
+        verify(mHeaderController)
+                .setRecyclerView(any(RecyclerView.class), any(Lifecycle.class));
+        verify(mHeaderController).styleActionBar(any(Activity.class));
+    }
+
     private DataUsageController.DataUsageInfo createTestDataUsageInfo(long now) {
         DataUsageController.DataUsageInfo info = new DataUsageController.DataUsageInfo();
         info.carrier = CARRIER_NAME;
