Merge "Fix phone muted conditional card not show up"
diff --git a/color-check-baseline.xml b/color-check-baseline.xml
index 3672e2d..365cbe7 100644
--- a/color-check-baseline.xml
+++ b/color-check-baseline.xml
@@ -1253,11 +1253,27 @@
         priority="4"
         summary="Using hardcoded color"
         explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.
This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
+            errorLine1="    <color name="homepage_privacy_background">#1A73E8</color>"
+            errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+        file="res/values/colors.xml"
+        line="130"
+        column="5"/>
+    </issue>
+
+    <issue
+        id="HardCodedColor"
+        severity="Error"
+        message="Avoid using hardcoded color"
+        category="Correctness"
+        priority="4"
+        summary="Using hardcoded color"
+        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
         errorLine1="    &lt;color name=&quot;battery_good_color_light&quot;>#43a047&lt;/color> &lt;!-- Material Green 600 -->"
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="134"
+            line="135"
             column="5"/>
     </issue>
 
@@ -1273,7 +1289,7 @@
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="135"
+            line="136"
             column="5"/>
     </issue>
 
@@ -1289,7 +1305,7 @@
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="136"
+            line="137"
             column="5"/>
     </issue>
 
@@ -1305,7 +1321,7 @@
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="137"
+            line="138"
             column="5"/>
     </issue>
 
@@ -1321,7 +1337,7 @@
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="138"
+            line="139"
             column="5"/>
     </issue>
 
@@ -1337,7 +1353,7 @@
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="139"
+            line="140"
             column="5"/>
     </issue>
 
@@ -1353,7 +1369,7 @@
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="142"
+            line="143"
             column="5"/>
     </issue>
 
@@ -1369,7 +1385,7 @@
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="143"
+            line="144"
             column="5"/>
     </issue>
 
@@ -1385,7 +1401,7 @@
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="144"
+            line="145"
             column="5"/>
     </issue>
 
@@ -1401,7 +1417,7 @@
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="145"
+            line="146"
             column="5"/>
     </issue>
 
@@ -1417,7 +1433,7 @@
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
             file="res/values/colors.xml"
-            line="146"
+            line="147"
             column="5"/>
     </issue>
 
@@ -1912,6 +1928,22 @@
         errorLine1="                android:color=&quot;@color/homepage_location_background&quot; />"
         errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
+            file="res/drawable/ic_homepage_privacy.xml"
+            line="23"
+            column="17"/>
+    </issue>
+
+    <issue
+        id="HardCodedColor"
+        severity="Error"
+        message="Avoid using hardcoded color"
+        category="Correctness"
+        priority="4"
+        summary="Using hardcoded color"
+        explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
+        errorLine1="                android:color=&quot;@color/homepage_location_background&quot; />"
+        errorLine2="                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
             file="res/drawable/ic_homepage_location.xml"
             line="23"
             column="17"/>
diff --git a/res/drawable/ic_homepage_privacy.xml b/res/drawable/ic_homepage_privacy.xml
new file mode 100644
index 0000000..eec3c94
--- /dev/null
+++ b/res/drawable/ic_homepage_privacy.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2018 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.
+  -->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item>
+        <shape android:shape="oval">
+            <solid
+                android:color="@color/homepage_privacy_background"/>
+            <size
+                android:width="@dimen/dashboard_tile_image_size"
+                android:height="@dimen/dashboard_tile_image_size"/>
+        </shape>
+    </item>
+
+    <item
+        android:width="@dimen/dashboard_tile_foreground_image_size"
+        android:height="@dimen/dashboard_tile_foreground_image_size"
+        android:start="@dimen/dashboard_tile_foreground_image_inset"
+        android:top="@dimen/dashboard_tile_foreground_image_inset"
+        android:drawable="@drawable/ic_settings_privacy"/>
+</layer-list>
diff --git a/res/drawable/ic_settings_privacy.xml b/res/drawable/ic_settings_privacy.xml
new file mode 100644
index 0000000..fcad83a
--- /dev/null
+++ b/res/drawable/ic_settings_privacy.xml
@@ -0,0 +1,31 @@
+<!--
+  Copyright (C) 2018 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.
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:fillColor="#FFFFFFFF"
+      android:pathData="M21.25,16.5v-0.66c0,-1.13 -1.03,-2.09 -2.25,-2.09s-2.25,0.96 -2.25,2.09v0.66H16V22h6v-5.5H21.25zM19.75,16.5h-1.5v-0.66c0,-0.29 0.38,-0.59 0.75,-0.59s0.75,0.3 0.75,0.59V16.5z"/>
+  <path
+      android:fillColor="#FFFFFFFF"
+      android:pathData="M12,17c-3.79,0 -7.17,-2.13 -8.82,-5.5C4.83,8.13 8.21,6 12,6s7.17,2.13 8.82,5.5H23C21.27,7.11 17,4 12,4S2.73,7.11 1,11.5C2.73,15.89 7,19 12,19c0.68,0 1.35,-0.06 2,-0.17v-2.05C13.35,16.91 12.69,17 12,17z"/>
+  <path
+      android:fillColor="#FFFFFFFF"
+      android:pathData="M16.43,12.23c0.04,-0.24 0.07,-0.48 0.07,-0.73C16.5,9.02 14.48,7 12,7s-4.5,2.02 -4.5,4.5S9.52,16 12,16c0.77,0 1.48,-0.21 2.12,-0.55C14.41,14.08 15.27,12.93 16.43,12.23zM12,14.2c-1.49,0 -2.7,-1.21 -2.7,-2.7s1.21,-2.7 2.7,-2.7s2.7,1.21 2.7,2.7S13.49,14.2 12,14.2z"/>
+</vector>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 11c1aaf..f55eb1a 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -127,6 +127,7 @@
     <color name="homepage_generic_icon_background">#1A73E8</color>
     <color name="homepage_location_background">#2EC7DC</color>
     <color name="homepage_about_background">#9FA8DA</color>
+    <color name="homepage_privacy_background">#5E97F6</color>
     <!-- End of dashboard/homepage icon background colors -->
 
     <color name="glif_error_color">@*android:color/material_red_A700</color>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f30c63d..9e5cb2a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -6658,6 +6658,8 @@
     <string name="help_url_auto_brightness" translatable="false" />
     <!-- Help URL, Previously connected bluetooth devices [DO NOT TRANSLATE] -->
     <string name="help_url_previously_connected_devices" translatable="false"></string>
+    <!-- Help URL, Top level privacy settings [DO NOT TRANSLATE] -->
+    <string name="help_url_privacy_dashboard" translatable="false"></string>
 
     <string name="help_url_network_dashboard" translatable="false"></string>
     <string name="help_url_connected_devices" translatable="false"></string>
@@ -10278,4 +10280,10 @@
     <string name="force_desktop_mode">Force desktop mode</string>
     <!-- UI debug setting: force desktop mode summary [CHAR LIMIT=NONE] -->
     <string name="force_desktop_mode_summary">Force experimental desktop mode on secondary displays</string>
+
+    <!-- Title for the top level Privacy Settings [CHAR LIMIT=30]-->
+    <string name="privacy_dashboard_title">Privacy</string>
+    <!-- Summary for the top level Privacy Settings [CHAR LIMIT=NONE]-->
+    <string name="privacy_dashboard_summary">Permission, permission usage</string>
+
 </resources>
diff --git a/res/xml/privacy_dashboard_settings.xml b/res/xml/privacy_dashboard_settings.xml
new file mode 100644
index 0000000..5d11936
--- /dev/null
+++ b/res/xml/privacy_dashboard_settings.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2018 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"
+    xmlns:settings="http://schemas.android.com/apk/res-auto"
+    android:key="privacy_dashboard_page"
+    android:title="@string/privacy_dashboard_title">
+
+    <Preference
+        android:key="privacy_manage_perms"
+        android:title="@string/app_permissions"
+        settings:keywords="@string/keywords_app_permissions"
+        settings:controller="com.android.settings.applications.AppPermissionsPreferenceController">
+        <intent android:action="android.intent.action.MANAGE_PERMISSIONS"/>
+    </Preference>
+
+    <SwitchPreference
+        android:key="show_password"
+        android:title="@string/show_password"
+        android:summary="@string/show_password_summary"
+        settings:controller="com.android.settings.security.ShowPasswordPreferenceController"/>
+
+    <!-- Privacy Service -->
+    <PreferenceCategory
+        android:key="privacy_services"/>
+
+    <PreferenceCategory
+        android:key="dashboard_tile_placeholder"/>
+
+</PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/security_dashboard_settings.xml b/res/xml/security_dashboard_settings.xml
index ce271cc..38bc2d0 100644
--- a/res/xml/security_dashboard_settings.xml
+++ b/res/xml/security_dashboard_settings.xml
@@ -89,20 +89,6 @@
 
     </PreferenceCategory>
 
-    <!-- security_settings_misc.xml -->
-    <PreferenceCategory
-        android:order="30"
-        android:key="security_settings_misc_category"
-        android:title="@string/security_passwords_title">
-
-        <SwitchPreference
-            android:key="show_password"
-            android:title="@string/show_password"
-            android:summary="@string/show_password_summary"
-            settings:controller="com.android.settings.security.ShowPasswordPreferenceController" />
-
-    </PreferenceCategory>
-
     <PreferenceCategory
         android:order="40"
         android:key="security_settings_device_admin_category">
diff --git a/res/xml/top_level_settings.xml b/res/xml/top_level_settings.xml
index 69c4bb8..03e32dc 100644
--- a/res/xml/top_level_settings.xml
+++ b/res/xml/top_level_settings.xml
@@ -83,6 +83,14 @@
         settings:controller="com.android.settings.deviceinfo.TopLevelStoragePreferenceController"/>
 
     <Preference
+        android:key="top_level_privacy"
+        android:title="@string/privacy_dashboard_title"
+        android:summary="@string/privacy_dashboard_summary"
+        android:icon="@drawable/ic_homepage_privacy"
+        android:order="-55"
+        android:fragment="com.android.settings.privacy.PrivacyDashboardFragment"/>
+
+    <Preference
         android:key="top_level_location"
         android:title="@string/location_settings_title"
         android:summary="@string/location_settings_summary"
diff --git a/src/com/android/settings/applications/appinfo/AppSettingPreferenceController.java b/src/com/android/settings/applications/appinfo/AppSettingPreferenceController.java
index f5ce18e..c08ae75 100644
--- a/src/com/android/settings/applications/appinfo/AppSettingPreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/AppSettingPreferenceController.java
@@ -18,6 +18,7 @@
 
 import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_OPEN_APP_SETTING;
 
+import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.ResolveInfo;
@@ -61,8 +62,10 @@
             return false;
         }
         FeatureFactory.getFactory(mContext).getMetricsFeatureProvider()
-                .actionWithSource(mContext, mParent.getMetricsCategory(),
-                        ACTION_OPEN_APP_SETTING);
+                .action(SettingsEnums.PAGE_UNKNOWN,
+                        ACTION_OPEN_APP_SETTING,
+                        mParent.getMetricsCategory(),
+                        null, 0);
         mContext.startActivity(intent);
         return true;
     }
diff --git a/src/com/android/settings/core/SubSettingLauncher.java b/src/com/android/settings/core/SubSettingLauncher.java
index 1df6bb9..fb730b8 100644
--- a/src/com/android/settings/core/SubSettingLauncher.java
+++ b/src/com/android/settings/core/SubSettingLauncher.java
@@ -28,7 +28,7 @@
 
 import com.android.settings.SettingsActivity;
 import com.android.settings.SubSettings;
-import com.android.settingslib.core.instrumentation.VisibilityLoggerMixin;
+import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
 public class SubSettingLauncher {
 
@@ -150,7 +150,7 @@
         if (mLaunchRequest.sourceMetricsCategory < 0) {
             throw new IllegalArgumentException("Source metrics category must be set");
         }
-        intent.putExtra(VisibilityLoggerMixin.EXTRA_SOURCE_METRICS_CATEGORY,
+        intent.putExtra(MetricsFeatureProvider.EXTRA_SOURCE_METRICS_CATEGORY,
                 mLaunchRequest.sourceMetricsCategory);
 
         intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS, mLaunchRequest.arguments);
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index f61cb0c..7ba3688 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -112,6 +112,7 @@
 import com.android.settings.password.ChooseLockPattern;
 import com.android.settings.print.PrintJobSettingsFragment;
 import com.android.settings.print.PrintSettingsFragment;
+import com.android.settings.privacy.PrivacyDashboardFragment;
 import com.android.settings.security.CryptKeeperSettings;
 import com.android.settings.security.LockscreenDashboardFragment;
 import com.android.settings.security.SecuritySettings;
@@ -167,6 +168,7 @@
             ProcessStatsUi.class.getName(),
             NotificationStation.class.getName(),
             LocationSettings.class.getName(),
+            PrivacyDashboardFragment.class.getName(),
             ScanningSettings.class.getName(),
             SecuritySettings.class.getName(),
             UsageAccessDetails.class.getName(),
diff --git a/src/com/android/settings/core/instrumentation/StatsLogWriter.java b/src/com/android/settings/core/instrumentation/StatsLogWriter.java
index 453d9e4..ed711bb 100644
--- a/src/com/android/settings/core/instrumentation/StatsLogWriter.java
+++ b/src/com/android/settings/core/instrumentation/StatsLogWriter.java
@@ -45,7 +45,7 @@
                 0 /* changedPreferenceIntValue */);
     }
 
-    @Override
+   @Override
     public void action(Context context, int action, Pair<Integer, Object>... taggedData) {
         action(SettingsEnums.PAGE_UNKNOWN /* attribution */,
                 action,
@@ -55,15 +55,6 @@
     }
 
     @Override
-    public void actionWithSource(Context context, int pageId, int action) {
-        action(SettingsEnums.PAGE_UNKNOWN /* attribution */,
-                action,
-                pageId /* pageId */,
-                null /* changedPreferenceKey */,
-                0 /* changedPreferenceIntValue */);
-    }
-
-    @Override
     public void action(Context context, int action, int value) {
         action(SettingsEnums.PAGE_UNKNOWN /* attribution */,
                 action,
diff --git a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
index 2267311..2a6bb38 100644
--- a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
+++ b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
@@ -45,7 +45,6 @@
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.widget.RoundedHomepageIcon;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
-import com.android.settingslib.core.instrumentation.VisibilityLoggerMixin;
 import com.android.settingslib.drawer.DashboardCategory;
 import com.android.settingslib.drawer.Tile;
 import com.android.settingslib.drawer.TileUtils;
@@ -126,7 +125,7 @@
             pref.setFragment(clsName);
         } else {
             final Intent intent = new Intent(tile.getIntent());
-            intent.putExtra(VisibilityLoggerMixin.EXTRA_SOURCE_METRICS_CATEGORY,
+            intent.putExtra(MetricsFeatureProvider.EXTRA_SOURCE_METRICS_CATEGORY,
                     sourceMetricsCategory);
             if (action != null) {
                 intent.setAction(action);
@@ -160,7 +159,7 @@
             return;
         }
         final Intent intent = new Intent(tile.getIntent())
-                .putExtra(VisibilityLoggerMixin.EXTRA_SOURCE_METRICS_CATEGORY,
+                .putExtra(MetricsFeatureProvider.EXTRA_SOURCE_METRICS_CATEGORY,
                         MetricsEvent.DASHBOARD_SUMMARY)
                 .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
         launchIntentOrSelectProfile(activity, tile, intent, MetricsEvent.DASHBOARD_SUMMARY);
diff --git a/src/com/android/settings/dashboard/DashboardFragment.java b/src/com/android/settings/dashboard/DashboardFragment.java
index 0cda9ee..56e9ee5 100644
--- a/src/com/android/settings/dashboard/DashboardFragment.java
+++ b/src/com/android/settings/dashboard/DashboardFragment.java
@@ -16,6 +16,7 @@
 package com.android.settings.dashboard;
 
 import android.app.Activity;
+import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.drawable.Icon;
@@ -211,8 +212,9 @@
 
     @Override
     public void onExpandButtonClick() {
-        mMetricsFeatureProvider.actionWithSource(getContext(), getMetricsCategory(),
-                MetricsEvent.ACTION_SETTINGS_ADVANCED_BUTTON_EXPAND);
+        mMetricsFeatureProvider.action(SettingsEnums.PAGE_UNKNOWN,
+                MetricsEvent.ACTION_SETTINGS_ADVANCED_BUTTON_EXPAND,
+                getMetricsCategory(), null, 0);
     }
 
     protected boolean shouldForceRoundedIcon() {
diff --git a/src/com/android/settings/dashboard/DashboardFragmentRegistry.java b/src/com/android/settings/dashboard/DashboardFragmentRegistry.java
index 4c371dd..8b5d521 100644
--- a/src/com/android/settings/dashboard/DashboardFragmentRegistry.java
+++ b/src/com/android/settings/dashboard/DashboardFragmentRegistry.java
@@ -36,6 +36,7 @@
 import com.android.settings.notification.ConfigureNotificationSettings;
 import com.android.settings.notification.SoundSettings;
 import com.android.settings.notification.ZenModeSettings;
+import com.android.settings.privacy.PrivacyDashboardFragment;
 import com.android.settings.security.LockscreenDashboardFragment;
 import com.android.settings.security.SecuritySettings;
 import com.android.settings.system.SystemDashboardFragment;
@@ -104,6 +105,8 @@
                 CategoryKey.CATEGORY_GESTURES);
         PARENT_TO_CATEGORY_KEY_MAP.put(NightDisplaySettings.class.getName(),
                 CategoryKey.CATEGORY_NIGHT_DISPLAY);
+        PARENT_TO_CATEGORY_KEY_MAP.put(PrivacyDashboardFragment.class.getName(),
+                CategoryKey.CATEGORY_PRIVACY);
 
         CATEGORY_KEY_TO_PARENT_MAP = new ArrayMap<>(PARENT_TO_CATEGORY_KEY_MAP.size());
 
diff --git a/src/com/android/settings/privacy/PrivacyDashboardFragment.java b/src/com/android/settings/privacy/PrivacyDashboardFragment.java
new file mode 100644
index 0000000..e3cd457
--- /dev/null
+++ b/src/com/android/settings/privacy/PrivacyDashboardFragment.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2018 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.
+ */
+
+package com.android.settings.privacy;
+
+import android.content.Context;
+import android.provider.SearchIndexableResource;
+
+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.settings.R;
+import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.security.ShowPasswordPreferenceController;
+import com.android.settingslib.core.AbstractPreferenceController;
+import com.android.settingslib.search.SearchIndexable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@SearchIndexable
+public class PrivacyDashboardFragment extends DashboardFragment {
+    private static final String TAG = "PrivacyDashboardFragment";
+
+    @Override
+    public int getMetricsCategory() {
+        return MetricsEvent.TOP_LEVEL_PRIVACY;
+    }
+
+    @Override
+    protected String getLogTag() {
+        return TAG;
+    }
+
+    @Override
+    protected int getPreferenceScreenResId() {
+        return R.xml.privacy_dashboard_settings;
+    }
+
+    @Override
+    public int getHelpResource() {
+        return R.string.help_url_privacy_dashboard;
+    }
+
+    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
+                        boolean enabled) {
+                    final ArrayList<SearchIndexableResource> result = new ArrayList<>();
+
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.privacy_dashboard_settings;
+                    result.add(sir);
+                    return result;
+                }
+            };
+}
diff --git a/src/com/android/settings/security/SecuritySettings.java b/src/com/android/settings/security/SecuritySettings.java
index e00d387..aa347c8 100644
--- a/src/com/android/settings/security/SecuritySettings.java
+++ b/src/com/android/settings/security/SecuritySettings.java
@@ -108,7 +108,6 @@
         controllers.add(new ManageTrustAgentsPreferenceController(context));
         controllers.add(new ScreenPinningPreferenceController(context));
         controllers.add(new SimLockPreferenceController(context));
-        controllers.add(new ShowPasswordPreferenceController(context));
         controllers.add(new EncryptionStatusPreferenceController(context,
                 PREF_KEY_ENCRYPTION_SECURITY_PAGE));
         controllers.add(new TrustAgentListPreferenceController(context, host, lifecycle));
diff --git a/src/com/android/settings/widget/EntityHeaderController.java b/src/com/android/settings/widget/EntityHeaderController.java
index b24a75b..5e83819 100644
--- a/src/com/android/settings/widget/EntityHeaderController.java
+++ b/src/com/android/settings/widget/EntityHeaderController.java
@@ -23,6 +23,7 @@
 import android.annotation.UserIdInt;
 import android.app.ActionBar;
 import android.app.Activity;
+import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageInfo;
@@ -355,14 +356,13 @@
                 if (mAppNotifPrefIntent == null) {
                     button.setVisibility(View.GONE);
                 } else {
-                    button.setOnClickListener(new View.OnClickListener() {
-                        @Override
-                        public void onClick(View v) {
-                            FeatureFactory.getFactory(mAppContext).getMetricsFeatureProvider()
-                                    .actionWithSource(mAppContext, mMetricsCategory,
-                                            ACTION_OPEN_APP_NOTIFICATION_SETTING);
-                            mFragment.startActivity(mAppNotifPrefIntent);
-                        }
+                    button.setOnClickListener(v -> {
+                        FeatureFactory.getFactory(mAppContext).getMetricsFeatureProvider()
+                                .action(SettingsEnums.PAGE_UNKNOWN,
+                                        ACTION_OPEN_APP_NOTIFICATION_SETTING,
+                                        mMetricsCategory,
+                                        null, 0);
+                        mFragment.startActivity(mAppNotifPrefIntent);
                     });
                     button.setVisibility(View.VISIBLE);
                 }
diff --git a/tests/robotests/src/com/android/settings/core/SubSettingLauncherTest.java b/tests/robotests/src/com/android/settings/core/SubSettingLauncherTest.java
index fd3b4a0..d33d3fe 100644
--- a/tests/robotests/src/com/android/settings/core/SubSettingLauncherTest.java
+++ b/tests/robotests/src/com/android/settings/core/SubSettingLauncherTest.java
@@ -35,7 +35,7 @@
 
 import com.android.settings.SettingsActivity;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settingslib.core.instrumentation.VisibilityLoggerMixin;
+import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -103,7 +103,7 @@
         assertThat(intent.getStringExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT))
                 .isEqualTo(SubSettingLauncherTest.class.getName());
         assertThat(intent.getFlags()).isEqualTo(Intent.FLAG_ACTIVITY_NEW_TASK);
-        assertThat(intent.getIntExtra(VisibilityLoggerMixin.EXTRA_SOURCE_METRICS_CATEGORY, -1))
+        assertThat(intent.getIntExtra(MetricsFeatureProvider.EXTRA_SOURCE_METRICS_CATEGORY, -1))
                 .isEqualTo(123);
     }
 
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java
index 634bdb7..d083a38 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java
@@ -59,7 +59,7 @@
 import com.android.settings.testutils.shadow.ShadowThreadUtils;
 import com.android.settings.testutils.shadow.ShadowTileUtils;
 import com.android.settings.testutils.shadow.ShadowUserManager;
-import com.android.settingslib.core.instrumentation.VisibilityLoggerMixin;
+import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 import com.android.settingslib.drawer.CategoryKey;
 import com.android.settingslib.drawer.Tile;
 import com.android.settingslib.drawer.TileUtils;
@@ -338,7 +338,7 @@
         final Intent launchIntent = shadowActivity.getNextStartedActivityForResult().intent;
         assertThat(launchIntent.getAction())
                 .isEqualTo("TestAction");
-        assertThat(launchIntent.getIntExtra(VisibilityLoggerMixin.EXTRA_SOURCE_METRICS_CATEGORY, 0))
+        assertThat(launchIntent.getIntExtra(MetricsFeatureProvider.EXTRA_SOURCE_METRICS_CATEGORY, 0))
                 .isEqualTo(MetricsEvent.SETTINGS_GESTURES);
     }
 
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
index 8e9480d..1215463 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
@@ -15,6 +15,8 @@
  */
 package com.android.settings.dashboard;
 
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.DASHBOARD_CONTAINER;
+
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.ArgumentMatchers.nullable;
@@ -25,6 +27,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.pm.ActivityInfo;
 import android.os.Bundle;
@@ -185,9 +188,9 @@
                 = mFakeFeatureFactory.getMetricsFeatureProvider();
         mTestFragment.onExpandButtonClick();
 
-        verify(metricsFeatureProvider).actionWithSource(
-                RuntimeEnvironment.application, MetricsEvent.DASHBOARD_CONTAINER,
-                MetricsEvent.ACTION_SETTINGS_ADVANCED_BUTTON_EXPAND);
+        verify(metricsFeatureProvider).action(SettingsEnums.PAGE_UNKNOWN,
+                MetricsEvent.ACTION_SETTINGS_ADVANCED_BUTTON_EXPAND,
+                DASHBOARD_CONTAINER, null, 0);
     }
 
     public static class TestPreferenceController extends AbstractPreferenceController
@@ -243,7 +246,7 @@
 
         @Override
         public int getMetricsCategory() {
-            return MetricsEvent.DASHBOARD_CONTAINER;
+            return DASHBOARD_CONTAINER;
         }
 
         @Override