Merge "Replace png to vector drawable"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index e220b62..a0f66d1 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2730,7 +2730,7 @@
             android:launchMode="singleTop"
             android:taskAffinity=".wifi.NetworkRequestDialogActivity"
             android:exported="true"
-            android:permission="android.permission.NETWORK_SETTINGS">
+            android:permission="android.permission.MAINLINE_WIFI_STACK">
             <intent-filter>
                 <action android:name="com.android.settings.wifi.action.NETWORK_REQUEST" />
                 <category android:name="android.intent.category.DEFAULT" />
diff --git a/res/layout/night_display_activation_button.xml b/res/layout/night_display_activation_button.xml
index b0bfe86..df160ec 100644
--- a/res/layout/night_display_activation_button.xml
+++ b/res/layout/night_display_activation_button.xml
@@ -15,10 +15,11 @@
   limitations under the License.
   -->
 
-<FrameLayout
+<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight">
 
     <Button
         android:id="@+id/night_display_turn_on_button"
@@ -26,7 +27,7 @@
         android:layout_marginStart="@dimen/screen_margin_sides"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_gravity="start" />
+        android:layout_gravity="center_vertical" />
 
     <Button
         android:id="@+id/night_display_turn_off_button"
@@ -34,6 +35,6 @@
         android:layout_marginStart="@dimen/screen_margin_sides"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_gravity="start" />
+        android:layout_gravity="center_vertical" />
 
-</FrameLayout>
\ No newline at end of file
+</LinearLayout>
\ No newline at end of file
diff --git a/res/xml/data_saver.xml b/res/xml/data_saver.xml
index 19944e2..e884d6d 100644
--- a/res/xml/data_saver.xml
+++ b/res/xml/data_saver.xml
@@ -27,4 +27,10 @@
         android:fragment="com.android.settings.datausage.UnrestrictedDataAccess"
         settings:controller="com.android.settings.applications.specialaccess.DataSaverController" />
 
+    <com.android.settingslib.widget.FooterPreference
+        android:key="data_saver_footer"
+        android:title="@*android:string/data_saver_description"
+        android:selectable="false"
+        settings:searchable="false"/>
+
 </PreferenceScreen>
diff --git a/res/xml/mobile_network_settings_v2.xml b/res/xml/mobile_network_settings_v2.xml
index a22826f..31a5ef7 100644
--- a/res/xml/mobile_network_settings_v2.xml
+++ b/res/xml/mobile_network_settings_v2.xml
@@ -34,7 +34,7 @@
         <com.android.settings.datausage.DataUsageSummaryPreference
             android:key="status_header"
             android:visibility="gone"
-            android:selectable="false" />
+            android:selectable="false"/>
 
         <ListPreference
             android:key="calls_preference"
@@ -203,16 +203,15 @@
         android:key="erase_sim"
         android:persistent="false"
         android:title="@string/mobile_network_erase_sim"
-        settings:controller="com.android.settings.network.telephony.DeleteSimProfilePreferenceController" />
+        settings:allowDividerBelow="true"
+        settings:controller="com.android.settings.network.telephony.DeleteSimProfilePreferenceController"/>
 
-    <PreferenceCategory
-        android:key="footer_container"
-        android:title="@string/summary_placeholder"
-        android:layout="@layout/preference_category_no_label"
-        settings:controller="com.android.settings.network.telephony.DisableSimFooterPreferenceController">
-        <com.android.settingslib.widget.FooterPreference
-            android:key="disable_sim_explanation"
-            android:title="@string/mobile_network_disable_sim_explanation" />
-    </PreferenceCategory>
+    <com.android.settingslib.widget.FooterPreference
+        android:key="disable_sim_explanation"
+        android:title="@string/mobile_network_disable_sim_explanation"
+        android:selectable="false"
+        settings:allowDividerAbove="true"
+        settings:searchable="false"
+        settings:controller="com.android.settings.network.telephony.DisableSimFooterPreferenceController"/>
 
 </PreferenceScreen>
diff --git a/res/xml/night_display_settings.xml b/res/xml/night_display_settings.xml
index 4bccacf..343ee42 100644
--- a/res/xml/night_display_settings.xml
+++ b/res/xml/night_display_settings.xml
@@ -49,15 +49,16 @@
         android:title="@string/night_display_title"
         android:selectable="false"
         android:layout="@layout/night_display_activation_button"
+        settings:allowDividerBelow="true"
         settings:keywords="@string/keywords_display_night_display"
         settings:controller="com.android.settings.display.NightDisplayActivationPreferenceController"/>
 
-    <PreferenceCategory android:key="night_display_footer_category">
-        <com.android.settingslib.widget.FooterPreference
-            android:key="night_display_footer"
-            android:title="@string/night_display_text"
-            android:selectable="false"
-            settings:controller="com.android.settings.display.NightDisplayFooterPreferenceController"/>
-    </PreferenceCategory>
+    <com.android.settingslib.widget.FooterPreference
+        android:key="night_display_footer"
+        android:title="@string/night_display_text"
+        android:selectable="false"
+        settings:allowDividerAbove="true"
+        settings:searchable="false"
+        settings:controller="com.android.settings.display.NightDisplayFooterPreferenceController"/>
 
 </PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/security_settings_picker.xml b/res/xml/security_settings_picker.xml
index 2e6361a..e772c38 100644
--- a/res/xml/security_settings_picker.xml
+++ b/res/xml/security_settings_picker.xml
@@ -15,6 +15,7 @@
 -->
 
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+                  xmlns:settings="http://schemas.android.com/apk/res-auto"
         android:title="@string/lock_settings_picker_title"
         android:key="lock_settings_picker">
 
@@ -57,4 +58,9 @@
             android:title="@string/face_unlock_skip_face"
             android:persistent="false"/>
 
+    <com.android.settingslib.widget.FooterPreference
+            android:key="lock_settings_footer"
+            android:selectable="false"
+            settings:searchable="false"/>
+
 </PreferenceScreen>
diff --git a/res/xml/tether_prefs.xml b/res/xml/tether_prefs.xml
index 70a57d7..3f9b8c8 100644
--- a/res/xml/tether_prefs.xml
+++ b/res/xml/tether_prefs.xml
@@ -44,4 +44,10 @@
         android:summary="@string/tether_settings_disabled_on_data_saver"
         android:selectable="false"
         settings:allowDividerAbove="true" />
+
+    <com.android.settingslib.widget.FooterPreference
+        android:key="tether_prefs_footer"
+        android:title="@string/tethering_footer_info"
+        android:selectable="false"
+        settings:searchable="false"/>
 </PreferenceScreen>
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java
index 20b6e2f..a6cbcb0 100644
--- a/src/com/android/settings/TetherSettings.java
+++ b/src/com/android/settings/TetherSettings.java
@@ -120,9 +120,6 @@
         super.onCreate(icicle);
 
         addPreferencesFromResource(R.xml.tether_prefs);
-        mFooterPreferenceMixin.createFooterPreference()
-            .setTitle(R.string.tethering_footer_info);
-
         mDataSaverBackend = new DataSaverBackend(getContext());
         mDataSaverEnabled = mDataSaverBackend.isDataSaverEnabled();
         mDataSaverFooter = findPreference(KEY_DATA_SAVER_FOOTER);
diff --git a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
index 1feef01..314a577 100644
--- a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
@@ -29,6 +29,7 @@
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.widget.SwitchBar;
 import com.android.settings.widget.ToggleSwitch;
+import com.android.settingslib.widget.FooterPreference;
 
 public abstract class ToggleFeaturePreferenceFragment extends SettingsPreferenceFragment {
 
@@ -138,11 +139,17 @@
         // Summary.
         if (arguments.containsKey(AccessibilitySettings.EXTRA_SUMMARY_RES)) {
             final int summary = arguments.getInt(AccessibilitySettings.EXTRA_SUMMARY_RES);
-            mFooterPreferenceMixin.createFooterPreference().setTitle(getText(summary));
+            createFooterPreference(getText(summary));
         } else if (arguments.containsKey(AccessibilitySettings.EXTRA_SUMMARY)) {
             final CharSequence summary = arguments.getCharSequence(
                     AccessibilitySettings.EXTRA_SUMMARY);
-            mFooterPreferenceMixin.createFooterPreference().setTitle(summary);
+            createFooterPreference(summary);
         }
     }
+
+    private void createFooterPreference(CharSequence title) {
+        final PreferenceScreen preferenceScreen = getPreferenceScreen();
+        preferenceScreen.addPreference(new FooterPreference.Builder(getActivity()).setTitle(
+                title).build());
+    }
 }
diff --git a/src/com/android/settings/datausage/DataSaverSummary.java b/src/com/android/settings/datausage/DataSaverSummary.java
index 1ab8c79..a2106d9 100644
--- a/src/com/android/settings/datausage/DataSaverSummary.java
+++ b/src/com/android/settings/datausage/DataSaverSummary.java
@@ -63,8 +63,6 @@
         super.onCreate(icicle);
 
         addPreferencesFromResource(R.xml.data_saver);
-        mFooterPreferenceMixin.createFooterPreference()
-                .setTitle(com.android.internal.R.string.data_saver_description);
         mUnrestrictedAccess = findPreference(KEY_UNRESTRICTED_ACCESS);
         mApplicationsState = ApplicationsState.getInstance(
                 (Application) getContext().getApplicationContext());
diff --git a/src/com/android/settings/password/ChooseLockGeneric.java b/src/com/android/settings/password/ChooseLockGeneric.java
index 2a7de05..4e2e90d 100644
--- a/src/com/android/settings/password/ChooseLockGeneric.java
+++ b/src/com/android/settings/password/ChooseLockGeneric.java
@@ -74,8 +74,6 @@
 import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
 import com.android.settingslib.RestrictedLockUtilsInternal;
 import com.android.settingslib.RestrictedPreference;
-import com.android.settingslib.widget.FooterPreference;
-import com.android.settingslib.widget.FooterPreferenceMixinCompat;
 
 import java.util.List;
 
@@ -112,6 +110,7 @@
         public static final String MINIMUM_QUALITY_KEY = "minimum_quality";
         public static final String HIDE_DISABLED_PREFS = "hide_disabled_prefs";
         public static final String TAG_FRP_WARNING_DIALOG = "frp_warning_dialog";
+        public static final String KEY_LOCK_SETTINGS_FOOTER ="lock_settings_footer";
 
         /**
          * Boolean extra determining whether a "screen lock options" button should be shown. This
@@ -499,11 +498,12 @@
         protected void addPreferences() {
             addPreferencesFromResource(R.xml.security_settings_picker);
 
+            final Preference footer = findPreference(KEY_LOCK_SETTINGS_FOOTER);
             if (!TextUtils.isEmpty(mCallerAppName) && !mIsCallingAppAdmin) {
-                FooterPreferenceMixinCompat footerMixin =
-                        new FooterPreferenceMixinCompat(this, getSettingsLifecycle());
-                FooterPreference footer = footerMixin.createFooterPreference();
+                footer.setVisible(true);
                 footer.setTitle(getFooterString());
+            } else {
+                footer.setVisible(false);
             }
 
             // Used for testing purposes
diff --git a/tests/robotests/src/com/android/settings/password/ChooseLockGenericTest.java b/tests/robotests/src/com/android/settings/password/ChooseLockGenericTest.java
index 673c334..1bdadb2 100644
--- a/tests/robotests/src/com/android/settings/password/ChooseLockGenericTest.java
+++ b/tests/robotests/src/com/android/settings/password/ChooseLockGenericTest.java
@@ -22,6 +22,7 @@
 import static android.app.admin.DevicePolicyManager.PASSWORD_COMPLEXITY_MEDIUM;
 import static android.app.admin.DevicePolicyManager.PASSWORD_COMPLEXITY_NONE;
 
+import static com.android.settings.password.ChooseLockGeneric.ChooseLockGenericFragment.KEY_LOCK_SETTINGS_FOOTER;
 import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_CALLER_APP_NAME;
 import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_IS_CALLING_APP_ADMIN;
 import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_REQUESTED_MIN_COMPLEXITY;
@@ -136,7 +137,7 @@
               mActivity.getString(R.string.unlock_footer_high_complexity_requested, "app name");
 
         mFragment.updatePreferencesOrFinish(false /* isRecreatingActivity */);
-        FooterPreference footer = mFragment.findPreference(FooterPreference.KEY_FOOTER);
+        FooterPreference footer = mFragment.findPreference(KEY_LOCK_SETTINGS_FOOTER);
 
         assertThat(footer.getTitle()).isEqualTo(expectedTitle);
     }
@@ -152,7 +153,7 @@
                 mActivity.getString(R.string.unlock_footer_medium_complexity_requested, "app name");
 
         mFragment.updatePreferencesOrFinish(false /* isRecreatingActivity */);
-        FooterPreference footer = mFragment.findPreference(FooterPreference.KEY_FOOTER);
+        FooterPreference footer = mFragment.findPreference(KEY_LOCK_SETTINGS_FOOTER);
 
         assertThat(footer.getTitle()).isEqualTo(expectedTitle);
     }
@@ -168,7 +169,7 @@
                 mActivity.getString(R.string.unlock_footer_low_complexity_requested, "app name");
 
         mFragment.updatePreferencesOrFinish(false /* isRecreatingActivity */);
-        FooterPreference footer = mFragment.findPreference(FooterPreference.KEY_FOOTER);
+        FooterPreference footer = mFragment.findPreference(KEY_LOCK_SETTINGS_FOOTER);
 
         assertThat(footer.getTitle()).isEqualTo(expectedTitle);
     }
@@ -184,19 +185,19 @@
                 mActivity.getString(R.string.unlock_footer_none_complexity_requested, "app name");
 
         mFragment.updatePreferencesOrFinish(/* isRecreatingActivity= */ false);
-        FooterPreference footer = mFragment.findPreference(FooterPreference.KEY_FOOTER);
+        FooterPreference footer = mFragment.findPreference(KEY_LOCK_SETTINGS_FOOTER);
 
         assertThat(footer.getTitle()).isEqualTo(expectedTitle);
     }
 
     @Test
-    public void updatePreferencesOrFinish_callingAppIsAdmin_noFooter() {
+    public void updatePreferencesOrFinish_callingAppIsAdmin_footerInvisible() {
         initActivity(new Intent().putExtra(EXTRA_KEY_IS_CALLING_APP_ADMIN, true));
 
         mFragment.updatePreferencesOrFinish(/* isRecreatingActivity= */ false);
 
-        FooterPreference footer = mFragment.findPreference(FooterPreference.KEY_FOOTER);
-        assertThat(footer).isNull();
+        FooterPreference footer = mFragment.findPreference(KEY_LOCK_SETTINGS_FOOTER);
+        assertThat(footer.isVisible()).isFalse();
     }
 
     @Test