diff --git a/Android.bp b/Android.bp
index 0271b2f..a62aa11 100644
--- a/Android.bp
+++ b/Android.bp
@@ -55,6 +55,9 @@
     ],
 
     srcs: ["src/**/*.java", "src/**/*.kt"],
+    exclude_srcs: [
+        "src/com/android/settings/biometrics/fingerprint2/shared/**/*.kt",
+    ],
     use_resource_processor: true,
     resource_dirs: [
         "res",
@@ -113,6 +116,7 @@
         "SystemUIUnfoldLib",
         "aconfig_settings_flags_lib",
         "android.content.pm.flags-aconfig-java",
+        "FingerprintManagerInteractor",
     ],
 
     plugins: [
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 977c789..95d539a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -641,7 +641,7 @@
     </string>
     <!-- Location settings footer link content description [CHAR LIMIT=NONE] -->
     <string name="location_settings_footer_learn_more_content_description">
-        Learn more about Location Settings.
+        Learn more about Location settings
     </string>
 
     <!-- Main Settings screen setting option title for the item to take you to the accounts screen [CHAR LIMIT=22] -->
@@ -10732,9 +10732,9 @@
     </string-array>
 
     <!-- Debugging developer settings: enable angle as system driver? [CHAR LIMIT=50] -->
-    <string name="enable_angle_as_system_driver">Enable ANGLE</string>
+    <string name="enable_angle_as_system_driver">Experimental: Enable ANGLE</string>
     <!-- Debugging developer settings: enable angle as system driver summary [CHAR LIMIT=NONE] -->
-    <string name="enable_angle_as_system_driver_summary">Enable ANGLE as default OpenGL ES driver. Enabling it on incompatible devices may break some applications.</string>
+    <string name="enable_angle_as_system_driver_summary">Warning: Enable ANGLE as default OpenGL ES driver. This feature is in experiment and may not be compatible with some camera and video apps.</string>
     <!--Dialog body text used to explain a reboot is required after changing ANGLE as system GLES driver setting-->
     <string name="reboot_dialog_enable_angle_as_system_driver">A reboot is required to change the system OpenGL ES driver</string>
 
@@ -12301,6 +12301,10 @@
     <string name="aspect_ratio_summary">Try a new aspect ratio to view this app if it hasn\'t been designed to fit your <xliff:g id="device_name">%1$s</xliff:g></string>
     <!-- [CHAR LIMIT=NONE] Aspect ratio setting main summary on page to choose aspect ratio for apps unoptimized for device -->
     <string name="aspect_ratio_main_summary">Try a new aspect ratio to view this app if it hasn\'t been designed to fit your <xliff:g id="device_name">%1$s</xliff:g>. Some apps may not be optimized for certain aspect ratios.</string>
+    <!-- [CHAR LIMIT=NONE] Aspect ratio setting summary to choose aspect ratio for apps unoptimized for device -->
+    <string name="aspect_ratio_summary_text">Try a new aspect ratio to view an app if it hasn\'t been designed to fit your <xliff:g id="device_name">%1$s</xliff:g></string>
+    <!-- [CHAR LIMIT=NONE] Aspect ratio setting main summary on page to choose aspect ratio for apps unoptimized for device -->
+    <string name="aspect_ratio_main_summary_text">Try a new aspect ratio to view an app if it hasn\'t been designed to fit your <xliff:g id="device_name">%1$s</xliff:g>. Some apps may not be optimized for certain aspect ratios.</string>
     <!-- [CHAR LIMIT=NONE] Aspect ratio suggested apps filter label -->
     <string name="user_aspect_ratio_suggested_apps_label">Suggested apps</string>
     <!-- [CHAR LIMIT=14] Filter label for apps that have user aspect ratio changed -->
diff --git a/res/xml/data_usage_list.xml b/res/xml/data_usage_list.xml
index 791fc86..62456ed 100644
--- a/res/xml/data_usage_list.xml
+++ b/res/xml/data_usage_list.xml
@@ -22,7 +22,9 @@
         android:title="@string/summary_placeholder">
 
         <com.android.settings.datausage.ChartDataUsagePreference
-            android:key="chart_data" />
+            android:key="chart_data"
+            settings:controller="com.android.settings.datausage.ChartDataUsagePreferenceController"
+            />
 
         <Preference
             android:key="non_carrier_data_usage_warning"
diff --git a/res/xml/terms_of_address.xml b/res/xml/terms_of_address.xml
new file mode 100644
index 0000000..a29a55c3
--- /dev/null
+++ b/res/xml/terms_of_address.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 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:title="@string/terms_of_address_title">
+
+    <com.android.settingslib.widget.TopIntroPreference
+        android:title="@string/terms_of_address_intro_title"
+        android:persistent="false"/>
+
+    <com.android.settings.widget.TickButtonPreference
+        android:key="key_terms_of_address_not_specified"
+        android:title="@string/terms_of_address_not_specified"
+        settings:controller="com.android.settings.localepicker.TermsOfAddressNotSpecifiedController"/>
+
+    <com.android.settings.widget.TickButtonPreference
+        android:key="key_terms_of_address_feminine"
+        android:title="@string/terms_of_address_feminine"
+        settings:controller="com.android.settings.localepicker.TermsOfAddressFeminineController"/>
+
+    <com.android.settings.widget.TickButtonPreference
+        android:key="key_terms_of_address_masculine"
+        android:title="@string/terms_of_address_masculine"
+        settings:controller="com.android.settings.localepicker.TermsOfAddressMasculineController"/>
+
+    <com.android.settings.widget.TickButtonPreference
+        android:key="key_terms_of_address_neutral"
+        android:title="@string/terms_of_address_neutral"
+        settings:controller="com.android.settings.localepicker.TermsOfAddressNeutralController"/>
+
+</PreferenceScreen>
diff --git a/src/com/android/settings/accessibility/LockScreenRotationPreferenceController.java b/src/com/android/settings/accessibility/LockScreenRotationPreferenceController.java
index db19096..bde2ef5 100644
--- a/src/com/android/settings/accessibility/LockScreenRotationPreferenceController.java
+++ b/src/com/android/settings/accessibility/LockScreenRotationPreferenceController.java
@@ -54,7 +54,8 @@
      */
     @Override
     public boolean setChecked(boolean isChecked) {
-        RotationPolicy.setRotationLock(mContext, !isChecked);
+        RotationPolicy.setRotationLock(mContext, !isChecked,
+                /* caller= */ "LockScreenRotationPreferenceController#setChecked");
         return true;
     }
 
diff --git a/src/com/android/settings/applications/appcompat/UserAspectRatioManager.java b/src/com/android/settings/applications/appcompat/UserAspectRatioManager.java
index 2c157c4..b940dc8 100644
--- a/src/com/android/settings/applications/appcompat/UserAspectRatioManager.java
+++ b/src/com/android/settings/applications/appcompat/UserAspectRatioManager.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.applications.appcompat;
 
+import static android.os.UserHandle.getUserHandleForUid;
 import static android.view.WindowManager.PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_FULLSCREEN_OVERRIDE;
 import static android.view.WindowManager.PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_OVERRIDE;
 
@@ -26,8 +27,8 @@
 import android.content.Intent;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.IPackageManager;
+import android.content.pm.LauncherApps;
 import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
 import android.os.RemoteException;
 import android.provider.DeviceConfig;
 import android.util.ArrayMap;
@@ -40,7 +41,6 @@
 
 import com.google.common.annotations.VisibleForTesting;
 
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -63,15 +63,12 @@
     private final Context mContext;
     private final IPackageManager mIPm;
     /** Apps that have launcher entry defined in manifest */
-    private final List<ResolveInfo> mInfoHasLauncherEntryList;
     private final Map<Integer, String> mUserAspectRatioMap;
     private final Map<Integer, CharSequence> mUserAspectRatioA11yMap;
 
     public UserAspectRatioManager(@NonNull Context context) {
         mContext = context;
         mIPm = AppGlobals.getPackageManager();
-        mInfoHasLauncherEntryList = mContext.getPackageManager().queryIntentActivities(
-                UserAspectRatioManager.LAUNCHER_ENTRY_INTENT, PackageManager.GET_META_DATA);
         mUserAspectRatioA11yMap = new ArrayMap<>();
         mUserAspectRatioMap = getUserMinAspectRatioMapping();
     }
@@ -159,9 +156,7 @@
         Boolean appAllowsUserAspectRatioOverride = readComponentProperty(
                 mContext.getPackageManager(), app.packageName,
                 PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_OVERRIDE);
-        boolean hasLauncherEntry = mInfoHasLauncherEntryList.stream()
-                .anyMatch(info -> info.activityInfo.packageName.equals(app.packageName));
-        return !FALSE.equals(appAllowsUserAspectRatioOverride) && hasLauncherEntry;
+        return !FALSE.equals(appAllowsUserAspectRatioOverride) && hasLauncherEntry(app);
     }
 
     /**
@@ -178,6 +173,15 @@
                     DEFAULT_VALUE_ENABLE_USER_ASPECT_RATIO_FULLSCREEN);
     }
 
+    LauncherApps getLauncherApps() {
+        return mContext.getSystemService(LauncherApps.class);
+    }
+
+    private boolean hasLauncherEntry(@NonNull ApplicationInfo app) {
+        return !getLauncherApps().getActivityList(app.packageName, getUserHandleForUid(app.uid))
+                .isEmpty();
+    }
+
     private static boolean getValueFromDeviceConfig(String name, boolean defaultValue) {
         return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_WINDOW_MANAGER, name, defaultValue);
     }
@@ -267,9 +271,4 @@
         }
         return null;
     }
-
-    @VisibleForTesting
-    void addInfoHasLauncherEntry(@NonNull ResolveInfo infoHasLauncherEntry) {
-        mInfoHasLauncherEntryList.add(infoHasLauncherEntry);
-    }
 }
diff --git a/src/com/android/settings/biometrics/fingerprint2/conversion/Util.kt b/src/com/android/settings/biometrics/fingerprint2/conversion/Util.kt
new file mode 100644
index 0000000..b2767c3
--- /dev/null
+++ b/src/com/android/settings/biometrics/fingerprint2/conversion/Util.kt
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2023 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.biometrics.fingerprint2.conversion
+
+import android.hardware.fingerprint.FingerprintManager
+import android.hardware.fingerprint.FingerprintSensorProperties
+import android.hardware.fingerprint.FingerprintSensorPropertiesInternal
+import com.android.settings.biometrics.fingerprint2.shared.model.EnrollReason
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintSensorPropertyViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorStrength
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorType
+
+class Util {
+  companion object {
+    fun sensorPropsToViewModel(
+      props: FingerprintSensorPropertiesInternal
+    ): FingerprintSensorPropertyViewModel {
+      val sensorStrength: SensorStrength =
+        when (props.sensorStrength) {
+          FingerprintSensorProperties.STRENGTH_CONVENIENCE -> SensorStrength.Convenient
+          FingerprintSensorProperties.STRENGTH_WEAK -> SensorStrength.Weak
+          FingerprintSensorProperties.STRENGTH_STRONG -> SensorStrength.Strong
+          else -> SensorStrength.Unknown
+        }
+      val sensorType: SensorType =
+        when (props.sensorType) {
+          FingerprintSensorProperties.TYPE_UDFPS_OPTICAL -> SensorType.Optical
+          FingerprintSensorProperties.TYPE_UDFPS_ULTRASONIC -> SensorType.Ultrasonic
+          FingerprintSensorProperties.TYPE_REAR -> SensorType.RFPS
+          FingerprintSensorProperties.TYPE_POWER_BUTTON -> SensorType.SFPS
+          else -> SensorType.Unknown
+        }
+      return FingerprintSensorPropertyViewModel(
+        props.sensorId,
+        sensorStrength,
+        props.maxEnrollmentsPerUser,
+        sensorType
+      )
+    }
+  }
+
+}
+fun EnrollReason.toOriginalReason(): Int {
+  return when (this) {
+    EnrollReason.EnrollEnrolling -> FingerprintManager.ENROLL_ENROLL
+    EnrollReason.FindSensor -> FingerprintManager.ENROLL_FIND_SENSOR
+  }
+}
diff --git a/src/com/android/settings/biometrics/fingerprint2/domain/interactor/FingerprintManagerInteractor.kt b/src/com/android/settings/biometrics/fingerprint2/domain/interactor/FingerprintManagerInteractorImpl.kt
similarity index 75%
rename from src/com/android/settings/biometrics/fingerprint2/domain/interactor/FingerprintManagerInteractor.kt
rename to src/com/android/settings/biometrics/fingerprint2/domain/interactor/FingerprintManagerInteractorImpl.kt
index 2c8ee8f..41da247 100644
--- a/src/com/android/settings/biometrics/fingerprint2/domain/interactor/FingerprintManagerInteractor.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/domain/interactor/FingerprintManagerInteractorImpl.kt
@@ -21,15 +21,16 @@
 import android.hardware.fingerprint.FingerprintManager
 import android.hardware.fingerprint.FingerprintManager.GenerateChallengeCallback
 import android.hardware.fingerprint.FingerprintManager.RemovalCallback
-import android.hardware.fingerprint.FingerprintSensorPropertiesInternal
 import android.os.CancellationSignal
 import android.util.Log
 import com.android.settings.biometrics.GatekeeperPasswordProvider
+import com.android.settings.biometrics.fingerprint2.conversion.Util
+import com.android.settings.biometrics.fingerprint2.conversion.toOriginalReason
+import com.android.settings.biometrics.fingerprint2.shared.domain.interactor.FingerprintManagerInteractor
+import com.android.settings.biometrics.fingerprint2.shared.model.EnrollReason
 import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintAuthAttemptViewModel
 import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintViewModel
-import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.EnrollReason
-import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.FingerEnrollStateViewModel
-import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.toOriginalReason
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerEnrollStateViewModel
 import com.android.settings.password.ChooseLockSettingsHelper
 import kotlin.coroutines.resume
 import kotlin.coroutines.suspendCoroutine
@@ -45,59 +46,6 @@
 
 private const val TAG = "FingerprintManagerInteractor"
 
-/** Encapsulates business logic related to managing fingerprints. */
-interface FingerprintManagerInteractor {
-  /** Returns the list of current fingerprints. */
-  val enrolledFingerprints: Flow<List<FingerprintViewModel>>
-
-  /** Returns the max enrollable fingerprints, note during SUW this might be 1 */
-  val maxEnrollableFingerprints: Flow<Int>
-
-  /** Returns true if a user can enroll a fingerprint false otherwise. */
-  val canEnrollFingerprints: Flow<Boolean>
-
-  /** Retrieves the sensor properties of a device */
-  val sensorPropertiesInternal: Flow<FingerprintSensorPropertiesInternal?>
-
-  /** Runs [FingerprintManager.authenticate] */
-  suspend fun authenticate(): FingerprintAuthAttemptViewModel
-
-  /**
-   * Generates a challenge with the provided [gateKeeperPasswordHandle] and on success returns a
-   * challenge and challenge token. This info can be used for secure operations such as
-   * [FingerprintManager.enroll]
-   *
-   * @param gateKeeperPasswordHandle GateKeeper password handle generated by a Confirm
-   * @return A [Pair] of the challenge and challenge token
-   */
-  suspend fun generateChallenge(gateKeeperPasswordHandle: Long): Pair<Long, ByteArray>
-
-  /**
-   * Runs [FingerprintManager.enroll] with the [hardwareAuthToken] and [EnrollReason] for this
-   * enrollment. Returning the [FingerEnrollStateViewModel] that represents this fingerprint
-   * enrollment state.
-   */
-  suspend fun enroll(
-    hardwareAuthToken: ByteArray?,
-    enrollReason: EnrollReason,
-  ): Flow<FingerEnrollStateViewModel>
-
-  /**
-   * Removes the given fingerprint, returning true if it was successfully removed and false
-   * otherwise
-   */
-  suspend fun removeFingerprint(fp: FingerprintViewModel): Boolean
-
-  /** Renames the given fingerprint if one exists */
-  suspend fun renameFingerprint(fp: FingerprintViewModel, newName: String)
-
-  /** Indicates if the device has side fingerprint */
-  suspend fun hasSideFps(): Boolean
-
-  /** Indicates if the press to auth feature has been enabled */
-  suspend fun pressToAuthEnabled(): Boolean
-}
-
 class FingerprintManagerInteractorImpl(
   applicationContext: Context,
   private val backgroundDispatcher: CoroutineDispatcher,
@@ -144,7 +92,10 @@
 
   override val sensorPropertiesInternal = flow {
     val sensorPropertiesInternal = fingerprintManager.sensorPropertiesInternal
-    emit(if (sensorPropertiesInternal.isEmpty()) null else sensorPropertiesInternal.first())
+    emit(
+      if (sensorPropertiesInternal.isEmpty()) null
+      else Util.sensorPropsToViewModel(sensorPropertiesInternal.first())
+    )
   }
 
   override val maxEnrollableFingerprints = flow { emit(maxFingerprints) }
@@ -183,7 +134,7 @@
       cancellationSignal,
       applicationContext.userId,
       enrollmentCallback,
-      enrollReason.toOriginalReason()
+      enrollReason.toOriginalReason(),
     )
     awaitClose {
       // If the stream has not been ended, and the user has stopped collecting the flow
diff --git a/src/com/android/settings/biometrics/fingerprint2/shared/Android.bp b/src/com/android/settings/biometrics/fingerprint2/shared/Android.bp
new file mode 100644
index 0000000..8873fd8
--- /dev/null
+++ b/src/com/android/settings/biometrics/fingerprint2/shared/Android.bp
@@ -0,0 +1,13 @@
+// This  library is mainly used for fakes which will be shared across are various types of tests
+// unit/robo/screenshot etc.
+//
+// This library shouldn't have many dependencies.
+android_library {
+    name: "FingerprintManagerInteractor",
+    srcs: [
+      "**/*.kt"
+    ],
+    static_libs: [
+      "kotlinx-coroutines-android",
+    ],
+}
\ No newline at end of file
diff --git a/src/com/android/settings/biometrics/fingerprint2/shared/AndroidManifest.xml b/src/com/android/settings/biometrics/fingerprint2/shared/AndroidManifest.xml
new file mode 100644
index 0000000..e2c97fc
--- /dev/null
+++ b/src/com/android/settings/biometrics/fingerprint2/shared/AndroidManifest.xml
@@ -0,0 +1,18 @@
+<!--
+  ~ Copyright (C) 2023 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.
+  -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.android.settings.biometrics.fingerprint2.shared">
+</manifest>
diff --git a/src/com/android/settings/biometrics/fingerprint2/shared/domain/interactor/FingerprintManagerInteractor.kt b/src/com/android/settings/biometrics/fingerprint2/shared/domain/interactor/FingerprintManagerInteractor.kt
new file mode 100644
index 0000000..5353bb2
--- /dev/null
+++ b/src/com/android/settings/biometrics/fingerprint2/shared/domain/interactor/FingerprintManagerInteractor.kt
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2023 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.biometrics.fingerprint2.shared.domain.interactor
+
+import com.android.settings.biometrics.fingerprint2.shared.model.EnrollReason
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintAuthAttemptViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintSensorPropertyViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerEnrollStateViewModel
+import kotlinx.coroutines.flow.Flow
+
+/**
+ * Interface to obtain the necessary data for FingerprintEnrollment/Settings
+ *
+ * Note that this interface should not have dependencies on heavyweight libraries such as the
+ * framework, hidl/aidl, etc. This makes it much easier to test and create fakes for.
+ */
+interface FingerprintManagerInteractor {
+  /** Returns the list of current fingerprints. */
+  val enrolledFingerprints: Flow<List<FingerprintViewModel>>
+
+  /** Returns the max enrollable fingerprints, note during SUW this might be 1 */
+  val maxEnrollableFingerprints: Flow<Int>
+
+  /** Returns true if a user can enroll a fingerprint false otherwise. */
+  val canEnrollFingerprints: Flow<Boolean>
+
+  /** Retrieves the sensor properties of a device */
+  val sensorPropertiesInternal: Flow<FingerprintSensorPropertyViewModel?>
+
+  /** Runs the authenticate flow */
+  suspend fun authenticate(): FingerprintAuthAttemptViewModel
+
+  /**
+   * Generates a challenge with the provided [gateKeeperPasswordHandle] and on success returns a
+   * challenge and challenge token. This info can be used for secure operations such as enrollment
+   *
+   * @param gateKeeperPasswordHandle GateKeeper password handle generated by a Confirm
+   * @return A [Pair] of the challenge and challenge token
+   */
+  suspend fun generateChallenge(gateKeeperPasswordHandle: Long): Pair<Long, ByteArray>
+
+  /**
+   * Runs [FingerprintManager.enroll] with the [hardwareAuthToken] and [EnrollReason] for this
+   * enrollment. Returning the [FingerEnrollStateViewModel] that represents this fingerprint
+   * enrollment state.
+   */
+  suspend fun enroll(
+    hardwareAuthToken: ByteArray?,
+    enrollReason: EnrollReason,
+  ): Flow<FingerEnrollStateViewModel>
+
+  /**
+   * Removes the given fingerprint, returning true if it was successfully removed and false
+   * otherwise
+   */
+  suspend fun removeFingerprint(fp: FingerprintViewModel): Boolean
+
+  /** Renames the given fingerprint if one exists */
+  suspend fun renameFingerprint(fp: FingerprintViewModel, newName: String)
+
+  /** Indicates if the device has side fingerprint */
+  suspend fun hasSideFps(): Boolean
+
+  /** Indicates if the press to auth feature has been enabled */
+  suspend fun pressToAuthEnabled(): Boolean
+
+}
diff --git a/src/com/android/settings/biometrics/fingerprint2/shared/model/EnrollReasonViewModel.kt b/src/com/android/settings/biometrics/fingerprint2/shared/model/EnrollReasonViewModel.kt
new file mode 100644
index 0000000..47a0af0
--- /dev/null
+++ b/src/com/android/settings/biometrics/fingerprint2/shared/model/EnrollReasonViewModel.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2023 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.biometrics.fingerprint2.shared.model
+
+/** The reason for enrollment */
+enum class EnrollReason {
+  /**
+   * The enroll happens on education screen. This is to support legacy flows where we require the
+   * user to touch the sensor before going ahead to the EnrollEnrolling flow
+   */
+  FindSensor,
+  /** The enroll happens on enrolling screen. */
+  EnrollEnrolling
+}
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerEnrollStateViewModel.kt b/src/com/android/settings/biometrics/fingerprint2/shared/model/FingerEnrollStateViewModel.kt
similarity index 94%
rename from src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerEnrollStateViewModel.kt
rename to src/com/android/settings/biometrics/fingerprint2/shared/model/FingerEnrollStateViewModel.kt
index 73343bd..179ac60 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerEnrollStateViewModel.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/shared/model/FingerEnrollStateViewModel.kt
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel
+package com.android.settings.biometrics.fingerprint2.shared.model
 
 import android.annotation.StringRes
 
diff --git a/src/com/android/settings/biometrics/fingerprint2/shared/model/FingerprintViewModel.kt b/src/com/android/settings/biometrics/fingerprint2/shared/model/FingerprintViewModel.kt
index db28e79..fc9539c 100644
--- a/src/com/android/settings/biometrics/fingerprint2/shared/model/FingerprintViewModel.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/shared/model/FingerprintViewModel.kt
@@ -32,3 +32,36 @@
     val message: String,
   ) : FingerprintAuthAttemptViewModel()
 }
+
+/** The various types of fingerprint sensors */
+sealed class SensorType {
+  /** Rear fingerprint sensor */
+  data object RFPS : SensorType()
+
+  /** Optical under display sensor */
+  data object Optical : SensorType()
+
+  /** Ultrasonic under display sensor */
+  data object Ultrasonic : SensorType()
+
+  /** Side fingerprint sensor */
+  data object SFPS : SensorType()
+
+  /** Unkonwn fingerprint sensor */
+  data object Unknown : SensorType()
+}
+
+/** The strength of a given sensor */
+sealed class SensorStrength {
+  data object Convenient : SensorStrength()
+  data object Weak : SensorStrength()
+  data object Strong : SensorStrength()
+  data object Unknown : SensorStrength()
+}
+
+data class FingerprintSensorPropertyViewModel(
+  val sensorId: Int,
+  val sensorStrength: SensorStrength,
+  val maxEnrollmentsPerUser: Int,
+  val sensorType: SensorType
+)
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollFindSensorV2Fragment.kt b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollFindSensorV2Fragment.kt
index dcdcccf..e4ac00f 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollFindSensorV2Fragment.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollFindSensorV2Fragment.kt
@@ -29,6 +29,7 @@
 import com.android.settings.R
 import com.android.settings.biometrics.fingerprint.FingerprintErrorDialog
 import com.android.settings.biometrics.fingerprint.FingerprintFindSensorAnimation
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorType
 import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.FingerprintEnrollFindSensorViewModel
 import com.android.systemui.biometrics.shared.model.FingerprintSensorType
 import com.google.android.setupcompat.template.FooterBarMixin
@@ -65,9 +66,9 @@
       viewModel.sensorType.collect {
         contentLayoutId =
           when (it) {
-            FingerprintSensorType.UDFPS_OPTICAL,
-            FingerprintSensorType.UDFPS_ULTRASONIC -> R.layout.udfps_enroll_find_sensor_layout
-            FingerprintSensorType.POWER_BUTTON -> R.layout.sfps_enroll_find_sensor_layout
+            SensorType.Optical,
+            SensorType.Ultrasonic -> R.layout.udfps_enroll_find_sensor_layout
+            SensorType.SFPS -> R.layout.sfps_enroll_find_sensor_layout
             else -> R.layout.fingerprint_v2_enroll_find_sensor
           }
       }
@@ -170,14 +171,14 @@
     illustrationLottie?.visibility = View.VISIBLE
   }
 
-  private fun setTexts(sensorType: FingerprintSensorType, view: GlifLayout) {
+  private fun setTexts(sensorType: SensorType, view: GlifLayout) {
     when (sensorType) {
-      FingerprintSensorType.UDFPS_OPTICAL,
-      FingerprintSensorType.UDFPS_ULTRASONIC -> {
+      SensorType.Optical,
+      SensorType.Ultrasonic -> {
         view.setHeaderText(R.string.security_settings_udfps_enroll_find_sensor_title)
         view.setDescriptionText(R.string.security_settings_udfps_enroll_find_sensor_message)
       }
-      FingerprintSensorType.POWER_BUTTON -> {
+      SensorType.SFPS -> {
         view.setHeaderText(R.string.security_settings_sfps_enroll_find_sensor_title)
         view.setDescriptionText(R.string.security_settings_sfps_enroll_find_sensor_message)
       }
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollIntroV2Fragment.kt b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollIntroV2Fragment.kt
index dbf6d12..2ebc5d5 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollIntroV2Fragment.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollIntroV2Fragment.kt
@@ -35,10 +35,10 @@
 import com.android.settings.R
 import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.FingerprintEnrollNavigationViewModel
 import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.FingerprintEnrollViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorType
 import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.FingerprintGatekeeperViewModel
 import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.FingerprintScrollViewModel
 import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.Unicorn
-import com.android.systemui.biometrics.shared.model.FingerprintSensorType
 import com.google.android.setupcompat.template.FooterBarMixin
 import com.google.android.setupcompat.template.FooterButton
 import com.google.android.setupdesign.GlifLayout
@@ -144,8 +144,8 @@
             val iconShield: ImageView = view.requireViewById(R.id.icon_shield)
             val footerMessage6: TextView = view.requireViewById(R.id.footer_message_6)
             when (sensorType) {
-              FingerprintSensorType.UDFPS_ULTRASONIC,
-              FingerprintSensorType.UDFPS_OPTICAL -> {
+              SensorType.Ultrasonic,
+              SensorType.Optical -> {
                 footerMessage6.visibility = View.VISIBLE
                 iconShield.visibility = View.VISIBLE
               }
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/EnrollReason.kt b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/EnrollReason.kt
deleted file mode 100644
index 87deeb3..0000000
--- a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/EnrollReason.kt
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2023 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.biometrics.fingerprint2.ui.enrollment.viewmodel
-
-import android.hardware.fingerprint.FingerprintManager
-
-/**
- * The reason for enrollment. Represents [FingerprintManager.EnrollReason]
- */
-enum class EnrollReason {
-  /** The enroll happens on education screen. */
-  FindSensor,
-  /** The enroll happens on enrolling screen. */
-  EnrollEnrolling
-}
-
-/** Convert EnrollReason to original [FingerprintManager.EnrollReason]. */
-fun EnrollReason.toOriginalReason(): Int {
-  return when (this) {
-    EnrollReason.EnrollEnrolling -> FingerprintManager.ENROLL_ENROLL
-    EnrollReason.FindSensor -> FingerprintManager.ENROLL_FIND_SENSOR
-  }
-}
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrollFindSensorViewModel.kt b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrollFindSensorViewModel.kt
index dbf6b33..c877d67 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrollFindSensorViewModel.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrollFindSensorViewModel.kt
@@ -20,6 +20,9 @@
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.ViewModelProvider
 import androidx.lifecycle.viewModelScope
+import com.android.settings.biometrics.fingerprint2.shared.model.EnrollReason
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerEnrollStateViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorType
 import com.android.systemui.biometrics.shared.model.FingerprintSensorType
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.MutableStateFlow
@@ -42,13 +45,13 @@
   orientationStateViewModel: OrientationStateViewModel
 ) : ViewModel() {
   /** Represents the stream of sensor type. */
-  val sensorType: Flow<FingerprintSensorType> =
+  val sensorType: Flow<SensorType> =
     fingerprintEnrollViewModel.sensorType.filterWhenEducationIsShown()
   private val _isUdfps: Flow<Boolean> =
     sensorType.map {
-      it == FingerprintSensorType.UDFPS_OPTICAL || it == FingerprintSensorType.UDFPS_ULTRASONIC
+      it == SensorType.Optical || it == SensorType.Ultrasonic
     }
-  private val _isSfps: Flow<Boolean> = sensorType.map { it == FingerprintSensorType.POWER_BUTTON }
+  private val _isSfps: Flow<Boolean> = sensorType.map { it == SensorType.RFPS }
   private val _isRearSfps: Flow<Boolean> =
     combineTransform(_isSfps, _isUdfps) { v1, v2 -> !v1 && !v2 }
 
@@ -92,8 +95,8 @@
         ) { sensorType, hasValidGatekeeperInfo, gatekeeperInfo, navigationViewModel ->
           val shouldStartEnroll =
             navigationViewModel.currStep == Education &&
-              sensorType != FingerprintSensorType.UDFPS_OPTICAL &&
-              sensorType != FingerprintSensorType.UDFPS_ULTRASONIC &&
+              sensorType != SensorType.Optical &&
+              sensorType != SensorType.Ultrasonic &&
               hasValidGatekeeperInfo
           if (shouldStartEnroll) (gatekeeperInfo as GatekeeperInfo.GatekeeperPasswordInfo).token
           else null
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrollViewModel.kt b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrollViewModel.kt
index cb1beb9..b2c51db 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrollViewModel.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrollViewModel.kt
@@ -17,13 +17,14 @@
 
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.ViewModelProvider
-import com.android.settings.biometrics.fingerprint2.domain.interactor.FingerprintManagerInteractor
+import com.android.settings.biometrics.fingerprint2.shared.domain.interactor.FingerprintManagerInteractor
+import com.android.settings.biometrics.fingerprint2.shared.model.EnrollReason
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerEnrollStateViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorType
 import com.android.systemui.biometrics.shared.model.FingerprintSensorType
-import com.android.systemui.biometrics.shared.model.toSensorType
 import kotlinx.coroutines.CoroutineDispatcher
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.collect
 import kotlinx.coroutines.flow.combine
 import kotlinx.coroutines.flow.filterNotNull
 import kotlinx.coroutines.flow.flowOn
@@ -39,17 +40,15 @@
   backgroundDispatcher: CoroutineDispatcher,
 ) : ViewModel() {
 
-  /** Represents the stream of [FingerprintSensorType] */
-  val sensorType: Flow<FingerprintSensorType> =
-    fingerprintManagerInteractor.sensorPropertiesInternal.filterNotNull().map {
-      it.sensorType.toSensorType()
-    }
-
   private var _enrollReason: MutableStateFlow<EnrollReason> =
     MutableStateFlow(EnrollReason.FindSensor)
   private var _hardwareAuthToken: MutableStateFlow<ByteArray?> = MutableStateFlow(null)
   private var _consumerShouldEnroll: MutableStateFlow<Boolean> = MutableStateFlow(false)
 
+  /** Represents the stream of [FingerprintSensorType] */
+  val sensorType: Flow<SensorType> =
+    fingerprintManagerInteractor.sensorPropertiesInternal.filterNotNull().map { it.sensorType }
+
   /**
    * A flow that contains a [FingerprintEnrollViewModel] which contains the relevant information for
    * an enrollment process
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrolllNavigationViewModel.kt b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrolllNavigationViewModel.kt
index dafe545..d2bb321 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrolllNavigationViewModel.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintEnrolllNavigationViewModel.kt
@@ -20,7 +20,7 @@
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.ViewModelProvider
 import androidx.lifecycle.viewModelScope
-import com.android.settings.biometrics.fingerprint2.domain.interactor.FingerprintManagerInteractor
+import com.android.settings.biometrics.fingerprint2.shared.domain.interactor.FingerprintManagerInteractor
 import kotlinx.coroutines.CoroutineDispatcher
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.MutableStateFlow
@@ -39,7 +39,7 @@
 /**
  * The [EnrollType] for fingerprint enrollment indicates information on how the flow should behave.
  */
-sealed class EnrollType()
+sealed class EnrollType
 
 /** The default enrollment experience, typically called from Settings */
 object Default : EnrollType()
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintGatekeeperViewModel.kt b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintGatekeeperViewModel.kt
index fa4463a..db93d02 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintGatekeeperViewModel.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintGatekeeperViewModel.kt
@@ -21,7 +21,7 @@
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.ViewModelProvider
 import androidx.lifecycle.viewModelScope
-import com.android.settings.biometrics.fingerprint2.domain.interactor.FingerprintManagerInteractor
+import com.android.settings.biometrics.fingerprint2.shared.domain.interactor.FingerprintManagerInteractor
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.MutableStateFlow
 import kotlinx.coroutines.flow.asStateFlow
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintScrollViewModel.kt b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintScrollViewModel.kt
index d79d9c0..989d4d3 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintScrollViewModel.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/viewmodel/FingerprintScrollViewModel.kt
@@ -27,6 +27,7 @@
 class FingerprintScrollViewModel : ViewModel() {
 
   private val _hasReadConsentScreen: MutableStateFlow<Boolean> = MutableStateFlow(false)
+
   /** Indicates if a user has consented to FingerprintEnrollment */
   val hasReadConsentScreen: Flow<Boolean> = _hasReadConsentScreen.asStateFlow()
 
@@ -35,7 +36,7 @@
     _hasReadConsentScreen.update { true }
   }
 
-  class FingerprintScrollViewModelFactory() : ViewModelProvider.Factory {
+  class FingerprintScrollViewModelFactory : ViewModelProvider.Factory {
 
     @Suppress("UNCHECKED_CAST")
     override fun <T : ViewModel> create(
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/settings/binder/FingerprintSettingsViewBinder.kt b/src/com/android/settings/biometrics/fingerprint2/ui/settings/binder/FingerprintSettingsViewBinder.kt
index 9f42d81..e66b4cd 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/settings/binder/FingerprintSettingsViewBinder.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/settings/binder/FingerprintSettingsViewBinder.kt
@@ -34,7 +34,6 @@
 import com.android.settings.biometrics.fingerprint2.ui.settings.viewmodel.ShowSettings
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.Job
-import kotlinx.coroutines.flow.collect
 import kotlinx.coroutines.flow.collectLatest
 import kotlinx.coroutines.flow.filterNotNull
 import kotlinx.coroutines.launch
@@ -55,7 +54,6 @@
       challenge: Long?,
       challengeToken: ByteArray?
     )
-
     /** Helper to launch an add fingerprint request */
     fun launchAddFingerprint(userId: Int, challengeToken: ByteArray?)
     /**
@@ -63,10 +61,8 @@
      * choose a PIN/PATTERN/PASS.
      */
     fun launchConfirmOrChooseLock(userId: Int)
-
     /** Used to indicate that FingerprintSettings is finished. */
     fun finish()
-
     /** Indicates what result should be set for the returning callee */
     fun setResultExternal(resultCode: Int)
     /** Indicates the settings UI should be shown */
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/settings/fragment/FingerprintSettingsRenameDialog.kt b/src/com/android/settings/biometrics/fingerprint2/ui/settings/fragment/FingerprintSettingsRenameDialog.kt
index 84f33ff..9bde0b0 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/settings/fragment/FingerprintSettingsRenameDialog.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/settings/fragment/FingerprintSettingsRenameDialog.kt
@@ -106,8 +106,9 @@
         val dialog = FingerprintSettingsRenameDialog()
         val onClick =
           DialogInterface.OnClickListener { _, _ ->
-            val dialogTextField = dialog.requireDialog()
-                .requireViewById(R.id.fingerprint_rename_field) as ImeAwareEditText
+            val dialogTextField =
+              dialog.requireDialog().requireViewById(R.id.fingerprint_rename_field)
+                as ImeAwareEditText
             val newName = dialogTextField.text.toString()
             if (!TextUtils.equals(newName, fp.name)) {
               Log.d(TAG, "rename $fp.name to $newName for $dialog")
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/settings/viewmodel/FingerprintSettingsNavigationViewModel.kt b/src/com/android/settings/biometrics/fingerprint2/ui/settings/viewmodel/FingerprintSettingsNavigationViewModel.kt
index 538bb6d..22a25e1 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/settings/viewmodel/FingerprintSettingsNavigationViewModel.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/settings/viewmodel/FingerprintSettingsNavigationViewModel.kt
@@ -21,7 +21,7 @@
 import androidx.lifecycle.ViewModelProvider
 import androidx.lifecycle.viewModelScope
 import com.android.settings.biometrics.BiometricEnrollBase
-import com.android.settings.biometrics.fingerprint2.domain.interactor.FingerprintManagerInteractor
+import com.android.settings.biometrics.fingerprint2.shared.domain.interactor.FingerprintManagerInteractor
 import kotlinx.coroutines.CoroutineDispatcher
 import kotlinx.coroutines.flow.MutableStateFlow
 import kotlinx.coroutines.flow.StateFlow
@@ -32,17 +32,18 @@
 
 /** A Viewmodel that represents the navigation of the FingerprintSettings activity. */
 class FingerprintSettingsNavigationViewModel(
-  private val userId: Int,
-  private val fingerprintManagerInteractor: FingerprintManagerInteractor,
-  private val backgroundDispatcher: CoroutineDispatcher,
-  tokenInit: ByteArray?,
-  challengeInit: Long?,
+    private val userId: Int,
+    private val fingerprintManagerInteractor: FingerprintManagerInteractor,
+    private val backgroundDispatcher: CoroutineDispatcher,
+    tokenInit: ByteArray?,
+    challengeInit: Long?,
 ) : ViewModel() {
 
   private var token = tokenInit
   private var challenge = challengeInit
 
   private val _nextStep: MutableStateFlow<NextStepViewModel?> = MutableStateFlow(null)
+
   /** This flow represents the high level state for the FingerprintSettingsV2Fragment. */
   val nextStep: StateFlow<NextStepViewModel?> = _nextStep.asStateFlow()
 
@@ -118,8 +119,8 @@
       launchFinishSettings("Error, empty keyChallenge")
       return
     }
-    token = theToken!!
-    challenge = theChallenge!!
+    token = theToken
+    challenge = theChallenge
 
     showSettingsHelper()
   }
@@ -170,12 +171,13 @@
   private fun launchFinishSettings(reason: String, errorCode: Int) {
     _nextStep.update { FinishSettingsWithResult(errorCode, reason) }
   }
+
   class FingerprintSettingsNavigationModelFactory(
-    private val userId: Int,
-    private val interactor: FingerprintManagerInteractor,
-    private val backgroundDispatcher: CoroutineDispatcher,
-    private val token: ByteArray?,
-    private val challenge: Long?,
+      private val userId: Int,
+      private val interactor: FingerprintManagerInteractor,
+      private val backgroundDispatcher: CoroutineDispatcher,
+      private val token: ByteArray?,
+      private val challenge: Long?,
   ) : ViewModelProvider.Factory {
 
     @Suppress("UNCHECKED_CAST")
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/settings/viewmodel/FingerprintSettingsViewModel.kt b/src/com/android/settings/biometrics/fingerprint2/ui/settings/viewmodel/FingerprintSettingsViewModel.kt
index 5770d09..d2691b4 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/settings/viewmodel/FingerprintSettingsViewModel.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/settings/viewmodel/FingerprintSettingsViewModel.kt
@@ -21,11 +21,10 @@
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.ViewModelProvider
 import androidx.lifecycle.viewModelScope
-import com.android.settings.biometrics.fingerprint2.domain.interactor.FingerprintManagerInteractor
+import com.android.settings.biometrics.fingerprint2.shared.domain.interactor.FingerprintManagerInteractor
 import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintAuthAttemptViewModel
 import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintViewModel
-import com.android.systemui.biometrics.shared.model.FingerprintSensorType
-import com.android.systemui.biometrics.shared.model.toSensorType
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorType
 import kotlinx.coroutines.CoroutineDispatcher
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.MutableSharedFlow
@@ -90,10 +89,8 @@
 
   private val _consumerShouldAuthenticate: MutableStateFlow<Boolean> = MutableStateFlow(false)
 
-  private val _fingerprintSensorType: Flow<FingerprintSensorType> =
-    fingerprintManagerInteractor.sensorPropertiesInternal.filterNotNull().map {
-      it.sensorType.toSensorType()
-    }
+  private val _fingerprintSensorType: Flow<SensorType> =
+    fingerprintManagerInteractor.sensorPropertiesInternal.filterNotNull().map { it.sensorType }
 
   private val _sensorNullOrEmpty: Flow<Boolean> =
     fingerprintManagerInteractor.sensorPropertiesInternal.map { it == null }
@@ -149,10 +146,7 @@
         if (sensorNullOrEmpty) {
           return@combine false
         }
-        if (
-          listOf(FingerprintSensorType.UDFPS_ULTRASONIC, FingerprintSensorType.UDFPS_OPTICAL)
-            .contains(sensorType)
-        ) {
+        if (listOf(SensorType.Ultrasonic, SensorType.Optical).contains(sensorType)) {
           return@combine false
         }
 
diff --git a/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java b/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
index 8a7c048..cfe7962 100644
--- a/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
+++ b/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
@@ -203,6 +203,16 @@
         slicePreferenceController.setSliceUri(sliceEnabled ? controlUri : null);
         slicePreferenceController.onStart();
         slicePreferenceController.displayPreference(getPreferenceScreen());
+
+        // Temporarily fix the issue that the page will be automatically scrolled to a wrong
+        // position when entering the page. This will make sure the bluetooth header is shown on top
+        // of the page.
+        use(LeAudioBluetoothDetailsHeaderController.class).displayPreference(
+                getPreferenceScreen());
+        use(AdvancedBluetoothDetailsHeaderController.class).displayPreference(
+                getPreferenceScreen());
+        use(BluetoothDetailsHeaderController.class).displayPreference(
+                getPreferenceScreen());
     }
 
     private final ViewTreeObserver.OnGlobalLayoutListener mOnGlobalLayoutListener =
diff --git a/src/com/android/settings/datausage/AppDataUsage.java b/src/com/android/settings/datausage/AppDataUsage.java
index c3be0aa..33307a3 100644
--- a/src/com/android/settings/datausage/AppDataUsage.java
+++ b/src/com/android/settings/datausage/AppDataUsage.java
@@ -31,6 +31,7 @@
 import android.util.ArraySet;
 import android.util.IconDrawableFactory;
 import android.util.Log;
+import android.util.Range;
 import android.view.View;
 import android.widget.AdapterView;
 
@@ -472,7 +473,9 @@
                         List<NetworkCycleDataForUid> data) {
                     mUsageData = data;
                     mCycle.setOnItemSelectedListener(mCycleListener);
-                    mCycleAdapter.updateCycleList(data);
+                    mCycleAdapter.updateCycleList(data.stream()
+                            .map(cycle -> new Range<>(cycle.getStartTime(), cycle.getEndTime()))
+                            .toList());
                     if (mSelectedCycle > 0L) {
                         final int numCycles = data.size();
                         int position = 0;
diff --git a/src/com/android/settings/datausage/ChartDataUsagePreference.java b/src/com/android/settings/datausage/ChartDataUsagePreference.java
index fa467d2..e5a7307 100644
--- a/src/com/android/settings/datausage/ChartDataUsagePreference.java
+++ b/src/com/android/settings/datausage/ChartDataUsagePreference.java
@@ -26,15 +26,17 @@
 import android.util.DataUnit;
 import android.util.SparseIntArray;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.annotation.VisibleForTesting;
 import androidx.preference.Preference;
 import androidx.preference.PreferenceViewHolder;
 
 import com.android.settings.R;
 import com.android.settings.Utils;
+import com.android.settings.datausage.lib.NetworkCycleChartData;
+import com.android.settings.datausage.lib.NetworkUsageData;
 import com.android.settings.widget.UsageView;
-import com.android.settingslib.net.NetworkCycleChartData;
-import com.android.settingslib.net.NetworkCycleData;
 
 import java.util.ArrayList;
 import java.util.Comparator;
@@ -51,8 +53,8 @@
     private final int mWarningColor;
     private final int mLimitColor;
 
-    private Resources mResources;
-    private NetworkPolicy mPolicy;
+    private final Resources mResources;
+    @Nullable private NetworkPolicy mPolicy;
     private long mStart;
     private long mEnd;
     private NetworkCycleChartData mNetworkCycleChartData;
@@ -67,18 +69,16 @@
     }
 
     @Override
-    public void onBindViewHolder(PreferenceViewHolder holder) {
+    public void onBindViewHolder(@NonNull PreferenceViewHolder holder) {
         super.onBindViewHolder(holder);
-        final UsageView chart = (UsageView) holder.findViewById(R.id.data_usage);
-        if (mNetworkCycleChartData == null) {
-            return;
-        }
-
+        final UsageView chart = holder.itemView.requireViewById(R.id.data_usage);
         final int top = getTop();
         chart.clearPaths();
         chart.configureGraph(toInt(mEnd - mStart), top);
-        calcPoints(chart, mNetworkCycleChartData.getUsageBuckets());
-        setupContentDescription(chart, mNetworkCycleChartData.getUsageBuckets());
+        if (mNetworkCycleChartData != null) {
+            calcPoints(chart, mNetworkCycleChartData.getDailyUsage());
+            setupContentDescription(chart, mNetworkCycleChartData.getDailyUsage());
+        }
         chart.setBottomLabels(new CharSequence[] {
                 Utils.formatDateRange(getContext(), mStart, mStart),
                 Utils.formatDateRange(getContext(), mEnd, mEnd),
@@ -88,23 +88,21 @@
     }
 
     public int getTop() {
-        final long totalData = mNetworkCycleChartData.getTotalUsage();
+        final long totalData =
+                mNetworkCycleChartData != null ? mNetworkCycleChartData.getTotal().getUsage() : 0;
         final long policyMax =
             mPolicy != null ? Math.max(mPolicy.limitBytes, mPolicy.warningBytes) : 0;
         return (int) (Math.max(totalData, policyMax) / RESOLUTION);
     }
 
     @VisibleForTesting
-    void calcPoints(UsageView chart, List<NetworkCycleData> usageSummary) {
-        if (usageSummary == null) {
-            return;
-        }
+    void calcPoints(UsageView chart, @NonNull List<NetworkUsageData> usageSummary) {
         final SparseIntArray points = new SparseIntArray();
         points.put(0, 0);
 
         final long now = System.currentTimeMillis();
         long totalData = 0;
-        for (NetworkCycleData data : usageSummary) {
+        for (NetworkUsageData data : usageSummary) {
             final long startTime = data.getStartTime();
             if (startTime > now) {
                 break;
@@ -112,7 +110,7 @@
             final long endTime = data.getEndTime();
 
             // increment by current bucket total
-            totalData += data.getTotalUsage();
+            totalData += data.getUsage();
 
             if (points.size() == 1) {
                 points.put(toInt(startTime - mStart) - 1, -1);
@@ -125,7 +123,8 @@
         }
     }
 
-    private void setupContentDescription(UsageView chart, List<NetworkCycleData> usageSummary) {
+    private void setupContentDescription(
+            UsageView chart, @NonNull List<NetworkUsageData> usageSummary) {
         final Context context = getContext();
         final StringBuilder contentDescription = new StringBuilder();
         final int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_MONTH;
@@ -137,7 +136,7 @@
                 .getString(R.string.data_usage_chart_brief_content_description, startDate, endDate);
         contentDescription.append(briefContentDescription);
 
-        if (usageSummary == null || usageSummary.isEmpty()) {
+        if (usageSummary.isEmpty()) {
             final String noDataContentDescription = mResources
                     .getString(R.string.data_usage_chart_no_data_content_description);
             contentDescription.append(noDataContentDescription);
@@ -170,17 +169,17 @@
      * Collect the date of the same percentage, e.g., Aug 2 to Aug 22: 0%; Aug 23: 2%.
      */
     @VisibleForTesting
-    List<DataUsageSummaryNode> getDensedStatsData(List<NetworkCycleData> usageSummary) {
+    List<DataUsageSummaryNode> getDensedStatsData(@NonNull List<NetworkUsageData> usageSummary) {
         final List<DataUsageSummaryNode> dataUsageSummaryNodes = new ArrayList<>();
         final long overallDataUsage = Math.max(1L, usageSummary.stream()
-                .mapToLong(NetworkCycleData::getTotalUsage).sum());
+                .mapToLong(NetworkUsageData::getUsage).sum());
         long cumulatedDataUsage = 0L;
-        int cumulatedDataUsagePercentage = 0;
 
         // Collect List of DataUsageSummaryNode for data usage percentage information.
-        for (NetworkCycleData data : usageSummary) {
-            cumulatedDataUsage += data.getTotalUsage();
-            cumulatedDataUsagePercentage = (int) ((cumulatedDataUsage * 100) / overallDataUsage);
+        for (NetworkUsageData data : usageSummary) {
+            cumulatedDataUsage += data.getUsage();
+            int cumulatedDataUsagePercentage =
+                    (int) ((cumulatedDataUsage * 100) / overallDataUsage);
 
             final DataUsageSummaryNode node = new DataUsageSummaryNode(data.getStartTime(),
                     data.getEndTime(), cumulatedDataUsagePercentage);
@@ -268,8 +267,9 @@
         }
 
         if (policy.warningBytes != NetworkPolicy.WARNING_DISABLED) {
-            chart.setDividerLoc((int) (policy.warningBytes / RESOLUTION));
-            float weight = policy.warningBytes / RESOLUTION / (float) top;
+            int dividerLoc = (int) (policy.warningBytes / RESOLUTION);
+            chart.setDividerLoc(dividerLoc);
+            float weight = dividerLoc / (float) top;
             float above = 1 - weight;
             chart.setSideLabelWeights(above, weight);
             middleVisibility = mWarningColor;
@@ -289,15 +289,21 @@
         return new SpannableStringBuilder().append(label, new ForegroundColorSpan(mLimitColor), 0);
     }
 
-    public void setNetworkPolicy(NetworkPolicy policy) {
+    /** Sets network policy. */
+    public void setNetworkPolicy(@Nullable NetworkPolicy policy) {
         mPolicy = policy;
         notifyChanged();
     }
 
+    /** Sets time. */
+    public void setTime(long start, long end) {
+        mStart = start;
+        mEnd = end;
+        notifyChanged();
+    }
+
     public void setNetworkCycleData(NetworkCycleChartData data) {
         mNetworkCycleChartData = data;
-        mStart = data.getStartTime();
-        mEnd = data.getEndTime();
         notifyChanged();
     }
 }
diff --git a/src/com/android/settings/datausage/ChartDataUsagePreferenceController.kt b/src/com/android/settings/datausage/ChartDataUsagePreferenceController.kt
new file mode 100644
index 0000000..0479be4
--- /dev/null
+++ b/src/com/android/settings/datausage/ChartDataUsagePreferenceController.kt
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2023 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.datausage
+
+import android.content.Context
+import android.net.NetworkTemplate
+import androidx.annotation.OpenForTesting
+import androidx.annotation.VisibleForTesting
+import androidx.lifecycle.LifecycleCoroutineScope
+import androidx.lifecycle.LifecycleOwner
+import androidx.lifecycle.lifecycleScope
+import androidx.preference.PreferenceScreen
+import com.android.settings.core.BasePreferenceController
+import com.android.settings.datausage.lib.INetworkCycleDataRepository
+import com.android.settings.datausage.lib.NetworkCycleDataRepository
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
+
+@OpenForTesting
+open class ChartDataUsagePreferenceController(context: Context, preferenceKey: String) :
+    BasePreferenceController(context, preferenceKey) {
+
+    private lateinit var repository: INetworkCycleDataRepository
+    private lateinit var preference: ChartDataUsagePreference
+    private lateinit var lifecycleScope: LifecycleCoroutineScope
+
+    open fun init(template: NetworkTemplate) {
+        this.repository = NetworkCycleDataRepository(mContext, template)
+    }
+
+    @VisibleForTesting
+    fun init(repository: INetworkCycleDataRepository) {
+        this.repository = repository
+    }
+
+    override fun getAvailabilityStatus() = AVAILABLE
+
+    override fun displayPreference(screen: PreferenceScreen) {
+        super.displayPreference(screen)
+        preference = screen.findPreference(preferenceKey)!!
+    }
+
+    override fun onViewCreated(viewLifecycleOwner: LifecycleOwner) {
+        lifecycleScope = viewLifecycleOwner.lifecycleScope
+    }
+
+    /**
+     * Sets whether billing cycle modifiable.
+     *
+     * Don't bind warning / limit sweeps if not modifiable.
+     */
+    open fun setBillingCycleModifiable(isModifiable: Boolean) {
+        preference.setNetworkPolicy(
+            if (isModifiable) repository.getPolicy() else null
+        )
+    }
+
+    fun update(startTime: Long, endTime: Long) {
+        preference.setTime(startTime, endTime)
+        lifecycleScope.launch {
+            val chartData = withContext(Dispatchers.Default) {
+                repository.querySummary(startTime, endTime)
+            }
+            preference.setNetworkCycleData(chartData)
+        }
+    }
+}
diff --git a/src/com/android/settings/datausage/CycleAdapter.java b/src/com/android/settings/datausage/CycleAdapter.java
index 90a2035..7cff05e 100644
--- a/src/com/android/settings/datausage/CycleAdapter.java
+++ b/src/com/android/settings/datausage/CycleAdapter.java
@@ -14,9 +14,9 @@
 package com.android.settings.datausage;
 
 import android.content.Context;
+import android.util.Range;
 
 import com.android.settings.Utils;
-import com.android.settingslib.net.NetworkCycleData;
 import com.android.settingslib.widget.SettingsSpinnerAdapter;
 
 import java.util.List;
@@ -62,15 +62,15 @@
      * Rebuild list based on network data. Always selects the newest item,
      * updating the inspection range on chartData.
      */
-    public void updateCycleList(List<? extends NetworkCycleData> cycleData) {
+    public void updateCycleList(List<Range<Long>> cycleData) {
         // stash away currently selected cycle to try restoring below
         final CycleAdapter.CycleItem previousItem = (CycleAdapter.CycleItem)
                 mSpinner.getSelectedItem();
         clear();
 
         final Context context = getContext();
-        for (NetworkCycleData data : cycleData) {
-            add(new CycleAdapter.CycleItem(context, data.getStartTime(), data.getEndTime()));
+        for (Range<Long> cycle : cycleData) {
+            add(new CycleAdapter.CycleItem(context, cycle.getLower(), cycle.getUpper()));
         }
 
         // force pick the current cycle (first item)
diff --git a/src/com/android/settings/datausage/DataUsageList.java b/src/com/android/settings/datausage/DataUsageList.java
deleted file mode 100644
index e7345ab..0000000
--- a/src/com/android/settings/datausage/DataUsageList.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * 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.datausage;
-
-import android.app.Activity;
-import android.app.settings.SettingsEnums;
-import android.content.Context;
-import android.content.Intent;
-import android.net.NetworkPolicy;
-import android.net.NetworkTemplate;
-import android.os.Bundle;
-import android.os.UserManager;
-import android.provider.Settings;
-import android.telephony.SubscriptionManager;
-import android.util.EventLog;
-import android.util.Log;
-import android.view.View;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.VisibleForTesting;
-import androidx.lifecycle.Lifecycle;
-import androidx.loader.app.LoaderManager.LoaderCallbacks;
-import androidx.loader.content.Loader;
-import androidx.preference.Preference;
-
-import com.android.settings.R;
-import com.android.settings.datausage.lib.BillingCycleRepository;
-import com.android.settings.network.MobileDataEnabledListener;
-import com.android.settings.network.MobileNetworkRepository;
-import com.android.settings.widget.LoadingViewController;
-import com.android.settingslib.mobile.dataservice.SubscriptionInfoEntity;
-import com.android.settingslib.net.NetworkCycleChartData;
-import com.android.settingslib.net.NetworkCycleChartDataLoader;
-import com.android.settingslib.utils.ThreadUtils;
-
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-
-import kotlin.Unit;
-
-/**
- * Panel showing data usage history across various networks, including options
- * to inspect based on usage cycle and control through {@link NetworkPolicy}.
- */
-public class DataUsageList extends DataUsageBaseFragment
-        implements MobileDataEnabledListener.Client {
-
-    static final String EXTRA_SUB_ID = "sub_id";
-    static final String EXTRA_NETWORK_TEMPLATE = "network_template";
-
-    private static final String TAG = "DataUsageList";
-    private static final boolean LOGD = false;
-
-    private static final String KEY_USAGE_AMOUNT = "usage_amount";
-    private static final String KEY_CHART_DATA = "chart_data";
-    private static final String KEY_TEMPLATE = "template";
-    private static final String KEY_APP = "app";
-
-    @VisibleForTesting
-    static final int LOADER_CHART_DATA = 2;
-
-    @VisibleForTesting
-    MobileDataEnabledListener mDataStateListener;
-
-    @VisibleForTesting
-    NetworkTemplate mTemplate;
-    @VisibleForTesting
-    int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
-    @VisibleForTesting
-    LoadingViewController mLoadingViewController;
-
-    private ChartDataUsagePreference mChart;
-
-    @Nullable
-    private List<NetworkCycleChartData> mCycleData;
-
-    // Spinner will keep the selected cycle even after paused, this only keeps the displayed cycle,
-    // which need be cleared when resumed.
-    private CycleAdapter.CycleItem mLastDisplayedCycle;
-    private Preference mUsageAmount;
-    private MobileNetworkRepository mMobileNetworkRepository;
-    private SubscriptionInfoEntity mSubscriptionInfoEntity;
-    private DataUsageListAppsController mDataUsageListAppsController;
-    private BillingCycleRepository mBillingCycleRepository;
-    @VisibleForTesting
-    DataUsageListHeaderController mDataUsageListHeaderController;
-
-    private boolean mIsBillingCycleModifiable = false;
-
-    @Override
-    public int getMetricsCategory() {
-        return SettingsEnums.DATA_USAGE_LIST;
-    }
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        if (isGuestUser(getContext())) {
-            Log.e(TAG, "This setting isn't available for guest user");
-            EventLog.writeEvent(0x534e4554, "262741858", -1 /* UID */, "Guest user");
-            finish();
-            return;
-        }
-
-        final Activity activity = getActivity();
-        mBillingCycleRepository = createBillingCycleRepository();
-        if (!mBillingCycleRepository.isBandwidthControlEnabled()) {
-            Log.w(TAG, "No bandwidth control; leaving");
-            activity.finish();
-            return;
-        }
-
-        mUsageAmount = findPreference(KEY_USAGE_AMOUNT);
-        mChart = findPreference(KEY_CHART_DATA);
-
-        processArgument();
-        if (mTemplate == null) {
-            Log.e(TAG, "No template; leaving");
-            finish();
-            return;
-        }
-        updateSubscriptionInfoEntity();
-        mDataStateListener = new MobileDataEnabledListener(activity, this);
-        mDataUsageListAppsController = use(DataUsageListAppsController.class);
-        mDataUsageListAppsController.init(mTemplate);
-    }
-
-    @VisibleForTesting
-    @NonNull
-    BillingCycleRepository createBillingCycleRepository() {
-        return new BillingCycleRepository(requireContext());
-    }
-
-    @Override
-    public void onViewCreated(@NonNull View v, Bundle savedInstanceState) {
-        super.onViewCreated(v, savedInstanceState);
-
-        mDataUsageListHeaderController = new DataUsageListHeaderController(
-                setPinnedHeaderView(R.layout.apps_filter_spinner),
-                mTemplate,
-                getMetricsCategory(),
-                (cycle, position) -> {
-                    updateSelectedCycle(cycle, position);
-                    return Unit.INSTANCE;
-                }
-        );
-
-        mLoadingViewController = new LoadingViewController(
-                getView().findViewById(R.id.loading_container), getListView());
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        mLoadingViewController.showLoadingViewDelayed();
-        mDataStateListener.start(mSubId);
-        mLastDisplayedCycle = null;
-        updatePolicy();
-
-        // kick off loader for network history
-        // TODO: consider chaining two loaders together instead of reloading
-        // network history when showing app detail.
-        getLoaderManager().restartLoader(LOADER_CHART_DATA,
-                buildArgs(mTemplate), mNetworkCycleDataCallbacks);
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-        mDataStateListener.stop();
-
-        getLoaderManager().destroyLoader(LOADER_CHART_DATA);
-    }
-
-    @Override
-    protected int getPreferenceScreenResId() {
-        return R.xml.data_usage_list;
-    }
-
-    @Override
-    protected String getLogTag() {
-        return TAG;
-    }
-
-    void processArgument() {
-        final Bundle args = getArguments();
-        if (args != null) {
-            mSubId = args.getInt(EXTRA_SUB_ID, SubscriptionManager.INVALID_SUBSCRIPTION_ID);
-            mTemplate = args.getParcelable(EXTRA_NETWORK_TEMPLATE);
-        }
-        if (mTemplate == null && mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
-            final Intent intent = getIntent();
-            mSubId = intent.getIntExtra(Settings.EXTRA_SUB_ID,
-                    SubscriptionManager.INVALID_SUBSCRIPTION_ID);
-            mTemplate = intent.getParcelableExtra(Settings.EXTRA_NETWORK_TEMPLATE);
-
-            if (mTemplate == null) {
-                Optional<NetworkTemplate> mobileNetworkTemplateFromSim =
-                        DataUsageUtils.getMobileNetworkTemplateFromSubId(getContext(), getIntent());
-                if (mobileNetworkTemplateFromSim.isPresent()) {
-                    mTemplate = mobileNetworkTemplateFromSim.get();
-                }
-            }
-        }
-    }
-
-    @VisibleForTesting
-    void updateSubscriptionInfoEntity() {
-        mMobileNetworkRepository = MobileNetworkRepository.getInstance(getContext());
-        ThreadUtils.postOnBackgroundThread(() -> {
-            mSubscriptionInfoEntity = mMobileNetworkRepository.getSubInfoById(
-                    String.valueOf(mSubId));
-        });
-    }
-
-    /**
-     * Implementation of {@code MobileDataEnabledListener.Client}
-     */
-    public void onMobileDataEnabledChange() {
-        updatePolicy();
-    }
-
-    private Bundle buildArgs(NetworkTemplate template) {
-        final Bundle args = new Bundle();
-        args.putParcelable(KEY_TEMPLATE, template);
-        args.putParcelable(KEY_APP, null);
-        return args;
-    }
-
-    /**
-     * Update chart sweeps and cycle list to reflect {@link NetworkPolicy} for
-     * current {@link #mTemplate}.
-     */
-    @VisibleForTesting
-    void updatePolicy() {
-        mIsBillingCycleModifiable = isBillingCycleModifiable();
-        if (mIsBillingCycleModifiable) {
-            mChart.setNetworkPolicy(services.mPolicyEditor.getPolicy(mTemplate));
-        } else {
-            mChart.setNetworkPolicy(null);  // don't bind warning / limit sweeps
-        }
-        updateConfigButtonVisibility();
-    }
-
-    @VisibleForTesting
-    boolean isBillingCycleModifiable() {
-        return mBillingCycleRepository.isModifiable(mSubId)
-                && SubscriptionManager.from(requireContext())
-                .getActiveSubscriptionInfo(mSubId) != null;
-    }
-
-    private void updateConfigButtonVisibility() {
-        mDataUsageListHeaderController.setConfigButtonVisible(
-                mIsBillingCycleModifiable && mCycleData != null);
-    }
-
-    /**
-     * Updates the chart and detail data when initial loaded or selected cycle changed.
-     */
-    private void updateSelectedCycle(CycleAdapter.CycleItem cycle, int position) {
-        // Avoid from updating UI after #onStop.
-        if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
-            return;
-        }
-
-        // Avoid from updating UI when async query still on-going.
-        // This could happen when a request from #onMobileDataEnabledChange.
-        if (mCycleData == null) {
-            return;
-        }
-
-        if (Objects.equals(cycle, mLastDisplayedCycle)) {
-            // Avoid duplicate update to avoid page flash.
-            return;
-        }
-        mLastDisplayedCycle = cycle;
-
-        if (LOGD) {
-            Log.d(TAG, "showing cycle " + cycle + ", [start=" + cycle.start + ", end="
-                    + cycle.end + "]");
-        }
-
-        // update chart to show selected cycle, and update detail data
-        // to match updated sweep bounds.
-        NetworkCycleChartData cycleChartData = mCycleData.get(position);
-        mChart.setNetworkCycleData(cycleChartData);
-
-        updateDetailData(cycleChartData);
-    }
-
-    /**
-     * Update details based on {@link #mChart} inspection range depending on
-     * current mode. Updates {@link #mAdapter} with sorted list
-     * of applications data usage.
-     */
-    private void updateDetailData(NetworkCycleChartData cycleChartData) {
-        if (LOGD) Log.d(TAG, "updateDetailData()");
-
-        // kick off loader for detailed stats
-        mDataUsageListAppsController.update(
-                mSubscriptionInfoEntity == null ? null : mSubscriptionInfoEntity.carrierId,
-                cycleChartData.getStartTime(),
-                cycleChartData.getEndTime()
-        );
-
-        final long totalBytes = cycleChartData.getTotalUsage();
-        final CharSequence totalPhrase = DataUsageUtils.formatDataUsage(getActivity(), totalBytes);
-        mUsageAmount.setTitle(getString(R.string.data_used_template, totalPhrase));
-    }
-
-    @VisibleForTesting
-    final LoaderCallbacks<List<NetworkCycleChartData>> mNetworkCycleDataCallbacks =
-            new LoaderCallbacks<>() {
-                @Override
-                @NonNull
-                public Loader<List<NetworkCycleChartData>> onCreateLoader(int id, Bundle args) {
-                    return NetworkCycleChartDataLoader.builder(getContext())
-                            .setNetworkTemplate(mTemplate)
-                            .build();
-                }
-
-                @Override
-                public void onLoadFinished(@NonNull Loader<List<NetworkCycleChartData>> loader,
-                        List<NetworkCycleChartData> data) {
-                    mLoadingViewController.showContent(false /* animate */);
-                    mCycleData = data;
-                    mDataUsageListHeaderController.updateCycleData(mCycleData);
-                    updateConfigButtonVisibility();
-                    mDataUsageListAppsController.setCycleData(mCycleData);
-                }
-
-                @Override
-                public void onLoaderReset(@NonNull Loader<List<NetworkCycleChartData>> loader) {
-                    mCycleData = null;
-                }
-            };
-
-    private static boolean isGuestUser(Context context) {
-        if (context == null) return false;
-        final UserManager userManager = context.getSystemService(UserManager.class);
-        if (userManager == null) return false;
-        return userManager.isGuestUser();
-    }
-}
diff --git a/src/com/android/settings/datausage/DataUsageList.kt b/src/com/android/settings/datausage/DataUsageList.kt
new file mode 100644
index 0000000..9ac7161
--- /dev/null
+++ b/src/com/android/settings/datausage/DataUsageList.kt
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2023 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.datausage
+
+import android.app.settings.SettingsEnums
+import android.net.NetworkPolicy
+import android.net.NetworkTemplate
+import android.os.Bundle
+import android.provider.Settings
+import android.telephony.SubscriptionManager
+import android.util.EventLog
+import android.util.Log
+import android.view.View
+import androidx.annotation.OpenForTesting
+import androidx.annotation.VisibleForTesting
+import androidx.preference.Preference
+import com.android.settings.R
+import com.android.settings.datausage.lib.BillingCycleRepository
+import com.android.settings.datausage.lib.NetworkUsageData
+import com.android.settings.network.MobileDataEnabledListener
+import com.android.settings.network.MobileNetworkRepository
+import com.android.settingslib.mobile.dataservice.SubscriptionInfoEntity
+import com.android.settingslib.spaprivileged.framework.common.userManager
+import com.android.settingslib.utils.ThreadUtils
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Panel showing data usage history across various networks, including options
+ * to inspect based on usage cycle and control through [NetworkPolicy].
+ */
+@OpenForTesting
+open class DataUsageList : DataUsageBaseFragment(), MobileDataEnabledListener.Client {
+    @VisibleForTesting
+    lateinit var dataStateListener: MobileDataEnabledListener
+
+    @JvmField
+    @VisibleForTesting
+    var template: NetworkTemplate? = null
+
+    @JvmField
+    @VisibleForTesting
+    var subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID
+
+    // Spinner will keep the selected cycle even after paused, this only keeps the displayed cycle,
+    // which need be cleared when resumed.
+    private var lastDisplayedUsageData: NetworkUsageData? = null
+    private lateinit var usageAmount: Preference
+    private var subscriptionInfoEntity: SubscriptionInfoEntity? = null
+    private lateinit var dataUsageListAppsController: DataUsageListAppsController
+    private lateinit var chartDataUsagePreferenceController: ChartDataUsagePreferenceController
+    private lateinit var billingCycleRepository: BillingCycleRepository
+
+    @VisibleForTesting
+    var dataUsageListHeaderController: DataUsageListHeaderController? = null
+
+    override fun getMetricsCategory() = SettingsEnums.DATA_USAGE_LIST
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        if (requireContext().userManager.isGuestUser) {
+            Log.e(TAG, "This setting isn't available for guest user")
+            EventLog.writeEvent(0x534e4554, "262741858", -1 /* UID */, "Guest user")
+            finish()
+            return
+        }
+        billingCycleRepository = createBillingCycleRepository();
+        if (!billingCycleRepository.isBandwidthControlEnabled()) {
+            Log.w(TAG, "No bandwidth control; leaving")
+            finish()
+            return
+        }
+        usageAmount = findPreference(KEY_USAGE_AMOUNT)!!
+        processArgument()
+        val template = template
+        if (template == null) {
+            Log.e(TAG, "No template; leaving")
+            finish()
+            return
+        }
+        updateSubscriptionInfoEntity()
+        dataStateListener = MobileDataEnabledListener(activity, this)
+        dataUsageListAppsController = use(DataUsageListAppsController::class.java).apply {
+            init(template)
+        }
+        chartDataUsagePreferenceController = use(ChartDataUsagePreferenceController::class.java)
+        chartDataUsagePreferenceController.init(template)
+    }
+
+    @VisibleForTesting
+    open fun createBillingCycleRepository() = BillingCycleRepository(requireContext())
+
+    override fun onViewCreated(v: View, savedInstanceState: Bundle?) {
+        super.onViewCreated(v, savedInstanceState)
+
+        val template = template ?: return
+        dataUsageListHeaderController = DataUsageListHeaderController(
+            setPinnedHeaderView(R.layout.apps_filter_spinner),
+            template,
+            metricsCategory,
+            viewLifecycleOwner,
+            ::onCyclesLoad,
+            ::updateSelectedCycle,
+        )
+    }
+
+    override fun onResume() {
+        super.onResume()
+        dataStateListener.start(subId)
+        lastDisplayedUsageData = null
+        updatePolicy()
+    }
+
+    override fun onPause() {
+        super.onPause()
+        dataStateListener.stop()
+    }
+
+    override fun getPreferenceScreenResId() = R.xml.data_usage_list
+
+    override fun getLogTag() = TAG
+
+    fun processArgument() {
+        arguments?.let {
+            subId = it.getInt(EXTRA_SUB_ID, SubscriptionManager.INVALID_SUBSCRIPTION_ID)
+            template = it.getParcelable(EXTRA_NETWORK_TEMPLATE, NetworkTemplate::class.java)
+        }
+        if (template == null && subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
+            subId = intent.getIntExtra(
+                Settings.EXTRA_SUB_ID,
+                SubscriptionManager.INVALID_SUBSCRIPTION_ID,
+            )
+            template = intent.getParcelableExtra(
+                Settings.EXTRA_NETWORK_TEMPLATE,
+                NetworkTemplate::class.java,
+            ) ?: DataUsageUtils.getMobileNetworkTemplateFromSubId(context, intent).getOrNull()
+        }
+    }
+
+    @VisibleForTesting
+    open fun updateSubscriptionInfoEntity() {
+        ThreadUtils.postOnBackgroundThread {
+            subscriptionInfoEntity =
+                MobileNetworkRepository.getInstance(context).getSubInfoById(subId.toString())
+        }
+    }
+
+    /**
+     * Implementation of `MobileDataEnabledListener.Client`
+     */
+    override fun onMobileDataEnabledChange() {
+        updatePolicy()
+    }
+
+    /** Update chart sweeps and cycle list to reflect [NetworkPolicy] for current [template]. */
+    @VisibleForTesting
+    fun updatePolicy() {
+        val isBillingCycleModifiable = isBillingCycleModifiable()
+        dataUsageListHeaderController?.setConfigButtonVisible(isBillingCycleModifiable)
+        chartDataUsagePreferenceController.setBillingCycleModifiable(isBillingCycleModifiable)
+    }
+
+    @VisibleForTesting
+    open fun isBillingCycleModifiable(): Boolean {
+        return (billingCycleRepository.isModifiable(subId) &&
+            requireContext().getSystemService(SubscriptionManager::class.java)!!
+                .getActiveSubscriptionInfo(subId) != null)
+    }
+
+    private fun onCyclesLoad(networkUsageData: List<NetworkUsageData>) {
+        dataUsageListAppsController.updateCycles(networkUsageData)
+    }
+
+    /**
+     * Updates the chart and detail data when initial loaded or selected cycle changed.
+     */
+    private fun updateSelectedCycle(usageData: NetworkUsageData) {
+        if (usageData == lastDisplayedUsageData) {
+            // Avoid duplicate update to avoid page flash.
+            return
+        }
+        lastDisplayedUsageData = usageData
+        Log.d(TAG, "showing cycle $usageData")
+
+        val totalPhrase = DataUsageUtils.formatDataUsage(requireContext(), usageData.usage)
+        usageAmount.title = getString(R.string.data_used_template, totalPhrase)
+
+        updateChart(usageData)
+        updateApps(usageData)
+    }
+
+    /** Updates chart to show selected cycle. */
+    private fun updateChart(usageData: NetworkUsageData) {
+        chartDataUsagePreferenceController.update(
+            startTime = usageData.startTime,
+            endTime = usageData.endTime,
+        )
+    }
+
+    /** Updates applications data usage. */
+    private fun updateApps(usageData: NetworkUsageData) {
+        dataUsageListAppsController.update(
+            carrierId = subscriptionInfoEntity?.carrierId,
+            startTime = usageData.startTime,
+            endTime = usageData.endTime,
+        )
+    }
+
+    companion object {
+        const val EXTRA_SUB_ID = "sub_id"
+        const val EXTRA_NETWORK_TEMPLATE = "network_template"
+
+        private const val TAG = "DataUsageList"
+        private const val KEY_USAGE_AMOUNT = "usage_amount"
+    }
+}
diff --git a/src/com/android/settings/datausage/DataUsageListAppsController.kt b/src/com/android/settings/datausage/DataUsageListAppsController.kt
index c324407..93623f4 100644
--- a/src/com/android/settings/datausage/DataUsageListAppsController.kt
+++ b/src/com/android/settings/datausage/DataUsageListAppsController.kt
@@ -31,8 +31,8 @@
 import com.android.settings.core.BasePreferenceController
 import com.android.settings.core.SubSettingLauncher
 import com.android.settings.datausage.lib.AppDataUsageRepository
+import com.android.settings.datausage.lib.NetworkUsageData
 import com.android.settingslib.AppItem
-import com.android.settingslib.net.NetworkCycleChartData
 import com.android.settingslib.net.UidDetailProvider
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
@@ -48,7 +48,7 @@
     private lateinit var preference: PreferenceGroup
     private lateinit var lifecycleScope: LifecycleCoroutineScope
 
-    private var cycleData: List<NetworkCycleChartData>? = null
+    private var cycleData: List<NetworkUsageData>? = null
 
     open fun init(template: NetworkTemplate) {
         this.template = template
@@ -70,7 +70,7 @@
         lifecycleScope = viewLifecycleOwner.lifecycleScope
     }
 
-    fun setCycleData(cycleData: List<NetworkCycleChartData>?) {
+    fun updateCycles(cycleData: List<NetworkUsageData>) {
         this.cycleData = cycleData
     }
 
diff --git a/src/com/android/settings/datausage/DataUsageListHeaderController.kt b/src/com/android/settings/datausage/DataUsageListHeaderController.kt
index e295a4c..58fc3b5 100644
--- a/src/com/android/settings/datausage/DataUsageListHeaderController.kt
+++ b/src/com/android/settings/datausage/DataUsageListHeaderController.kt
@@ -18,25 +18,39 @@
 
 import android.net.NetworkTemplate
 import android.os.Bundle
+import android.util.Range
 import android.view.View
 import android.view.accessibility.AccessibilityEvent
 import android.widget.AdapterView
 import android.widget.Spinner
 import androidx.annotation.OpenForTesting
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.LifecycleOwner
+import androidx.lifecycle.lifecycleScope
+import androidx.lifecycle.repeatOnLifecycle
 import com.android.settings.R
 import com.android.settings.core.SubSettingLauncher
-import com.android.settings.datausage.CycleAdapter.CycleItem
 import com.android.settings.datausage.CycleAdapter.SpinnerInterface
-import com.android.settingslib.net.NetworkCycleChartData
+import com.android.settings.datausage.lib.INetworkCycleDataRepository
+import com.android.settings.datausage.lib.NetworkCycleDataRepository
+import com.android.settings.datausage.lib.NetworkUsageData
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
 
 @OpenForTesting
 open class DataUsageListHeaderController(
     header: View,
     template: NetworkTemplate,
     sourceMetricsCategory: Int,
-    private val onItemSelected: (cycleItem: CycleItem, position: Int) -> Unit,
+    viewLifecycleOwner: LifecycleOwner,
+    private val onCyclesLoad: (usageDataList: List<NetworkUsageData>) -> Unit,
+    private val onItemSelected: (usageData: NetworkUsageData) -> Unit,
+    private val repository: INetworkCycleDataRepository =
+        NetworkCycleDataRepository(header.context, template),
 ) {
     private val context = header.context
+
     private val configureButton: View = header.requireViewById(R.id.filter_settings)
     private val cycleSpinner: Spinner = header.requireViewById(R.id.filter_spinner)
     private val cycleAdapter = CycleAdapter(context, object : SpinnerInterface {
@@ -50,13 +64,12 @@
             cycleSpinner.setSelection(position)
         }
     })
+    private var cycles: List<NetworkUsageData> = emptyList()
 
     private val cycleListener = object : AdapterView.OnItemSelectedListener {
         override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
             if (0 <= position && position < cycleAdapter.count) {
-                cycleAdapter.getItem(position)?.let { cycleItem ->
-                    onItemSelected(cycleItem, position)
-                }
+                cycles.getOrNull(position)?.let(onItemSelected)
             }
         }
 
@@ -80,24 +93,32 @@
         cycleSpinner.visibility = View.GONE
         cycleSpinner.accessibilityDelegate = object : View.AccessibilityDelegate() {
             override fun sendAccessibilityEvent(host: View, eventType: Int) {
-                if (eventType == AccessibilityEvent.TYPE_VIEW_SELECTED) {
-                    // Ignore TYPE_VIEW_SELECTED or TalkBack will speak for it at onResume.
-                    return
-                }
+                // Ignore TYPE_VIEW_SELECTED or TalkBack will speak for it at onResume.
+                if (eventType == AccessibilityEvent.TYPE_VIEW_SELECTED) return
                 super.sendAccessibilityEvent(host, eventType)
             }
         }
+
+        viewLifecycleOwner.lifecycleScope.launch {
+            viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
+                cycles = withContext(Dispatchers.Default) {
+                    repository.loadCycles()
+                }
+                updateCycleData()
+            }
+        }
     }
 
     open fun setConfigButtonVisible(visible: Boolean) {
         configureButton.visibility = if (visible) View.VISIBLE else View.GONE
     }
 
-    open fun updateCycleData(cycleData: List<NetworkCycleChartData>) {
+    private fun updateCycleData() {
         cycleSpinner.onItemSelectedListener = cycleListener
         // calculate policy cycles based on available data
         // generate cycle list based on policy and available history
-        cycleAdapter.updateCycleList(cycleData)
+        cycleAdapter.updateCycleList(cycles.map { Range(it.startTime, it.endTime) })
         cycleSpinner.visibility = View.VISIBLE
+        onCyclesLoad(cycles)
     }
 }
diff --git a/src/com/android/settings/datausage/lib/NetworkCycleChartData.kt b/src/com/android/settings/datausage/lib/NetworkCycleChartData.kt
new file mode 100644
index 0000000..fd3c504
--- /dev/null
+++ b/src/com/android/settings/datausage/lib/NetworkCycleChartData.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2023 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.datausage.lib
+
+import kotlin.time.Duration.Companion.days
+
+/**
+ * Usage data in a billing cycle with daily data for plotting the usage chart.
+ */
+data class NetworkCycleChartData(
+    val total: NetworkUsageData,
+    val dailyUsage: List<NetworkUsageData>,
+) {
+    companion object {
+        val BUCKET_DURATION = 1.days
+    }
+}
diff --git a/src/com/android/settings/datausage/lib/NetworkCycleDataRepository.kt b/src/com/android/settings/datausage/lib/NetworkCycleDataRepository.kt
new file mode 100644
index 0000000..f10d506
--- /dev/null
+++ b/src/com/android/settings/datausage/lib/NetworkCycleDataRepository.kt
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) 2023 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.datausage.lib
+
+import android.app.usage.NetworkStats
+import android.app.usage.NetworkStatsManager
+import android.content.Context
+import android.net.NetworkPolicy
+import android.net.NetworkPolicyManager
+import android.net.NetworkTemplate
+import android.text.format.DateUtils
+import android.util.Log
+import android.util.Range
+import androidx.annotation.VisibleForTesting
+import com.android.settingslib.NetworkPolicyEditor
+import kotlinx.coroutines.async
+import kotlinx.coroutines.awaitAll
+import kotlinx.coroutines.coroutineScope
+
+interface INetworkCycleDataRepository {
+    suspend fun loadCycles(): List<NetworkUsageData>
+    fun getPolicy(): NetworkPolicy?
+    suspend fun querySummary(startTime: Long, endTime: Long): NetworkCycleChartData?
+}
+
+class NetworkCycleDataRepository(
+    context: Context,
+    private val networkTemplate: NetworkTemplate,
+) : INetworkCycleDataRepository {
+    private val networkStatsManager = context.getSystemService(NetworkStatsManager::class.java)!!
+
+    private val policyManager = context.getSystemService(NetworkPolicyManager::class.java)!!
+
+    override suspend fun loadCycles(): List<NetworkUsageData> =
+        getCycles().queryUsage().filter { it.usage > 0 }
+
+    private fun getCycles(): List<Range<Long>> {
+        val policy = getPolicy() ?: return queryCyclesAsFourWeeks()
+        return policy.cycleIterator().asSequence().map {
+            Range(it.lower.toInstant().toEpochMilli(), it.upper.toInstant().toEpochMilli())
+        }.toList()
+    }
+
+    private fun queryCyclesAsFourWeeks(): List<Range<Long>> {
+        val timeRange = getTimeRange()
+        return reverseBucketRange(
+            startTime = timeRange.lower,
+            endTime = timeRange.upper,
+            bucketSize = DateUtils.WEEK_IN_MILLIS * 4,
+        )
+    }
+
+    @VisibleForTesting
+    fun getTimeRange(): Range<Long> = getTimeRangeOf(
+        networkStatsManager.queryDetailsForDevice(networkTemplate, Long.MIN_VALUE, Long.MAX_VALUE)
+    )
+
+    private fun getTimeRangeOf(stats: NetworkStats): Range<Long> {
+        var start = Long.MAX_VALUE
+        var end = Long.MIN_VALUE
+        val bucket = NetworkStats.Bucket()
+        while (stats.getNextBucket(bucket)) {
+            start = start.coerceAtMost(bucket.startTimeStamp)
+            end = end.coerceAtLeast(bucket.endTimeStamp)
+        }
+        return Range(start, end)
+    }
+
+    override fun getPolicy(): NetworkPolicy? =
+        with(NetworkPolicyEditor(policyManager)) {
+            read()
+            getPolicy(networkTemplate)
+        }
+
+    override suspend fun querySummary(startTime: Long, endTime: Long): NetworkCycleChartData? {
+        val usage = getUsage(startTime, endTime)
+        if (usage > 0L) {
+            return NetworkCycleChartData(
+                total = NetworkUsageData(startTime, endTime, usage),
+                dailyUsage = bucketRange(
+                    startTime = startTime,
+                    endTime = endTime,
+                    bucketSize = NetworkCycleChartData.BUCKET_DURATION.inWholeMilliseconds,
+                ).queryUsage(),
+            )
+        }
+        return null
+    }
+
+    private suspend fun List<Range<Long>>.queryUsage(): List<NetworkUsageData> = coroutineScope {
+        map { range ->
+            async {
+                NetworkUsageData(
+                    startTime = range.lower,
+                    endTime = range.upper,
+                    usage = getUsage(range.lower, range.upper),
+                )
+            }
+        }.awaitAll()
+    }
+
+    private fun bucketRange(startTime: Long, endTime: Long, bucketSize: Long): List<Range<Long>> {
+        val buckets = mutableListOf<Range<Long>>()
+        var currentStart = startTime
+        while (currentStart < endTime) {
+            val bucketEnd = currentStart + bucketSize
+            buckets += Range(currentStart, bucketEnd)
+            currentStart = bucketEnd
+        }
+        return buckets
+    }
+
+    private fun reverseBucketRange(
+        startTime: Long,
+        endTime: Long,
+        bucketSize: Long,
+    ): List<Range<Long>> {
+        val buckets = mutableListOf<Range<Long>>()
+        var currentEnd = endTime
+        while (currentEnd > startTime) {
+            val bucketStart = currentEnd - bucketSize
+            buckets += Range(bucketStart, currentEnd)
+            currentEnd = bucketStart
+        }
+        return buckets
+    }
+
+    private fun getUsage(start: Long, end: Long): Long = try {
+        networkStatsManager.querySummaryForDevice(networkTemplate, start, end).let {
+            it.rxBytes + it.txBytes
+        }
+    } catch (e: Exception) {
+        Log.e(TAG, "Exception querying network detail.", e)
+        0
+    }
+
+    companion object {
+        private const val TAG = "NetworkCycleDataRepository"
+    }
+}
diff --git a/src/com/android/settings/datausage/lib/NetworkUsageData.kt b/src/com/android/settings/datausage/lib/NetworkUsageData.kt
new file mode 100644
index 0000000..fc5db2b
--- /dev/null
+++ b/src/com/android/settings/datausage/lib/NetworkUsageData.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2023 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.datausage.lib
+
+/**
+ * Base data structure representing usage data in a period.
+ */
+data class NetworkUsageData(
+    val startTime: Long,
+    val endTime: Long,
+    val usage: Long,
+)
diff --git a/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverController.java b/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverController.java
index b3af95e..95cf64c 100644
--- a/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverController.java
+++ b/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverController.java
@@ -57,6 +57,10 @@
     @VisibleForTesting
     static final String PROPERTY_PERSISTENT_GRAPHICS_EGL = "persist.graphics.egl";
 
+    @VisibleForTesting
+    static final String PROPERTY_DEBUG_ANGLE_DEVELOPER_OPTION =
+            "debug.graphics.angle.developeroption.enable";
+
     @VisibleForTesting static final String ANGLE_DRIVER_SUFFIX = "angle";
 
     @VisibleForTesting
@@ -72,6 +76,11 @@
                 public void set(String key, String val) {
                     SystemProperties.set(key, val);
                 }
+
+                @Override
+                public boolean getBoolean(String key, boolean def) {
+                    return SystemProperties.getBoolean(key, def);
+                }
             };
         }
     }
@@ -81,6 +90,13 @@
         this(context, fragment, new Injector());
     }
 
+    // Return true if the ANGLE developer option entry point is enabled.
+    // This can be enabled by calling:
+    //     `adb shell setprop debug.graphics.angle.developeroption.enable true`
+    private boolean isAngleDeveloperOptionEnabled() {
+        return mSystemProperties.getBoolean(PROPERTY_DEBUG_ANGLE_DEVELOPER_OPTION, false);
+    }
+
     private boolean isAngleSupported() {
         return TextUtils.equals(
                         mSystemProperties.get(PROPERTY_RO_GFX_ANGLE_SUPPORTED, ""), "true");
@@ -96,6 +112,10 @@
         // Exception is when user chooses to reboot now, the switch should keep its current value
         // and persist its' state over reboot.
         mShouldToggleSwitchBackOnRebootDialogDismiss = true;
+        final String persistGraphicsEglValue =
+                mSystemProperties.get(PROPERTY_PERSISTENT_GRAPHICS_EGL, "");
+        Log.v(TAG, "Value of " + PROPERTY_PERSISTENT_GRAPHICS_EGL + " is: "
+                + persistGraphicsEglValue);
     }
 
     @Override
@@ -149,6 +169,12 @@
             mPreference.setEnabled(false);
             ((SwitchPreference) mPreference).setChecked(false);
         }
+
+        // Regardless of whether ANGLE is enabled, disable the developer option UI
+        // as long as UI is not enabled via debug property.
+        if (!isAngleDeveloperOptionEnabled()) {
+            mPreference.setEnabled(false);
+        }
     }
 
     @Override
diff --git a/src/com/android/settings/development/graphicsdriver/GraphicsDriverSystemPropertiesWrapper.java b/src/com/android/settings/development/graphicsdriver/GraphicsDriverSystemPropertiesWrapper.java
index 549cd81..9684282 100644
--- a/src/com/android/settings/development/graphicsdriver/GraphicsDriverSystemPropertiesWrapper.java
+++ b/src/com/android/settings/development/graphicsdriver/GraphicsDriverSystemPropertiesWrapper.java
@@ -41,4 +41,13 @@
      * SELinux. libc will log the underlying reason.
      */
     void set(@NonNull String key, @Nullable String val);
+
+    /**
+     * Get the boolean value for the given {@code key}.
+     *
+     * @param key the key to lookup
+     * @param def the default value in case the property is not set or empty
+     * @return if the {@code key} isn't found, return {@code def}.
+     */
+    boolean getBoolean(@NonNull String key, @NonNull boolean def);
 }
diff --git a/src/com/android/settings/display/AutoRotatePreferenceController.java b/src/com/android/settings/display/AutoRotatePreferenceController.java
index f16cbfb..ec2592d 100644
--- a/src/com/android/settings/display/AutoRotatePreferenceController.java
+++ b/src/com/android/settings/display/AutoRotatePreferenceController.java
@@ -103,7 +103,8 @@
         final boolean isLocked = !isChecked;
         mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ROTATION_LOCK,
                 isLocked);
-        RotationPolicy.setRotationLock(mContext, isLocked);
+        RotationPolicy.setRotationLock(mContext, isLocked,
+                /* caller= */ "AutoRotatePreferenceController#setChecked");
         return true;
     }
 }
diff --git a/src/com/android/settings/display/AutoRotateSwitchBarController.java b/src/com/android/settings/display/AutoRotateSwitchBarController.java
index 93420b0..e6fc2e3 100644
--- a/src/com/android/settings/display/AutoRotateSwitchBarController.java
+++ b/src/com/android/settings/display/AutoRotateSwitchBarController.java
@@ -82,7 +82,8 @@
         final boolean isLocked = !isChecked;
         mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ROTATE_ROTATE_MASTER_TOGGLE,
                 isLocked);
-        RotationPolicy.setRotationLock(mContext, isLocked);
+        RotationPolicy.setRotationLock(mContext, isLocked,
+                /* caller= */ "AutoRotateSwitchBarController#setChecked");
         return true;
     }
 
diff --git a/src/com/android/settings/display/SmartAutoRotatePreferenceController.java b/src/com/android/settings/display/SmartAutoRotatePreferenceController.java
index 311068f..a5c15b6 100644
--- a/src/com/android/settings/display/SmartAutoRotatePreferenceController.java
+++ b/src/com/android/settings/display/SmartAutoRotatePreferenceController.java
@@ -169,7 +169,8 @@
         final boolean isLocked = !isChecked;
         mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ROTATION_LOCK,
                 isLocked);
-        RotationPolicy.setRotationLock(mContext, isLocked);
+        RotationPolicy.setRotationLock(mContext, isLocked,
+                /* caller= */ "SmartAutoRotatePreferenceController#setChecked");
         return true;
     }
 
diff --git a/src/com/android/settings/gestures/GlobalActionsPanelPreferenceController.java b/src/com/android/settings/gestures/GlobalActionsPanelPreferenceController.java
deleted file mode 100644
index 32a7ba5..0000000
--- a/src/com/android/settings/gestures/GlobalActionsPanelPreferenceController.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2019 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.gestures;
-
-import android.content.Context;
-import android.provider.Settings;
-import android.text.TextUtils;
-
-import com.android.internal.annotations.VisibleForTesting;
-
-public class GlobalActionsPanelPreferenceController extends GesturePreferenceController {
-    private static final String PREF_KEY_VIDEO = "global_actions_panel_video";
-
-    @VisibleForTesting
-    protected static final String ENABLED_SETTING = Settings.Secure.GLOBAL_ACTIONS_PANEL_ENABLED;
-    @VisibleForTesting
-    protected static final String AVAILABLE_SETTING =
-            Settings.Secure.GLOBAL_ACTIONS_PANEL_AVAILABLE;
-
-    @VisibleForTesting
-    protected static final String TOGGLE_KEY = "gesture_global_actions_panel_switch";
-
-    public GlobalActionsPanelPreferenceController(Context context, String key) {
-        super(context, key);
-    }
-
-    @Override
-    public int getAvailabilityStatus() {
-        int enabled = Settings.Secure.getInt(mContext.getContentResolver(), AVAILABLE_SETTING, 0);
-        return enabled == 1 ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
-    }
-
-    @Override
-    public boolean setChecked(boolean isChecked) {
-        return Settings.Secure.putInt(mContext.getContentResolver(), ENABLED_SETTING,
-                isChecked ? 1 : 0);
-    }
-
-    @Override
-    protected String getVideoPrefKey() {
-        return PREF_KEY_VIDEO;
-    }
-
-    @Override
-    public boolean isSliceable() {
-        return TextUtils.equals(getPreferenceKey(), TOGGLE_KEY);
-    }
-
-    @Override
-    public boolean isPublicSlice() {
-        return true;
-    }
-
-    @Override
-    public boolean isChecked() {
-        int enabled = Settings.Secure.getInt(mContext.getContentResolver(), ENABLED_SETTING, 0);
-        return enabled == 1;
-    }
-}
diff --git a/src/com/android/settings/localepicker/TermsOfAddressBaseController.java b/src/com/android/settings/localepicker/TermsOfAddressBaseController.java
new file mode 100644
index 0000000..34c502f
--- /dev/null
+++ b/src/com/android/settings/localepicker/TermsOfAddressBaseController.java
@@ -0,0 +1,82 @@
+/**
+ * Copyright (C) 2023 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.localepicker;
+
+import android.app.GrammaticalInflectionManager;
+import android.content.Context;
+
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.widget.TickButtonPreference;
+import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
+
+public abstract class TermsOfAddressBaseController extends BasePreferenceController {
+
+    private PreferenceScreen mPreferenceScreen;
+    private MetricsFeatureProvider mMetricsFeatureProvider;
+    private TickButtonPreference mPreference;
+    private GrammaticalInflectionManager mGrammaticalInflectionManager;
+
+    public TermsOfAddressBaseController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+        mMetricsFeatureProvider = FeatureFactory.getFeatureFactory().getMetricsFeatureProvider();
+        mGrammaticalInflectionManager = context.getSystemService(
+                GrammaticalInflectionManager.class);
+    }
+
+    @Override
+    public void displayPreference(PreferenceScreen screen) {
+        super.displayPreference(screen);
+        mPreferenceScreen = screen;
+        mPreference = screen.findPreference(getPreferenceKey());
+        mPreference.setOnPreferenceClickListener(clickedPref -> {
+            mGrammaticalInflectionManager.setSystemWideGrammaticalGender(
+                    getGrammaticalGenderType());
+            setSelected(mPreference);
+            mMetricsFeatureProvider.action(mContext, getMetricsActionKey());
+            return true;
+        });
+        updatePreferences();
+    }
+
+    private void setSelected(TickButtonPreference preference) {
+        for (int i = 1; i < mPreferenceScreen.getPreferenceCount(); i++) {
+            TickButtonPreference pref = (TickButtonPreference) mPreferenceScreen.getPreference(i);
+            pref.setSelected(pref.getKey().equals(preference.getKey()));
+        }
+    }
+
+    private void updatePreferences() {
+        if (mPreference == null) {
+            return;
+        }
+        mPreference.setSelected(
+                mGrammaticalInflectionManager.getSystemGrammaticalGender()
+                        == getGrammaticalGenderType());
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return AVAILABLE;
+    }
+
+    protected abstract int getMetricsActionKey();
+
+    protected abstract int getGrammaticalGenderType();
+}
diff --git a/src/com/android/settings/localepicker/TermsOfAddressFeminineController.java b/src/com/android/settings/localepicker/TermsOfAddressFeminineController.java
new file mode 100644
index 0000000..9a46872
--- /dev/null
+++ b/src/com/android/settings/localepicker/TermsOfAddressFeminineController.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (C) 2023 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.localepicker;
+
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.content.res.Configuration;
+
+public class TermsOfAddressFeminineController extends TermsOfAddressBaseController {
+
+    private static final String KEY_FEMININE = "key_terms_of_address_feminine";
+
+    public TermsOfAddressFeminineController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return KEY_FEMININE;
+    }
+
+    @Override
+    protected int getMetricsActionKey() {
+        return SettingsEnums.ACTION_TERMS_OF_ADDRESS_FEMININE;
+    }
+
+    @Override
+    protected int getGrammaticalGenderType() {
+        return Configuration.GRAMMATICAL_GENDER_FEMININE;
+    }
+}
diff --git a/src/com/android/settings/localepicker/TermsOfAddressMasculineController.java b/src/com/android/settings/localepicker/TermsOfAddressMasculineController.java
new file mode 100644
index 0000000..cb39df0
--- /dev/null
+++ b/src/com/android/settings/localepicker/TermsOfAddressMasculineController.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (C) 2023 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.localepicker;
+
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.content.res.Configuration;
+
+public class TermsOfAddressMasculineController extends TermsOfAddressBaseController {
+
+    private static final String KEY_MASCULINE = "key_terms_of_address_masculine";
+
+    public TermsOfAddressMasculineController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return KEY_MASCULINE;
+    }
+
+    @Override
+    protected int getMetricsActionKey() {
+        return SettingsEnums.ACTION_TERMS_OF_ADDRESS_MASCULINE;
+    }
+
+    @Override
+    protected int getGrammaticalGenderType() {
+        return Configuration.GRAMMATICAL_GENDER_MASCULINE;
+    }
+}
diff --git a/src/com/android/settings/localepicker/TermsOfAddressNeutralController.java b/src/com/android/settings/localepicker/TermsOfAddressNeutralController.java
new file mode 100644
index 0000000..e0693b5
--- /dev/null
+++ b/src/com/android/settings/localepicker/TermsOfAddressNeutralController.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (C) 2023 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.localepicker;
+
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.content.res.Configuration;
+
+public class TermsOfAddressNeutralController extends TermsOfAddressBaseController {
+
+    private static final String KEY_NEUTRAL = "key_terms_of_address_neutral";
+
+    public TermsOfAddressNeutralController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return KEY_NEUTRAL;
+    }
+
+    @Override
+    protected int getMetricsActionKey() {
+        return SettingsEnums.ACTION_TERMS_OF_ADDRESS_NEUTRAL;
+    }
+
+    @Override
+    protected int getGrammaticalGenderType() {
+        return Configuration.GRAMMATICAL_GENDER_NEUTRAL;
+    }
+}
diff --git a/src/com/android/settings/localepicker/TermsOfAddressNotSpecifiedController.java b/src/com/android/settings/localepicker/TermsOfAddressNotSpecifiedController.java
new file mode 100644
index 0000000..4e2e450
--- /dev/null
+++ b/src/com/android/settings/localepicker/TermsOfAddressNotSpecifiedController.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (C) 2023 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.localepicker;
+
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.content.res.Configuration;
+
+public class TermsOfAddressNotSpecifiedController extends TermsOfAddressBaseController {
+
+    private static final String KEY_NOT_SPECIFIED = "key_terms_of_address_not_specified";
+
+    public TermsOfAddressNotSpecifiedController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return KEY_NOT_SPECIFIED;
+    }
+
+    @Override
+    protected int getMetricsActionKey() {
+        return SettingsEnums.ACTION_TERMS_OF_ADDRESS_NOT_SPECIFIED;
+    }
+
+    @Override
+    protected int getGrammaticalGenderType() {
+        return Configuration.GRAMMATICAL_GENDER_NOT_SPECIFIED;
+    }
+}
diff --git a/src/com/android/settings/network/MobileNetworkRepository.java b/src/com/android/settings/network/MobileNetworkRepository.java
index 5d6ad33..80c5464 100644
--- a/src/com/android/settings/network/MobileNetworkRepository.java
+++ b/src/com/android/settings/network/MobileNetworkRepository.java
@@ -40,6 +40,7 @@
 import androidx.annotation.GuardedBy;
 import androidx.lifecycle.LifecycleOwner;
 
+import com.android.internal.telephony.flags.Flags;
 import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -703,9 +704,10 @@
                         Log.d(TAG, "insert subInfo to subInfoEntity, subInfo = " + subInfo);
                     }
                     if (subInfo.isEmbedded()
-                            && subInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING) {
+                        && (subInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
+                        || (Flags.oemEnabledSatelliteFlag() && subInfo.isNtn()))) {
                         if (DEBUG) {
-                            Log.d(TAG, "Do not insert the provision eSIM");
+                            Log.d(TAG, "Do not insert the provisioning or satellite eSIM");
                         }
                         continue;
                     }
diff --git a/src/com/android/settings/network/NetworkProviderSettings.java b/src/com/android/settings/network/NetworkProviderSettings.java
index eb50cea..793fecc 100644
--- a/src/com/android/settings/network/NetworkProviderSettings.java
+++ b/src/com/android/settings/network/NetworkProviderSettings.java
@@ -190,7 +190,10 @@
     @VisibleForTesting
     final Runnable mUpdateWifiEntryPreferencesRunnable = () -> {
         updateWifiEntryPreferences();
-        getView().postDelayed(mRemoveLoadingRunnable, 10);
+        View view = getView();
+        if (view != null) {
+            view.postDelayed(mRemoveLoadingRunnable, 10);
+        }
     };
     @VisibleForTesting
     final Runnable mHideProgressBarRunnable = () -> {
diff --git a/src/com/android/settings/network/SubscriptionsPreferenceController.java b/src/com/android/settings/network/SubscriptionsPreferenceController.java
index 9cd49c8..cc62189 100644
--- a/src/com/android/settings/network/SubscriptionsPreferenceController.java
+++ b/src/com/android/settings/network/SubscriptionsPreferenceController.java
@@ -265,9 +265,8 @@
 
     /**@return {@code true} if subId is the default data sub. **/
     private boolean isDds(int subId) {
-        return mSubscriptionManager.getDefaultDataSubscriptionInfo() != null
-                && mSubscriptionManager.getDefaultDataSubscriptionInfo().getSubscriptionId()
-                == subId;
+        SubscriptionInfo info = mSubscriptionManager.getDefaultDataSubscriptionInfo();
+        return info != null && info.getSubscriptionId() == subId;
     }
 
     private CharSequence getMobilePreferenceSummary(int subId) {
diff --git a/src/com/android/settings/network/apn/ApnEditPageProvider.kt b/src/com/android/settings/network/apn/ApnEditPageProvider.kt
index f2c3325..9f3947f 100644
--- a/src/com/android/settings/network/apn/ApnEditPageProvider.kt
+++ b/src/com/android/settings/network/apn/ApnEditPageProvider.kt
@@ -36,6 +36,7 @@
 import com.android.settingslib.spa.widget.editor.SettingsExposedDropdownMenuBox
 import com.android.settingslib.spa.widget.editor.SettingsExposedDropdownMenuCheckBox
 import com.android.settingslib.spa.widget.editor.SettingsOutlinedTextField
+import com.android.settingslib.spa.widget.editor.SettingsTextFieldPassword
 import com.android.settingslib.spa.widget.preference.SwitchPreference
 import com.android.settingslib.spa.widget.preference.SwitchPreferenceModel
 import com.android.settingslib.spa.widget.scaffold.RegularScaffold
@@ -123,7 +124,10 @@
                 stringResource(R.string.apn_user),
                 enabled = apnData.userNameEnabled
             ) { apnData = apnData.copy(userName = it) }
-            // TODO: password
+            SettingsTextFieldPassword(
+                apnData.passWord,
+                stringResource(R.string.apn_password)
+            ) { apnData = apnData.copy(passWord = it) }
             SettingsOutlinedTextField(
                 apnData.server,
                 stringResource(R.string.apn_server),
diff --git a/src/com/android/settings/network/apn/ApnStatus.kt b/src/com/android/settings/network/apn/ApnStatus.kt
index 06d8cfb..5d64142 100644
--- a/src/com/android/settings/network/apn/ApnStatus.kt
+++ b/src/com/android/settings/network/apn/ApnStatus.kt
@@ -71,6 +71,14 @@
     var mvnoValueEnabled = false
 }
 
+/**
+ * Initialize the selected Bearer Selected Options according to bearer.
+ * @param bearer Initialized bearer options.
+ * @param bearerBitmask Initialized bearer bitmask, often multiple bearer options may be included.
+ * @param context The context to get bearerValues.
+ *
+ * @return An error message if the apn data is invalid, otherwise return null.
+ */
 fun getBearerSelectedOptionsState(
     bearer: Int,
     bearerBitmask: Int,
diff --git a/src/com/android/settings/notification/history/NotificationSbnAdapter.java b/src/com/android/settings/notification/history/NotificationSbnAdapter.java
index 1d61ae7..c556b55 100644
--- a/src/com/android/settings/notification/history/NotificationSbnAdapter.java
+++ b/src/com/android/settings/notification/history/NotificationSbnAdapter.java
@@ -120,7 +120,7 @@
             holder.setDividerVisible(position < (mValues.size() -1));
             int userId = normalizeUserId(sbn);
             if (!mUserBadgeCache.containsKey(userId)) {
-                Drawable profile = mContext.getPackageManager().getUserBadgeForDensity(
+                Drawable profile = mContext.getPackageManager().getUserBadgeForDensityNoBackground(
                         UserHandle.of(userId), 0);
                 mUserBadgeCache.put(userId, profile);
             }
diff --git a/src/com/android/settings/search/SettingsSearchIndexablesProvider.java b/src/com/android/settings/search/SettingsSearchIndexablesProvider.java
index 3b10c09..3b04186 100644
--- a/src/com/android/settings/search/SettingsSearchIndexablesProvider.java
+++ b/src/com/android/settings/search/SettingsSearchIndexablesProvider.java
@@ -454,7 +454,7 @@
             // Skip Settings injected items because they should be indexed in the sub-pages.
             return false;
         }
-        return true;
+        return tile.isSearchable();
     }
 
     private static Object[] createIndexableRawColumnObjects(SearchIndexableRaw raw) {
diff --git a/src/com/android/settings/sim/CallsSimListDialogFragment.java b/src/com/android/settings/sim/CallsSimListDialogFragment.java
index cbee634..bc0ab08 100644
--- a/src/com/android/settings/sim/CallsSimListDialogFragment.java
+++ b/src/com/android/settings/sim/CallsSimListDialogFragment.java
@@ -26,6 +26,8 @@
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 
+import com.android.internal.telephony.flags.Flags;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -56,7 +58,8 @@
 
             SubscriptionInfo info = subscriptionManager.getActiveSubscriptionInfo(subId);
             if (info == null || (info.isEmbedded()
-                    && info.getProfileClass() == PROFILE_CLASS_PROVISIONING)) {
+                && (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
+                || (Flags.oemEnabledSatelliteFlag() && info.isNtn())))) {
                 continue;
             }
             result.add(subscriptionManager.getActiveSubscriptionInfo(subId));
diff --git a/src/com/android/settings/sim/PreferredSimDialogFragment.java b/src/com/android/settings/sim/PreferredSimDialogFragment.java
index 50eb993..c1e98f0 100644
--- a/src/com/android/settings/sim/PreferredSimDialogFragment.java
+++ b/src/com/android/settings/sim/PreferredSimDialogFragment.java
@@ -32,6 +32,7 @@
 import androidx.annotation.VisibleForTesting;
 import androidx.appcompat.app.AlertDialog;
 
+import com.android.internal.telephony.flags.Flags;
 import com.android.settings.R;
 import com.android.settings.network.SubscriptionUtil;
 
@@ -98,7 +99,8 @@
 
         final SubscriptionInfo info = getPreferredSubscription();
         if (info == null || (info.isEmbedded()
-                && info.getProfileClass() == PROFILE_CLASS_PROVISIONING)) {
+            && (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
+            || (Flags.oemEnabledSatelliteFlag() && info.isNtn())))) {
             dismiss();
             return;
         }
diff --git a/src/com/android/settings/sim/SelectSpecificDataSimDialogFragment.java b/src/com/android/settings/sim/SelectSpecificDataSimDialogFragment.java
index 6ac0067..218efc0 100644
--- a/src/com/android/settings/sim/SelectSpecificDataSimDialogFragment.java
+++ b/src/com/android/settings/sim/SelectSpecificDataSimDialogFragment.java
@@ -35,6 +35,7 @@
 import androidx.annotation.VisibleForTesting;
 import androidx.appcompat.app.AlertDialog;
 
+import com.android.internal.telephony.flags.Flags;
 import com.android.settings.R;
 import com.android.settings.network.SubscriptionUtil;
 
@@ -133,10 +134,13 @@
             return;
         }
 
-        if ((newSubInfo.isEmbedded() && newSubInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING)
-                || (currentDataSubInfo.isEmbedded()
-                && currentDataSubInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING)) {
-            Log.d(TAG, "do not set the provision eSIM");
+        if ((newSubInfo.isEmbedded()
+            && (newSubInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
+            || (Flags.oemEnabledSatelliteFlag() && newSubInfo.isNtn())))
+            || (currentDataSubInfo.isEmbedded()
+            && (currentDataSubInfo.getProfileClass() == PROFILE_CLASS_PROVISIONING
+            || (Flags.oemEnabledSatelliteFlag() && currentDataSubInfo.isNtn())))) {
+            Log.d(TAG, "do not set the provisioning or satellite eSIM");
             dismiss();
             return;
         }
diff --git a/src/com/android/settings/sim/SimListDialogFragment.java b/src/com/android/settings/sim/SimListDialogFragment.java
index 2763211..4a478e9 100644
--- a/src/com/android/settings/sim/SimListDialogFragment.java
+++ b/src/com/android/settings/sim/SimListDialogFragment.java
@@ -39,6 +39,7 @@
 import androidx.annotation.VisibleForTesting;
 import androidx.appcompat.app.AlertDialog;
 
+import com.android.internal.telephony.flags.Flags;
 import com.android.settings.R;
 import com.android.settings.network.SubscriptionUtil;
 
@@ -141,9 +142,10 @@
             return;
         }
 
-        // Remove the provision eSIM from the subscription list.
+        // Remove the provisioning or satellite eSIM from the subscription list.
         currentSubscriptions.removeIf(info -> info.isEmbedded()
-                && info.getProfileClass() == PROFILE_CLASS_PROVISIONING);
+            && (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
+            || (Flags.oemEnabledSatelliteFlag() && info.isNtn())));
 
         boolean includeAskEveryTime = getArguments().getBoolean(KEY_INCLUDE_ASK_EVERY_TIME);
         boolean isCancelItemShowed = getArguments().getBoolean(KEY_SHOW_CANCEL_ITEM);
diff --git a/src/com/android/settings/wifi/WifiDialog2.kt b/src/com/android/settings/wifi/WifiDialog2.kt
index 3e5f6fe..a0d215a 100644
--- a/src/com/android/settings/wifi/WifiDialog2.kt
+++ b/src/com/android/settings/wifi/WifiDialog2.kt
@@ -25,6 +25,7 @@
 import android.widget.Button
 import android.widget.ImageButton
 import android.widget.TextView
+import androidx.annotation.OpenForTesting
 import androidx.appcompat.app.AlertDialog
 import com.android.settings.R
 import com.android.settingslib.RestrictedLockUtils
@@ -34,7 +35,8 @@
 /**
  * Dialog for users to edit a Wi-Fi network.
  */
-class WifiDialog2 @JvmOverloads constructor(
+@OpenForTesting
+open class WifiDialog2 @JvmOverloads constructor(
     context: Context,
     private val listener: WifiDialog2Listener,
     val wifiEntry: WifiEntry?,
diff --git a/tests/robotests/Android.bp b/tests/robotests/Android.bp
index 910bbbd..fbfd888 100644
--- a/tests/robotests/Android.bp
+++ b/tests/robotests/Android.bp
@@ -61,6 +61,7 @@
         "flag-junit",
         "aconfig_settings_flags_lib",
         "platform-test-annotations",
+        "Settings-testutils2",
     ],
 
     libs: [
diff --git a/tests/robotests/assets/exempt_slice_controller_not_in_xml b/tests/robotests/assets/exempt_slice_controller_not_in_xml
index 385b702..93bd9f3 100644
--- a/tests/robotests/assets/exempt_slice_controller_not_in_xml
+++ b/tests/robotests/assets/exempt_slice_controller_not_in_xml
@@ -3,9 +3,11 @@
 com.android.settings.biometrics.face.FaceSettingsAttentionPreferenceController
 com.android.settings.display.DeviceStateAutoRotateSettingController
 com.android.settings.display.SmartAutoRotatePreferenceController
+com.android.settings.gestures.OneHandedMainSwitchPreferenceController
 com.android.settings.network.telephony.MmsMessagePreferenceController
 com.android.settings.network.telephony.AutoDataSwitchPreferenceController
 com.android.settings.network.telephony.Enhanced4gBasePreferenceController
+com.android.settings.notification.RingVolumePreferenceController
 com.android.settings.testutils.FakeToggleController
 com.android.settings.testutils.FakeSliderController
 com.android.settings.testutils.FakeInvalidSliderController
diff --git a/tests/robotests/src/com/android/settings/biometrics/combination/CombinedBiometricProfileSettingsTest.java b/tests/robotests/src/com/android/settings/biometrics/combination/CombinedBiometricProfileSettingsTest.java
index 4781f56..43d2add 100644
--- a/tests/robotests/src/com/android/settings/biometrics/combination/CombinedBiometricProfileSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/biometrics/combination/CombinedBiometricProfileSettingsTest.java
@@ -72,6 +72,7 @@
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -407,6 +408,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void testClickFaceUnlock_inMultiWindow_withoutEnrolledFp_showsDialog() {
         testClickFaceUnlock(true /* isInMultiWindow */, false /*hasEnrolledFace*/);
         verifyShowsDialogAfterClickingUnlock(mFragment.getFacePreferenceKey());
diff --git a/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollEducationTest.java b/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollEducationTest.java
index b4dddde..474ea8c 100644
--- a/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollEducationTest.java
+++ b/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollEducationTest.java
@@ -50,6 +50,7 @@
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -127,6 +128,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void testFaceEnrollEducation_hasHeader() {
         setupActivity();
         CharSequence headerText = getGlifLayout().getHeaderText();
diff --git a/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollIntroductionTest.java b/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollIntroductionTest.java
index 3165d05..459e377 100644
--- a/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollIntroductionTest.java
+++ b/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollIntroductionTest.java
@@ -76,6 +76,7 @@
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
@@ -282,6 +283,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void testOnCreateToGenerateChallenge() {
         setupActivityWithGenerateChallenge(
                 new Intent().putExtra(ChooseLockSettingsHelper.EXTRA_KEY_GK_PW_HANDLE, 1L));
@@ -432,6 +434,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void testFaceEnrollIntroduction_onStartRegisteredPostureChangeCallback() {
         setupActivityForPosture();
         mSpyActivity.onStart();
diff --git a/tests/robotests/src/com/android/settings/biometrics/face/FaceSettingsRemoveButtonPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/biometrics/face/FaceSettingsRemoveButtonPreferenceControllerTest.java
index 5f56fa7..ae35972 100644
--- a/tests/robotests/src/com/android/settings/biometrics/face/FaceSettingsRemoveButtonPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/biometrics/face/FaceSettingsRemoveButtonPreferenceControllerTest.java
@@ -32,6 +32,7 @@
 import com.android.settingslib.widget.LayoutPreference;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -44,6 +45,7 @@
 import org.robolectric.annotation.Config;
 import org.robolectric.shadows.ShadowApplication;
 
+@Ignore("b/295325503")
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = {ShadowUserManager.class})
 public class FaceSettingsRemoveButtonPreferenceControllerTest {
diff --git a/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrollingTest.java b/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrollingTest.java
index fa0cd2b..4de369e 100644
--- a/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrollingTest.java
+++ b/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrollingTest.java
@@ -70,6 +70,7 @@
 import com.google.android.setupdesign.GlifLayout;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
@@ -85,6 +86,7 @@
 import java.util.List;
 import java.util.concurrent.atomic.AtomicReference;
 
+@Ignore("b/295325503")
 @RunWith(RobolectricTestRunner.class)
 @LooperMode(LooperMode.Mode.LEGACY)
 public class FingerprintEnrollEnrollingTest {
diff --git a/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensorTest.java b/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensorTest.java
index 8727153..72f1ab8 100644
--- a/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensorTest.java
+++ b/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensorTest.java
@@ -65,6 +65,7 @@
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
@@ -556,6 +557,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void fingerprintEnrollFindSensor_activityApplyDarkLightStyle() {
         setupActivity_onSfpsDevice();
         verifySidecar_onRearOrSfpsDevice();
diff --git a/tests/robotests/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFinishTest.java b/tests/robotests/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFinishTest.java
index e238a0e..fa33f9c 100644
--- a/tests/robotests/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFinishTest.java
+++ b/tests/robotests/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFinishTest.java
@@ -35,6 +35,7 @@
 import com.google.android.setupcompat.template.FooterBarMixin;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.Robolectric;
@@ -115,6 +116,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void onActivityResult_fingerprintCountIsOne_fingerprintSuggestionActivityEnabled() {
         Shadows.shadowOf((FingerprintManager) mFingerprintManager).setDefaultFingerprints(1);
 
@@ -135,6 +137,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void clickNext_fingerprintCountIsOne_fngerprintSuggestionActivityEnabled() {
         Shadows.shadowOf((FingerprintManager) mFingerprintManager).setDefaultFingerprints(1);
 
@@ -155,6 +158,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void onBackPressed_fingerprintCountIsOne_fngerprintSuggestionActivityEnabled() {
         Shadows.shadowOf((FingerprintManager) mFingerprintManager).setDefaultFingerprints(1);
 
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentTest.java
index 5f0f2b9..d381975 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentTest.java
@@ -52,7 +52,9 @@
 public class ConnectedDeviceDashboardFragmentTest {
     private static final String KEY_NEARBY_DEVICES = "bt_nearby_slice";
     private static final String KEY_DISCOVERABLE_FOOTER = "discoverable_footer";
-    private static final String KEY_SEE_ALL = "previously_connected_devices_see_all";
+    private static final String KEY_SAVED_DEVICE_SEE_ALL = "previously_connected_devices_see_all";
+    private static final String KEY_FAST_PAIR_DEVICE_SEE_ALL = "fast_pair_devices_see_all";
+    private static final String KEY_FAST_PAIR_DEVICE_LIST = "fast_pair_devices";
     private static final String KEY_ADD_BT_DEVICES = "add_bt_devices";
     private static final String SETTINGS_PACKAGE_NAME = "com.android.settings";
     private static final String SYSTEMUI_PACKAGE_NAME = "com.android.systemui";
@@ -92,7 +94,8 @@
                 .getNonIndexableKeys(mContext);
 
         assertThat(niks).containsExactly(KEY_CONNECTED_DEVICES, KEY_AVAILABLE_DEVICES,
-                KEY_NEARBY_DEVICES, KEY_DISCOVERABLE_FOOTER, KEY_SEE_ALL);
+                KEY_NEARBY_DEVICES, KEY_DISCOVERABLE_FOOTER, KEY_SAVED_DEVICE_SEE_ALL,
+                KEY_FAST_PAIR_DEVICE_SEE_ALL, KEY_FAST_PAIR_DEVICE_LIST);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java
index dc173e5..838edc6 100644
--- a/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java
@@ -23,6 +23,7 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import android.content.Context;
 import android.os.Bundle;
 
 import androidx.fragment.app.FragmentActivity;
@@ -38,6 +39,7 @@
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
 import org.robolectric.util.ReflectionHelpers;
 
@@ -53,7 +55,7 @@
     private PreferenceManager mPreferenceManager;
     @Mock
     private FragmentActivity mActivity;
-
+    private Context mContext;
     private InstrumentedPreferenceFragmentTestable mFragment;
 
     @Before
@@ -61,7 +63,9 @@
         MockitoAnnotations.initMocks(this);
         when(mPreferenceManager.getPreferenceScreen()).thenReturn(mScreen);
 
+        mContext = RuntimeEnvironment.application;
         mFragment = spy(new InstrumentedPreferenceFragmentTestable());
+        when(mFragment.getContext()).thenReturn(mContext);
         ReflectionHelpers.setField(mFragment, "mPreferenceManager", mPreferenceManager);
     }
 
diff --git a/tests/robotests/src/com/android/settings/datausage/ChartDataUsagePreferenceTest.java b/tests/robotests/src/com/android/settings/datausage/ChartDataUsagePreferenceTest.java
index aab67be..9c93606 100644
--- a/tests/robotests/src/com/android/settings/datausage/ChartDataUsagePreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/ChartDataUsagePreferenceTest.java
@@ -31,9 +31,9 @@
 
 import com.android.settings.R;
 import com.android.settings.datausage.ChartDataUsagePreference.DataUsageSummaryNode;
+import com.android.settings.datausage.lib.NetworkCycleChartData;
+import com.android.settings.datausage.lib.NetworkUsageData;
 import com.android.settings.widget.UsageView;
-import com.android.settingslib.net.NetworkCycleChartData;
-import com.android.settingslib.net.NetworkCycleData;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -55,7 +55,7 @@
     // Test bucket end date, 22 Mar 2018 00:00:00
     private static final long TIMESTAMP_END = 1521676800000L;
 
-    private List<NetworkCycleData> mNetworkCycleData;
+    private List<NetworkUsageData> mNetworkCycleData;
     private NetworkCycleChartData mNetworkCycleChartData;
     private ChartDataUsagePreference mPreference;
     private Activity mActivity;
@@ -79,6 +79,9 @@
         final ArgumentCaptor<SparseIntArray> pointsCaptor =
                 ArgumentCaptor.forClass(SparseIntArray.class);
         createTestNetworkData();
+        mPreference.setTime(
+                mNetworkCycleChartData.getTotal().getStartTime(),
+                mNetworkCycleChartData.getTotal().getEndTime());
         mPreference.setNetworkCycleData(mNetworkCycleChartData);
 
         mPreference.calcPoints(usageView, mNetworkCycleData.subList(0, 5));
@@ -95,6 +98,9 @@
         final ArgumentCaptor<SparseIntArray> pointsCaptor =
                 ArgumentCaptor.forClass(SparseIntArray.class);
         createTestNetworkData();
+        mPreference.setTime(
+                mNetworkCycleChartData.getTotal().getStartTime(),
+                mNetworkCycleChartData.getTotal().getEndTime());
         mPreference.setNetworkCycleData(mNetworkCycleChartData);
 
         mPreference.calcPoints(usageView, mNetworkCycleData.subList(2, 7));
@@ -110,39 +116,62 @@
     public void calcPoints_shouldNotDrawPointForFutureDate() {
         final UsageView usageView = mock(UsageView.class);
         final ArgumentCaptor<SparseIntArray> pointsCaptor =
-            ArgumentCaptor.forClass(SparseIntArray.class);
+                ArgumentCaptor.forClass(SparseIntArray.class);
         final long tonight = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(12);
         mNetworkCycleData = new ArrayList<>();
         // add test usage data for last 5 days
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight - TimeUnit.DAYS.toMillis(5), tonight - TimeUnit.DAYS.toMillis(4), 743823454L));
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight - TimeUnit.DAYS.toMillis(4), tonight - TimeUnit.DAYS.toMillis(3), 64396L));
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight - TimeUnit.DAYS.toMillis(3), tonight - TimeUnit.DAYS.toMillis(2), 2832L));
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight - TimeUnit.DAYS.toMillis(2), tonight - TimeUnit.DAYS.toMillis(1), 83849690L));
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight - TimeUnit.DAYS.toMillis(1), tonight, 1883657L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight - TimeUnit.DAYS.toMillis(5),
+                tonight - TimeUnit.DAYS.toMillis(4),
+                743823454L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight - TimeUnit.DAYS.toMillis(4),
+                tonight - TimeUnit.DAYS.toMillis(3),
+                64396L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight - TimeUnit.DAYS.toMillis(3),
+                tonight - TimeUnit.DAYS.toMillis(2),
+                2832L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight - TimeUnit.DAYS.toMillis(2),
+                tonight - TimeUnit.DAYS.toMillis(1),
+                83849690L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight - TimeUnit.DAYS.toMillis(1), tonight, 1883657L));
         // add test usage data for next 5 days
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight, tonight + TimeUnit.DAYS.toMillis(1), 0L));
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight + TimeUnit.DAYS.toMillis(1), tonight + TimeUnit.DAYS.toMillis(2), 0L));
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight + TimeUnit.DAYS.toMillis(2), tonight + TimeUnit.DAYS.toMillis(3), 0L));
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight + TimeUnit.DAYS.toMillis(3), tonight + TimeUnit.DAYS.toMillis(4), 0L));
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight + TimeUnit.DAYS.toMillis(4), tonight + TimeUnit.DAYS.toMillis(5), 0L));
-        mNetworkCycleData.add(createNetworkCycleData(
-            tonight + TimeUnit.DAYS.toMillis(5), tonight + TimeUnit.DAYS.toMillis(6), 0L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight, tonight + TimeUnit.DAYS.toMillis(1), 0L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight + TimeUnit.DAYS.toMillis(1),
+                tonight + TimeUnit.DAYS.toMillis(2),
+                0L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight + TimeUnit.DAYS.toMillis(2),
+                tonight + TimeUnit.DAYS.toMillis(3),
+                0L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight + TimeUnit.DAYS.toMillis(3),
+                tonight + TimeUnit.DAYS.toMillis(4),
+                0L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight + TimeUnit.DAYS.toMillis(4),
+                tonight + TimeUnit.DAYS.toMillis(5),
+                0L));
+        mNetworkCycleData.add(new NetworkUsageData(
+                tonight + TimeUnit.DAYS.toMillis(5),
+                tonight + TimeUnit.DAYS.toMillis(6),
+                0L));
 
-        final NetworkCycleChartData.Builder builder = new NetworkCycleChartData.Builder();
-        builder.setUsageBuckets(mNetworkCycleData)
-            .setStartTime(tonight - TimeUnit.DAYS.toMillis(5))
-            .setEndTime(tonight + TimeUnit.DAYS.toMillis(6));
-        mNetworkCycleChartData = builder.build();
+        mNetworkCycleChartData = new NetworkCycleChartData(
+                new NetworkUsageData(
+                        tonight - TimeUnit.DAYS.toMillis(5),
+                        tonight + TimeUnit.DAYS.toMillis(6),
+                        0),
+                mNetworkCycleData
+        );
+        mPreference.setTime(
+                mNetworkCycleChartData.getTotal().getStartTime(),
+                mNetworkCycleChartData.getTotal().getEndTime());
         mPreference.setNetworkCycleData(mNetworkCycleChartData);
 
         mPreference.calcPoints(usageView, mNetworkCycleData);
@@ -170,6 +199,9 @@
         final TextView labelStart = (TextView) mHolder.findViewById(R.id.label_start);
         final TextView labelEnd = (TextView) mHolder.findViewById(R.id.label_end);
         createTestNetworkData();
+        mPreference.setTime(
+                mNetworkCycleChartData.getTotal().getStartTime(),
+                mNetworkCycleChartData.getTotal().getEndTime());
         mPreference.setNetworkCycleData(mNetworkCycleChartData);
 
         mPreference.onBindViewHolder(mHolder);
@@ -198,38 +230,33 @@
     private void createTestNetworkData() {
         mNetworkCycleData = new ArrayList<>();
         // create 10 arbitrary network data
-        mNetworkCycleData.add(createNetworkCycleData(1521583200000L, 1521586800000L, 743823454L));
-        mNetworkCycleData.add(createNetworkCycleData(1521586800000L, 1521590400000L, 64396L));
-        mNetworkCycleData.add(createNetworkCycleData(1521590400000L, 1521655200000L, 2832L));
-        mNetworkCycleData.add(createNetworkCycleData(1521655200000L, 1521658800000L, 83849690L));
-        mNetworkCycleData.add(createNetworkCycleData(1521658800000L, 1521662400000L, 1883657L));
-        mNetworkCycleData.add(createNetworkCycleData(1521662400000L, 1521666000000L, 705259L));
-        mNetworkCycleData.add(createNetworkCycleData(1521666000000L, 1521669600000L, 216169L));
-        mNetworkCycleData.add(createNetworkCycleData(1521669600000L, 1521673200000L, 6069175L));
-        mNetworkCycleData.add(createNetworkCycleData(1521673200000L, 1521676800000L, 120389L));
-        mNetworkCycleData.add(createNetworkCycleData(1521676800000L, 1521678800000L, 29947L));
+        mNetworkCycleData.add(new NetworkUsageData(1521583200000L, 1521586800000L, 743823454L));
+        mNetworkCycleData.add(new NetworkUsageData(1521586800000L, 1521590400000L, 64396L));
+        mNetworkCycleData.add(new NetworkUsageData(1521590400000L, 1521655200000L, 2832L));
+        mNetworkCycleData.add(new NetworkUsageData(1521655200000L, 1521658800000L, 83849690L));
+        mNetworkCycleData.add(new NetworkUsageData(1521658800000L, 1521662400000L, 1883657L));
+        mNetworkCycleData.add(new NetworkUsageData(1521662400000L, 1521666000000L, 705259L));
+        mNetworkCycleData.add(new NetworkUsageData(1521666000000L, 1521669600000L, 216169L));
+        mNetworkCycleData.add(new NetworkUsageData(1521669600000L, 1521673200000L, 6069175L));
+        mNetworkCycleData.add(new NetworkUsageData(1521673200000L, 1521676800000L, 120389L));
+        mNetworkCycleData.add(new NetworkUsageData(1521676800000L, 1521678800000L, 29947L));
 
-        final NetworkCycleChartData.Builder builder = new NetworkCycleChartData.Builder();
-        builder.setUsageBuckets(mNetworkCycleData)
-            .setStartTime(TIMESTAMP_START)
-            .setEndTime(TIMESTAMP_END);
-        mNetworkCycleChartData = builder.build();
+        mNetworkCycleChartData = new NetworkCycleChartData(
+                new NetworkUsageData(TIMESTAMP_START, TIMESTAMP_END, 0),
+                mNetworkCycleData
+        );
     }
 
     private void createSomeSamePercentageNetworkData() {
         mNetworkCycleData = new ArrayList<>();
-        mNetworkCycleData.add(createNetworkCycleData(1521583200000L, 1521586800000L, 100));//33%
-        mNetworkCycleData.add(createNetworkCycleData(1521586800000L, 1521590400000L, 1));  //33%
-        mNetworkCycleData.add(createNetworkCycleData(1521590400000L, 1521655200000L, 0));  //33%
-        mNetworkCycleData.add(createNetworkCycleData(1521655200000L, 1521658800000L, 0));  //33%
-        mNetworkCycleData.add(createNetworkCycleData(1521658800000L, 1521662400000L, 200));//99%
-        mNetworkCycleData.add(createNetworkCycleData(1521662400000L, 1521666000000L, 1));  //99%
-        mNetworkCycleData.add(createNetworkCycleData(1521666000000L, 1521669600000L, 1));  //100
-        mNetworkCycleData.add(createNetworkCycleData(1521669600000L, 1521673200000L, 0));  //100%
+        mNetworkCycleData.add(new NetworkUsageData(1521583200000L, 1521586800000L, 100)); //33%
+        mNetworkCycleData.add(new NetworkUsageData(1521586800000L, 1521590400000L, 1));   //33%
+        mNetworkCycleData.add(new NetworkUsageData(1521590400000L, 1521655200000L, 0));   //33%
+        mNetworkCycleData.add(new NetworkUsageData(1521655200000L, 1521658800000L, 0));   //33%
+        mNetworkCycleData.add(new NetworkUsageData(1521658800000L, 1521662400000L, 200)); //99%
+        mNetworkCycleData.add(new NetworkUsageData(1521662400000L, 1521666000000L, 1));   //99%
+        mNetworkCycleData.add(new NetworkUsageData(1521666000000L, 1521669600000L, 1));   //100
+        mNetworkCycleData.add(new NetworkUsageData(1521669600000L, 1521673200000L, 0));   //100%
     }
 
-    private NetworkCycleData createNetworkCycleData(long start, long end, long usage) {
-        return new NetworkCycleData.Builder()
-            .setStartTime(start).setEndTime(end).setTotalUsage(usage).build();
-    }
 }
diff --git a/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java b/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java
deleted file mode 100644
index 1268032..0000000
--- a/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * 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.datausage;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.net.NetworkTemplate;
-import android.os.Bundle;
-import android.os.UserManager;
-import android.provider.Settings;
-
-import androidx.annotation.NonNull;
-import androidx.loader.app.LoaderManager;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceManager;
-
-import com.android.settings.datausage.lib.BillingCycleRepository;
-import com.android.settings.network.MobileDataEnabledListener;
-import com.android.settings.testutils.FakeFeatureFactory;
-import com.android.settings.widget.LoadingViewController;
-import com.android.settingslib.NetworkPolicyEditor;
-import com.android.settingslib.core.AbstractPreferenceController;
-import com.android.settingslib.core.instrumentation.VisibilityLoggerMixin;
-import com.android.settingslib.net.NetworkCycleChartData;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Spy;
-import org.mockito.junit.MockitoJUnit;
-import org.mockito.junit.MockitoRule;
-import org.robolectric.Robolectric;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.android.controller.ActivityController;
-import org.robolectric.annotation.Config;
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-import org.robolectric.util.ReflectionHelpers;
-
-import java.util.Collections;
-import java.util.List;
-
-@RunWith(RobolectricTestRunner.class)
-@Config(shadows = DataUsageListTest.ShadowDataUsageBaseFragment.class)
-public class DataUsageListTest {
-    @Rule
-    public MockitoRule mMockitoRule = MockitoJUnit.rule();
-
-    @Mock
-    private MobileDataEnabledListener mMobileDataEnabledListener;
-    @Mock
-    private TemplatePreference.NetworkServices mNetworkServices;
-    @Mock
-    private LoaderManager mLoaderManager;
-    @Mock
-    private UserManager mUserManager;
-    @Mock
-    private BillingCycleRepository mBillingCycleRepository;
-    @Mock
-    private DataUsageListHeaderController mDataUsageListHeaderController;
-
-    private Activity mActivity;
-
-    @Spy
-    private TestDataUsageList mDataUsageList;
-
-    @Before
-    public void setUp() {
-        FakeFeatureFactory.setupForTest();
-        final ActivityController<Activity> mActivityController =
-                Robolectric.buildActivity(Activity.class);
-        mActivity = spy(mActivityController.get());
-        mNetworkServices.mPolicyEditor = mock(NetworkPolicyEditor.class);
-        mDataUsageList.mDataStateListener = mMobileDataEnabledListener;
-
-        doReturn(mActivity).when(mDataUsageList).getContext();
-        doReturn(mUserManager).when(mActivity).getSystemService(UserManager.class);
-        doReturn(false).when(mUserManager).isGuestUser();
-        ReflectionHelpers.setField(mDataUsageList, "mDataStateListener",
-                mMobileDataEnabledListener);
-        ReflectionHelpers.setField(mDataUsageList, "services", mNetworkServices);
-        doReturn(mLoaderManager).when(mDataUsageList).getLoaderManager();
-        mDataUsageList.mLoadingViewController = mock(LoadingViewController.class);
-        doNothing().when(mDataUsageList).updateSubscriptionInfoEntity();
-        when(mBillingCycleRepository.isBandwidthControlEnabled()).thenReturn(true);
-        mDataUsageList.mDataUsageListHeaderController = mDataUsageListHeaderController;
-    }
-
-    @Test
-    public void onCreate_isNotGuestUser_shouldNotFinish() {
-        mDataUsageList.mTemplate = mock(NetworkTemplate.class);
-        doReturn(false).when(mUserManager).isGuestUser();
-        doNothing().when(mDataUsageList).processArgument();
-
-        mDataUsageList.onCreate(null);
-
-        verify(mDataUsageList, never()).finish();
-    }
-
-    @Test
-    public void onCreate_isGuestUser_shouldFinish() {
-        doReturn(true).when(mUserManager).isGuestUser();
-
-        mDataUsageList.onCreate(null);
-
-        verify(mDataUsageList).finish();
-    }
-
-    @Test
-    public void resume_shouldListenDataStateChange() {
-        mDataUsageList.onCreate(null);
-        ReflectionHelpers.setField(
-                mDataUsageList, "mVisibilityLoggerMixin", mock(VisibilityLoggerMixin.class));
-        ReflectionHelpers.setField(
-                mDataUsageList, "mPreferenceManager", mock(PreferenceManager.class));
-
-        mDataUsageList.onResume();
-
-        verify(mMobileDataEnabledListener).start(anyInt());
-
-        mDataUsageList.onPause();
-    }
-
-    @Test
-    public void pause_shouldUnlistenDataStateChange() {
-        mDataUsageList.onCreate(null);
-        ReflectionHelpers.setField(
-                mDataUsageList, "mVisibilityLoggerMixin", mock(VisibilityLoggerMixin.class));
-        ReflectionHelpers.setField(
-                mDataUsageList, "mPreferenceManager", mock(PreferenceManager.class));
-
-        mDataUsageList.onResume();
-        mDataUsageList.onPause();
-
-        verify(mMobileDataEnabledListener).stop();
-    }
-
-    @Test
-    public void processArgument_shouldGetTemplateFromArgument() {
-        final Bundle args = new Bundle();
-        args.putParcelable(DataUsageList.EXTRA_NETWORK_TEMPLATE, mock(NetworkTemplate.class));
-        args.putInt(DataUsageList.EXTRA_SUB_ID, 3);
-        mDataUsageList.setArguments(args);
-
-        mDataUsageList.processArgument();
-
-        assertThat(mDataUsageList.mTemplate).isNotNull();
-        assertThat(mDataUsageList.mSubId).isEqualTo(3);
-    }
-
-    @Test
-    public void processArgument_fromIntent_shouldGetTemplateFromIntent() {
-        final Intent intent = new Intent();
-        intent.putExtra(Settings.EXTRA_NETWORK_TEMPLATE, mock(NetworkTemplate.class));
-        intent.putExtra(Settings.EXTRA_SUB_ID, 3);
-        doReturn(intent).when(mDataUsageList).getIntent();
-
-        mDataUsageList.processArgument();
-
-        assertThat(mDataUsageList.mTemplate).isNotNull();
-        assertThat(mDataUsageList.mSubId).isEqualTo(3);
-    }
-
-    @Test
-    public void onLoadFinished_networkCycleDataCallback_shouldShowCycleSpinner() {
-        mDataUsageList.mTemplate = mock(NetworkTemplate.class);
-        mDataUsageList.onCreate(null);
-        mDataUsageList.updatePolicy();
-        List<NetworkCycleChartData> mockData = Collections.emptyList();
-
-        mDataUsageList.mNetworkCycleDataCallbacks.onLoadFinished(null, mockData);
-
-        verify(mDataUsageListHeaderController).updateCycleData(mockData);
-        verify(mDataUsageListHeaderController).setConfigButtonVisible(true);
-    }
-
-    @Test
-    public void onPause_shouldDestroyLoaders() {
-        mDataUsageList.onPause();
-
-        verify(mLoaderManager).destroyLoader(DataUsageList.LOADER_CHART_DATA);
-    }
-
-    @Implements(DataUsageBaseFragment.class)
-    public static class ShadowDataUsageBaseFragment {
-        @Implementation
-        public void onCreate(Bundle icicle) {
-            // do nothing
-        }
-    }
-
-    public class TestDataUsageList extends DataUsageList {
-        @Override
-        protected <T extends AbstractPreferenceController> T use(Class<T> clazz) {
-            return mock(clazz);
-        }
-
-        @Override
-        public <T extends Preference> T findPreference(CharSequence key) {
-            if (key.toString().equals("chart_data")) {
-                return (T) mock(ChartDataUsagePreference.class);
-            }
-            return (T) mock(Preference.class);
-        }
-
-        @Override
-        public Intent getIntent() {
-            return new Intent();
-        }
-
-        @NonNull
-        @Override
-        BillingCycleRepository createBillingCycleRepository() {
-            return mBillingCycleRepository;
-        }
-
-        @Override
-        boolean isBillingCycleModifiable() {
-            return true;
-        }
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.kt b/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.kt
new file mode 100644
index 0000000..90bb048
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/datausage/DataUsageListTest.kt
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2023 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.datausage
+
+import android.content.Context
+import android.content.Intent
+import android.net.NetworkTemplate
+import android.os.Bundle
+import android.os.UserManager
+import android.provider.Settings
+import androidx.preference.Preference
+import androidx.preference.PreferenceManager
+import androidx.test.core.app.ApplicationProvider
+import com.android.settings.datausage.DataUsageListTest.ShadowDataUsageBaseFragment
+import com.android.settings.datausage.TemplatePreference.NetworkServices
+import com.android.settings.datausage.lib.BillingCycleRepository
+import com.android.settings.network.MobileDataEnabledListener
+import com.android.settings.testutils.FakeFeatureFactory
+import com.android.settingslib.NetworkPolicyEditor
+import com.android.settingslib.core.AbstractPreferenceController
+import com.android.settingslib.core.instrumentation.VisibilityLoggerMixin
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentMatchers
+import org.mockito.Mock
+import org.mockito.Mockito.doNothing
+import org.mockito.Mockito.doReturn
+import org.mockito.Mockito.mock
+import org.mockito.Mockito.never
+import org.mockito.Mockito.verify
+import org.mockito.Mockito.`when`
+import org.mockito.Spy
+import org.mockito.junit.MockitoJUnit
+import org.mockito.junit.MockitoRule
+import org.robolectric.RobolectricTestRunner
+import org.robolectric.annotation.Config
+import org.robolectric.annotation.Implementation
+import org.robolectric.annotation.Implements
+import org.robolectric.util.ReflectionHelpers
+
+@RunWith(RobolectricTestRunner::class)
+@Config(shadows = [ShadowDataUsageBaseFragment::class])
+class DataUsageListTest {
+    @get:Rule
+    val mockito: MockitoRule = MockitoJUnit.rule()
+
+    @Mock
+    private lateinit var mobileDataEnabledListener: MobileDataEnabledListener
+
+    @Mock
+    private lateinit var networkServices: NetworkServices
+
+    @Mock
+    private lateinit var userManager: UserManager
+
+    @Mock
+    private lateinit var billingCycleRepository: BillingCycleRepository
+
+    @Mock
+    private lateinit var dataUsageListHeaderController: DataUsageListHeaderController
+
+    @Spy
+    private val context: Context = ApplicationProvider.getApplicationContext()
+
+    @Spy
+    private val dataUsageList = TestDataUsageList()
+
+    @Before
+    fun setUp() {
+        FakeFeatureFactory.setupForTest()
+        networkServices.mPolicyEditor = mock(NetworkPolicyEditor::class.java)
+        dataUsageList.dataStateListener = mobileDataEnabledListener
+        doReturn(context).`when`(dataUsageList).context
+        doReturn(userManager).`when`(context).getSystemService(UserManager::class.java)
+        doReturn(false).`when`(userManager).isGuestUser
+        ReflectionHelpers.setField(dataUsageList, "services", networkServices)
+        doNothing().`when`(dataUsageList).updateSubscriptionInfoEntity()
+        `when`(billingCycleRepository.isBandwidthControlEnabled()).thenReturn(true)
+        dataUsageList.dataUsageListHeaderController = dataUsageListHeaderController
+    }
+
+    @Test
+    fun onCreate_isNotGuestUser_shouldNotFinish() {
+        dataUsageList.template = mock<NetworkTemplate>(NetworkTemplate::class.java)
+        doReturn(false).`when`(userManager).isGuestUser
+        doNothing().`when`(dataUsageList).processArgument()
+        dataUsageList.onCreate(null)
+        verify(dataUsageList, never()).finish()
+    }
+
+    @Test
+    fun onCreate_isGuestUser_shouldFinish() {
+        doReturn(true).`when`(userManager).isGuestUser
+        dataUsageList.onCreate(null)
+        verify(dataUsageList).finish()
+    }
+
+    @Test
+    fun resume_shouldListenDataStateChange() {
+        dataUsageList.template = mock(NetworkTemplate::class.java)
+        dataUsageList.onCreate(null)
+        dataUsageList.dataStateListener = mobileDataEnabledListener
+        ReflectionHelpers.setField(
+            dataUsageList,
+            "mVisibilityLoggerMixin",
+            mock(VisibilityLoggerMixin::class.java),
+        )
+        ReflectionHelpers.setField(
+            dataUsageList,
+            "mPreferenceManager",
+            mock(PreferenceManager::class.java),
+        )
+        dataUsageList.onResume()
+        verify(mobileDataEnabledListener).start(ArgumentMatchers.anyInt())
+        dataUsageList.onPause()
+    }
+
+    @Test
+    fun pause_shouldUnlistenDataStateChange() {
+        dataUsageList.template = mock(NetworkTemplate::class.java)
+        dataUsageList.onCreate(null)
+        dataUsageList.dataStateListener = mobileDataEnabledListener
+        ReflectionHelpers.setField(
+            dataUsageList, "mVisibilityLoggerMixin", mock(
+                VisibilityLoggerMixin::class.java
+            )
+        )
+        ReflectionHelpers.setField(
+            dataUsageList, "mPreferenceManager", mock(
+                PreferenceManager::class.java
+            )
+        )
+        dataUsageList.onResume()
+        dataUsageList.onPause()
+        verify(mobileDataEnabledListener).stop()
+    }
+
+    @Test
+    fun processArgument_shouldGetTemplateFromArgument() {
+        val args = Bundle()
+        args.putParcelable(
+            DataUsageList.EXTRA_NETWORK_TEMPLATE, mock(
+                NetworkTemplate::class.java
+            )
+        )
+        args.putInt(DataUsageList.EXTRA_SUB_ID, 3)
+        dataUsageList.arguments = args
+        dataUsageList.processArgument()
+        assertThat(dataUsageList.template).isNotNull()
+        assertThat(dataUsageList.subId).isEqualTo(3)
+    }
+
+    @Test
+    fun processArgument_fromIntent_shouldGetTemplateFromIntent() {
+        val intent = Intent()
+        intent.putExtra(
+            Settings.EXTRA_NETWORK_TEMPLATE, mock(
+                NetworkTemplate::class.java
+            )
+        )
+        intent.putExtra(Settings.EXTRA_SUB_ID, 3)
+        doReturn(intent).`when`(dataUsageList).intent
+        dataUsageList.processArgument()
+        assertThat(dataUsageList.template).isNotNull()
+        assertThat(dataUsageList.subId).isEqualTo(3)
+    }
+
+    @Test
+    fun updatePolicy_setConfigButtonVisible() {
+        dataUsageList.template = mock(NetworkTemplate::class.java)
+        dataUsageList.onCreate(null)
+
+        dataUsageList.updatePolicy()
+
+        verify(dataUsageListHeaderController).setConfigButtonVisible(true)
+    }
+
+    @Implements(DataUsageBaseFragment::class)
+    class ShadowDataUsageBaseFragment {
+        @Implementation
+        fun onCreate(@Suppress("UNUSED_PARAMETER") icicle: Bundle?) {
+            // do nothing
+        }
+    }
+
+    open inner class TestDataUsageList : DataUsageList() {
+        override fun <T : AbstractPreferenceController?> use(clazz: Class<T>): T = mock(clazz)
+
+        @Suppress("UNCHECKED_CAST")
+        override fun <T : Preference?> findPreference(key: CharSequence): T =
+            mock(Preference::class.java) as T
+
+        public override fun getIntent() = Intent()
+
+        override fun createBillingCycleRepository() = billingCycleRepository
+
+        override fun isBillingCycleModifiable() = true
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/datetime/TimePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datetime/TimePreferenceControllerTest.java
index 3481f80..ebb56f4 100644
--- a/tests/robotests/src/com/android/settings/datetime/TimePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datetime/TimePreferenceControllerTest.java
@@ -36,7 +36,6 @@
 @RunWith(RobolectricTestRunner.class)
 public class TimePreferenceControllerTest {
 
-    @Mock
     private Context mContext;
     @Mock
     private TimePreferenceController.TimePreferenceHost mHost;
@@ -49,6 +48,7 @@
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
+        mContext = RuntimeEnvironment.application;
         mPreference = new RestrictedPreference(RuntimeEnvironment.application);
         mController = new TimePreferenceController(mContext, mHost, mDatePreferenceController);
     }
diff --git a/tests/robotests/src/com/android/settings/development/RebootWithMtePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/RebootWithMtePreferenceControllerTest.java
index f1e7d3f..eec7a7b 100644
--- a/tests/robotests/src/com/android/settings/development/RebootWithMtePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/RebootWithMtePreferenceControllerTest.java
@@ -26,6 +26,8 @@
 import androidx.preference.Preference;
 import androidx.test.core.app.ApplicationProvider;
 
+import com.android.settingslib.development.DevelopmentSettingsEnabler;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -52,6 +54,7 @@
         mContext = ApplicationProvider.getApplicationContext();
         mController = new RebootWithMtePreferenceController(mContext);
         mController.setFragment(mFragment);
+        DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(mContext, true);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerTest.java b/tests/robotests/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerTest.java
index a338de3..686df7a 100644
--- a/tests/robotests/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerTest.java
@@ -17,6 +17,7 @@
 package com.android.settings.development.graphicsdriver;
 
 import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.ANGLE_DRIVER_SUFFIX;
+import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_DEBUG_ANGLE_DEVELOPER_OPTION;
 import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_PERSISTENT_GRAPHICS_EGL;
 import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_RO_GFX_ANGLE_SUPPORTED;
 
@@ -71,6 +72,7 @@
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         mContext = RuntimeEnvironment.application;
+        ShadowSystemProperties.override(PROPERTY_DEBUG_ANGLE_DEVELOPER_OPTION, "true");
         doReturn(mTransaction).when(mFragmentManager).beginTransaction();
         doReturn(mFragmentManager).when(mActivity).getSupportFragmentManager();
         doReturn(mActivity).when(mFragment).getActivity();
diff --git a/tests/robotests/src/com/android/settings/display/AutoRotatePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/AutoRotatePreferenceControllerTest.java
index 2bcf060..fd91867 100644
--- a/tests/robotests/src/com/android/settings/display/AutoRotatePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/AutoRotatePreferenceControllerTest.java
@@ -190,15 +190,17 @@
     private void enableAutoRotationPreference() {
         when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
         when(mContext.getResources().getBoolean(anyInt())).thenReturn(true);
-        Settings.System.putInt(mContentResolver,
-                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0);
+        Settings.System.putIntForUser(mContentResolver,
+                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0,
+                UserHandle.USER_CURRENT);
     }
 
     private void disableAutoRotationPreference() {
         when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
         when(mContext.getResources().getBoolean(anyInt())).thenReturn(true);
-        Settings.System.putInt(mContentResolver,
-                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 1);
+        Settings.System.putIntForUser(mContentResolver,
+                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 1,
+                UserHandle.USER_CURRENT);
     }
 
     private void enableAutoRotation() {
diff --git a/tests/robotests/src/com/android/settings/display/SmartAutoRotatePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/SmartAutoRotatePreferenceControllerTest.java
index 0e7a86f..9f1b5d4 100644
--- a/tests/robotests/src/com/android/settings/display/SmartAutoRotatePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/SmartAutoRotatePreferenceControllerTest.java
@@ -42,6 +42,7 @@
 import com.android.settings.testutils.ResolveInfoBuilder;
 import com.android.settings.testutils.shadow.ShadowDeviceStateRotationLockSettingsManager;
 import com.android.settings.testutils.shadow.ShadowSensorPrivacyManager;
+import com.android.settings.testutils.shadow.ShadowSystemSettings;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -55,6 +56,7 @@
 
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = {
+        ShadowSystemSettings.class,
         ShadowSensorPrivacyManager.class,
         ShadowDeviceStateRotationLockSettingsManager.class
 })
@@ -234,15 +236,17 @@
     private void enableAutoRotationPreference() {
         when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
         when(mResources.getBoolean(anyInt())).thenReturn(true);
-        Settings.System.putInt(mContentResolver,
-                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0);
+        Settings.System.putIntForUser(mContentResolver,
+                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0,
+                UserHandle.USER_CURRENT);
     }
 
     private void disableAutoRotationPreference() {
         when(mPackageManager.hasSystemFeature(anyString())).thenReturn(true);
         when(mResources.getBoolean(anyInt())).thenReturn(true);
-        Settings.System.putInt(mContentResolver,
-                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 1);
+        Settings.System.putIntForUser(mContentResolver,
+                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 1,
+                UserHandle.USER_CURRENT);
     }
 
     private void enableAutoRotation() {
diff --git a/tests/robotests/src/com/android/settings/display/SmartAutoRotatePreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/display/SmartAutoRotatePreferenceFragmentTest.java
index bdff55e..3fa4582 100644
--- a/tests/robotests/src/com/android/settings/display/SmartAutoRotatePreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/display/SmartAutoRotatePreferenceFragmentTest.java
@@ -16,6 +16,8 @@
 
 package com.android.settings.display;
 
+import static android.provider.Settings.Secure.DEVICE_STATE_ROTATION_LOCK_LOCKED;
+
 import static com.android.settings.display.SmartAutoRotatePreferenceFragment.AUTO_ROTATE_MAIN_SWITCH_PREFERENCE_KEY;
 import static com.android.settings.display.SmartAutoRotatePreferenceFragment.AUTO_ROTATE_SWITCH_PREFERENCE_KEY;
 
@@ -68,6 +70,11 @@
 })
 public class SmartAutoRotatePreferenceFragmentTest {
 
+    private static final int STATE_FOLDED = 0;
+    private static final int STATE_HALF_FOLDED = 1;
+    private static final int STATE_UNFOLDED = 2;
+    private static final int STATE_REAR_DISPLAY = 3;
+
     private static final String PACKAGE_NAME = "package_name";
 
     private SmartAutoRotatePreferenceFragment mFragment;
@@ -97,6 +104,7 @@
         ContentResolver mContentResolver = RuntimeEnvironment.application.getContentResolver();
         when(mContext.getPackageManager()).thenReturn(mPackageManager);
         when(mContext.getContentResolver()).thenReturn(mContentResolver);
+        when(mContext.getApplicationContext()).thenReturn(mContext);
         doReturn(PACKAGE_NAME).when(mPackageManager).getRotationResolverPackageName();
         doReturn(PackageManager.PERMISSION_GRANTED).when(mPackageManager).checkPermission(
                 Manifest.permission.CAMERA, PACKAGE_NAME);
@@ -119,12 +127,19 @@
         when(mFragment.findPreference(AUTO_ROTATE_SWITCH_PREFERENCE_KEY)).thenReturn(
                 mRotateSwitchPreference);
 
+        when(mFragment.findPreference(AUTO_ROTATE_MAIN_SWITCH_PREFERENCE_KEY))
+                .thenReturn(mRotateMainSwitchPreference);
 
-        when(mFragment.findPreference(AUTO_ROTATE_MAIN_SWITCH_PREFERENCE_KEY)).thenReturn(
-                mRotateMainSwitchPreference);
+        when(mResources.getIntArray(com.android.internal.R.array.config_foldedDeviceStates))
+                .thenReturn(new int[] {STATE_FOLDED});
+        when(mResources.getIntArray(com.android.internal.R.array.config_halfFoldedDeviceStates))
+                .thenReturn(new int[] {STATE_HALF_FOLDED});
+        when(mResources.getIntArray(com.android.internal.R.array.config_openDeviceStates))
+                .thenReturn(new int[] {STATE_UNFOLDED});
+        when(mResources.getIntArray(com.android.internal.R.array.config_rearDisplayDeviceStates))
+                .thenReturn(new int[] {STATE_REAR_DISPLAY});
     }
 
-
     @Test
     public void createHeader_faceDetectionSupported_switchBarIsEnabled() {
         ShadowDeviceStateRotationLockSettingsManager.setDeviceStateRotationLockEnabled(false);
@@ -168,7 +183,7 @@
 
     @Test
     public void createPreferenceControllers_noSettableDeviceStates_returnsEmptyList() {
-        enableDeviceStateSettableRotationStates(new String[]{}, new String[]{});
+        enableDeviceStateSettableRotationStates(new String[] {}, new String[] {});
 
         List<AbstractPreferenceController> preferenceControllers =
                 mFragment.createPreferenceControllers(mContext);
@@ -178,17 +193,21 @@
 
     @Test
     public void createPreferenceControllers_settableDeviceStates_returnsDeviceStateControllers() {
-        enableDeviceStateSettableRotationStates(new String[]{"0:1", "1:1"},
-                new String[]{"Folded", "Unfolded"});
+        enableDeviceStateSettableRotationStates(
+                new String[] {
+                    STATE_FOLDED + ":" + DEVICE_STATE_ROTATION_LOCK_LOCKED,
+                    STATE_UNFOLDED + ":" + DEVICE_STATE_ROTATION_LOCK_LOCKED
+                },
+                new String[] {"Folded", "Unfolded"});
 
         List<AbstractPreferenceController> preferenceControllers =
                 mFragment.createPreferenceControllers(mContext);
 
         assertThat(preferenceControllers).hasSize(2);
-        assertThat(preferenceControllers.get(0)).isInstanceOf(
-                DeviceStateAutoRotateSettingController.class);
-        assertThat(preferenceControllers.get(1)).isInstanceOf(
-                DeviceStateAutoRotateSettingController.class);
+        assertThat(preferenceControllers.get(0))
+                .isInstanceOf(DeviceStateAutoRotateSettingController.class);
+        assertThat(preferenceControllers.get(1))
+                .isInstanceOf(DeviceStateAutoRotateSettingController.class);
     }
 
     @Test
@@ -204,16 +223,15 @@
         verify(mFragment, times(1)).addHelpLink();
     }
 
-    private void enableDeviceStateSettableRotationStates(String[] settableStates,
-            String[] settableStatesDescriptions) {
+    private void enableDeviceStateSettableRotationStates(
+            String[] settableStates, String[] settableStatesDescriptions) {
         when(mResources.getStringArray(
-                com.android.internal.R.array.config_perDeviceStateRotationLockDefaults)).thenReturn(
-                settableStates);
-        when(mResources.getStringArray(
-                R.array.config_settableAutoRotationDeviceStatesDescriptions)).thenReturn(
-                settableStatesDescriptions);
-        when(mResources.getBoolean(R.bool.config_auto_rotate_face_detection_available)).thenReturn(
-                true);
+                        com.android.internal.R.array.config_perDeviceStateRotationLockDefaults))
+                .thenReturn(settableStates);
+        when(mResources.getStringArray(R.array.config_settableAutoRotationDeviceStatesDescriptions))
+                .thenReturn(settableStatesDescriptions);
+        when(mResources.getBoolean(R.bool.config_auto_rotate_face_detection_available))
+                .thenReturn(true);
         DeviceStateRotationLockSettingsManager.resetInstance();
         DeviceStateRotationLockSettingsManager.getInstance(mContext)
                 .resetStateForTesting(mResources);
diff --git a/tests/robotests/src/com/android/settings/gestures/GlobalActionsPanelPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/GlobalActionsPanelPreferenceControllerTest.java
deleted file mode 100644
index 65f7ac7..0000000
--- a/tests/robotests/src/com/android/settings/gestures/GlobalActionsPanelPreferenceControllerTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2019 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.gestures;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import android.content.Context;
-import android.provider.Settings;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-
-@RunWith(RobolectricTestRunner.class)
-public class GlobalActionsPanelPreferenceControllerTest {
-
-    private Context mContext;
-    private GlobalActionsPanelPreferenceController mController;
-
-    private static final String KEY_GESTURE_PANEL = "gesture_global_actions_panel";
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        mContext = RuntimeEnvironment.application;
-        mController = new GlobalActionsPanelPreferenceController(mContext, KEY_GESTURE_PANEL);
-    }
-
-    @Test
-    public void testIsChecked_panelEnabled() {
-        Settings.Secure.putInt(
-                mContext.getContentResolver(), mController.ENABLED_SETTING, 1);
-        assertThat(mController.isChecked()).isTrue();
-    }
-
-    @Test
-    public void testIsChecked_panelDisabled() {
-        Settings.Secure.putInt(
-                mContext.getContentResolver(), mController.ENABLED_SETTING, 0);
-        assertThat(mController.isChecked()).isFalse();
-    }
-
-    @Test
-    public void getAvailabilityStatus_panelAvailable() {
-        Settings.Secure.putInt(
-                mContext.getContentResolver(), mController.AVAILABLE_SETTING, 1);
-        assertThat(mController.getAvailabilityStatus()).isEqualTo(mController.AVAILABLE);
-    }
-
-    @Test
-    public void getAvailabilityStatus_panelUnavailable() {
-        Settings.Secure.putInt(
-                mContext.getContentResolver(), mController.AVAILABLE_SETTING, 0);
-        assertThat(mController.getAvailabilityStatus())
-                .isEqualTo(mController.CONDITIONALLY_UNAVAILABLE);
-    }
-
-    @Test
-    public void isSliceable_correctKey() {
-        final GlobalActionsPanelPreferenceController controller =
-                new GlobalActionsPanelPreferenceController(mContext, mController.TOGGLE_KEY);
-        assertThat(controller.isSliceable()).isTrue();
-    }
-
-    @Test
-    public void isSliceable_incorrectKey() {
-        final GlobalActionsPanelPreferenceController controller =
-                new GlobalActionsPanelPreferenceController(mContext, "bad_key");
-        assertThat(controller.isSliceable()).isFalse();
-    }
-
-    @Test
-    public void isPublicSlice_returnTrue() {
-        assertThat(mController.isPublicSlice()).isTrue();
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardLoaderTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardLoaderTest.java
index fceb79d..0909675 100644
--- a/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardLoaderTest.java
@@ -145,7 +145,7 @@
     @Test
     public void getCardCount_hasConfiguredCardCount_returnConfiguredCardCount() {
         int configCount = 4;
-        Settings.Global.putLong(mContext.getContentResolver(),
+        Settings.Global.putInt(mContext.getContentResolver(),
                 ContextualCardLoader.CONTEXTUAL_CARD_COUNT, configCount);
 
         assertThat(mContextualCardLoader.getCardCount()).isEqualTo(configCount);
diff --git a/tests/robotests/src/com/android/settings/inputmethod/InputMethodAndSubtypePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/inputmethod/InputMethodAndSubtypePreferenceControllerTest.java
index 26cdd0a..0d1f683 100644
--- a/tests/robotests/src/com/android/settings/inputmethod/InputMethodAndSubtypePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/inputmethod/InputMethodAndSubtypePreferenceControllerTest.java
@@ -47,7 +47,10 @@
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(shadows = ShadowInputMethodManagerWithMethodList.class)
+@Config(shadows = {
+        ShadowInputMethodManagerWithMethodList.class,
+        com.android.settings.testutils.shadow.ShadowFragment.class,
+})
 public class InputMethodAndSubtypePreferenceControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/inputmethod/KeyboardLayoutPickerControllerTest.java b/tests/robotests/src/com/android/settings/inputmethod/KeyboardLayoutPickerControllerTest.java
index 734f610..0a1ccbb 100644
--- a/tests/robotests/src/com/android/settings/inputmethod/KeyboardLayoutPickerControllerTest.java
+++ b/tests/robotests/src/com/android/settings/inputmethod/KeyboardLayoutPickerControllerTest.java
@@ -50,6 +50,9 @@
 import org.robolectric.shadows.ShadowApplication;
 
 @RunWith(RobolectricTestRunner.class)
+@Config(shadows = {
+        com.android.settings.testutils.shadow.ShadowFragment.class,
+})
 public class KeyboardLayoutPickerControllerTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java
index e414929..5fb2d31 100644
--- a/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java
@@ -91,26 +91,6 @@
         assertThat(mController.isAvailable()).isFalse();
     }
 
-    /**
-     * Devices that are not voice capable should still show Ring volume, because it is used by apps
-     * that make calls outside the cell network.
-     */
-    @Test
-    public void isAvailable_notSingleVolume_notVoiceCapable_shouldReturnTrue() {
-        when(mHelper.isSingleVolume()).thenReturn(false);
-        when(mTelephonyManager.isVoiceCapable()).thenReturn(false);
-
-        assertThat(mController.isAvailable()).isTrue();
-    }
-
-    @Test
-    public void isAvailable_notSingleVolume_VoiceCapable_shouldReturnTrue() {
-        when(mHelper.isSingleVolume()).thenReturn(false);
-        when(mTelephonyManager.isVoiceCapable()).thenReturn(true);
-
-        assertThat(mController.isAvailable()).isTrue();
-    }
-
     @Test
     public void getAudioStream_shouldReturnRing() {
         assertThat(mController.getAudioStream()).isEqualTo(AudioManager.STREAM_RING);
diff --git a/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java b/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java
index 299b1eb..92b2b62 100644
--- a/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java
+++ b/tests/robotests/src/com/android/settings/password/ConfirmCredentialTest.java
@@ -47,6 +47,7 @@
 import com.android.settings.testutils.shadow.ShadowUtils;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.MockitoAnnotations;
@@ -128,6 +129,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void onCreate_remoteValidation_invalidServiceComponentName_finishActivity()
             throws Exception {
         Intent intentWithInvalidComponentName = new Intent()
diff --git a/tests/robotests/src/com/android/settings/password/ConfirmLockPasswordTest.java b/tests/robotests/src/com/android/settings/password/ConfirmLockPasswordTest.java
index d26c33b..4ac375f 100644
--- a/tests/robotests/src/com/android/settings/password/ConfirmLockPasswordTest.java
+++ b/tests/robotests/src/com/android/settings/password/ConfirmLockPasswordTest.java
@@ -62,6 +62,7 @@
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
@@ -176,6 +177,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void handleNext_remoteValidation_correctGuess_checkboxChecked() throws Exception {
         ConfirmDeviceCredentialBaseActivity activity =
                 buildConfirmDeviceCredentialBaseActivity(
@@ -201,6 +203,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void handleNext_remoteValidation_correctGuess_checkboxUnchecked() throws Exception {
         ConfirmDeviceCredentialBaseActivity activity =
                 buildConfirmDeviceCredentialBaseActivity(
@@ -227,6 +230,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void handleNext_remoteValidation_guessInvalid() throws Exception {
         ConfirmDeviceCredentialBaseActivity activity =
                 buildConfirmDeviceCredentialBaseActivity(
@@ -251,6 +255,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void handleNext_remoteValidation_lockout() throws Exception {
         ConfirmDeviceCredentialBaseActivity activity =
                 buildConfirmDeviceCredentialBaseActivity(
@@ -275,6 +280,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void handleNext_remoteValidation_noRemainingAttempts_finishActivity() throws Exception {
         ConfirmDeviceCredentialBaseActivity activity =
                 buildConfirmDeviceCredentialBaseActivity(
diff --git a/tests/robotests/src/com/android/settings/password/ConfirmLockPatternTest.java b/tests/robotests/src/com/android/settings/password/ConfirmLockPatternTest.java
index 2ed7988..04a76b8 100644
--- a/tests/robotests/src/com/android/settings/password/ConfirmLockPatternTest.java
+++ b/tests/robotests/src/com/android/settings/password/ConfirmLockPatternTest.java
@@ -58,6 +58,7 @@
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
@@ -156,6 +157,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void onPatternDetected_remoteValidation_guessValid_checkboxChecked() throws Exception {
         ConfirmDeviceCredentialBaseActivity activity =
                 buildConfirmDeviceCredentialBaseActivity(
@@ -181,6 +183,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void onPatternDetected_remoteValidation_guessValid_checkboxUnchecked() throws Exception {
         ConfirmDeviceCredentialBaseActivity activity =
                 buildConfirmDeviceCredentialBaseActivity(
@@ -207,6 +210,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void onPatternDetected_remoteValidation_guessInvalid() throws Exception {
         ConfirmDeviceCredentialBaseActivity activity =
                 buildConfirmDeviceCredentialBaseActivity(
@@ -231,6 +235,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void onPatternDetected_remoteValidation_lockout() throws Exception {
         ConfirmDeviceCredentialBaseActivity activity =
                 buildConfirmDeviceCredentialBaseActivity(
@@ -255,6 +260,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void onPatternDetected_noRemainingAttempts_finishActivity() throws Exception {
         ConfirmDeviceCredentialBaseActivity activity =
                 buildConfirmDeviceCredentialBaseActivity(
diff --git a/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java b/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java
index af44d39..5e429d9 100644
--- a/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java
@@ -50,6 +50,7 @@
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -90,6 +91,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void testChooseLockGeneric() {
         Settings.Global.putInt(RuntimeEnvironment.application.getContentResolver(),
                 Settings.Global.DEVICE_PROVISIONED, 1);
diff --git a/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java b/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java
index 97a326f..e207d24 100644
--- a/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetupChooseLockPasswordTest.java
@@ -47,6 +47,7 @@
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.RobolectricTestRunner;
@@ -122,6 +123,7 @@
 
     @Test
     @Config(shadows = ShadowChooseLockGenericController.class)
+    @Ignore("b/295325503")
     public void createActivity_withShowOptionsButtonExtra_buttonNotVisibleIfNoVisibleLockTypes() {
         SetupChooseLockPassword activity = createSetupChooseLockPassword();
         Button optionsButton = activity.findViewById(R.id.screen_lock_options);
diff --git a/tests/robotests/src/com/android/settings/password/SetupChooseLockPatternTest.java b/tests/robotests/src/com/android/settings/password/SetupChooseLockPatternTest.java
index 648c42f..7767644 100644
--- a/tests/robotests/src/com/android/settings/password/SetupChooseLockPatternTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetupChooseLockPatternTest.java
@@ -51,6 +51,7 @@
 import com.google.android.setupcompat.template.FooterButton;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.RobolectricTestRunner;
@@ -99,6 +100,7 @@
     }
 
     @Test
+    @Ignore("b/295325503")
     public void optionsButton_whenPatternSelected_shouldBeVisible() {
         final Button button = mActivity.findViewById(R.id.screen_lock_options);
         assertThat(button).isNotNull();
@@ -125,12 +127,14 @@
 
     @Config(qualifiers = "sw400dp")
     @Test
+    @Ignore("b/295325503")
     public void sw400dp_shouldShowScreenLockOptions() {
         verifyScreenLockOptionsShown();
     }
 
     @Config(qualifiers = "sw400dp-land")
     @Test
+    @Ignore("b/295325503")
     public void sw400dpLandscape_shouldShowScreenLockOptions() {
         verifyScreenLockOptionsShown();
     }
@@ -143,17 +147,20 @@
 
     @Config(qualifiers = "sw300dp")
     @Test
+    @Ignore("b/295325503")
     public void smallScreens_shouldHideScreenLockOptions() {
         verifyScreenLockOptionsHidden();
     }
 
     @Config(qualifiers = "sw300dp-land")
     @Test
+    @Ignore("b/295325503")
     public void smallScreensLandscape_shouldHideScreenLockOptions() {
         verifyScreenLockOptionsHidden();
     }
 
     @Test
+    @Ignore("b/295325503")
     public void skipButton_shouldBeVisible_duringNonFingerprintFlow() {
         final PartnerCustomizationLayout layout = mActivity.findViewById(R.id.setup_wizard_layout);
         final Button skipOrClearButton =
diff --git a/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java b/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java
index 21b00a3..5de64b5 100644
--- a/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java
+++ b/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java
@@ -1,5 +1,6 @@
 package com.android.settings.search;
 
+import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_SEARCHABLE;
 import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_TITLE;
 
 import static com.google.common.truth.Truth.assertThat;
@@ -205,6 +206,19 @@
         assertThat(mProvider.isEligibleForIndexing(PACKAGE_NAME, activityTile)).isTrue();
     }
 
+    @Test
+    public void isEligibleForIndexing_disabledByMetadata_shouldReturnFalse() {
+        final ActivityInfo activityInfo = new ActivityInfo();
+        activityInfo.packageName = PACKAGE_NAME;
+        activityInfo.name = "class";
+        activityInfo.metaData = new Bundle();
+        activityInfo.metaData.putBoolean(META_DATA_PREFERENCE_SEARCHABLE, false);
+        final ActivityTile activityTile = new ActivityTile(activityInfo,
+                CategoryKey.CATEGORY_CONNECT);
+
+        assertThat(mProvider.isEligibleForIndexing(PACKAGE_NAME, activityTile)).isFalse();
+    }
+
     @Implements(CategoryManager.class)
     public static class ShadowCategoryManager {
 
diff --git a/tests/robotests/src/com/android/settings/sim/SimSelectNotificationTest.java b/tests/robotests/src/com/android/settings/sim/SimSelectNotificationTest.java
index e1b2b4e..cbdcf3c 100644
--- a/tests/robotests/src/com/android/settings/sim/SimSelectNotificationTest.java
+++ b/tests/robotests/src/com/android/settings/sim/SimSelectNotificationTest.java
@@ -30,7 +30,6 @@
 
 import static com.android.settings.sim.SimDialogActivity.DATA_PICK;
 import static com.android.settings.sim.SimDialogActivity.INVALID_PICK;
-import static com.android.settings.sim.SimDialogActivity.PICK_DISMISS;
 import static com.android.settings.sim.SimSelectNotification.ENABLE_MMS_NOTIFICATION_CHANNEL;
 import static com.android.settings.sim.SimSelectNotification.ENABLE_MMS_NOTIFICATION_ID;
 import static com.android.settings.sim.SimSelectNotification.SIM_WARNING_NOTIFICATION_CHANNEL;
@@ -61,6 +60,8 @@
 import android.telephony.TelephonyManager;
 import android.util.DisplayMetrics;
 
+import androidx.test.core.app.ApplicationProvider;
+
 import com.android.settings.R;
 import com.android.settings.network.SubscriptionUtil;
 import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
@@ -71,6 +72,7 @@
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.annotation.Config;
 
@@ -80,8 +82,8 @@
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = ShadowAlertDialogCompat.class)
 public class SimSelectNotificationTest {
-    @Mock
-    private Context mContext;
+    @Spy
+    private Context mContext = ApplicationProvider.getApplicationContext();
     @Mock
     private Executor mExecutor;
     @Mock
@@ -92,8 +94,8 @@
     private SubscriptionManager mSubscriptionManager;
     @Mock
     private PackageManager mPackageManager;
-    @Mock
-    private Resources mResources;
+    @Spy
+    private Resources mResources = mContext.getResources();
     @Mock
     private SubscriptionInfo mSubInfo;
     @Mock
diff --git a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowRotationPolicy.java b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowRotationPolicy.java
index 1f1e2be..d052340 100644
--- a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowRotationPolicy.java
+++ b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowRotationPolicy.java
@@ -30,12 +30,13 @@
     private static boolean rotationSupported = true;
 
     @Implementation
-    protected static void setRotationLock(Context context, final boolean enabled) {
+    protected static void setRotationLock(Context context, final boolean enabled, String caller) {
         rotationLockEnabled = enabled;
     }
 
     @Implementation
-    protected static void setRotationLockForAccessibility(Context context, final boolean enabled) {
+    protected static void setRotationLockForAccessibility(
+            Context context, final boolean enabled, String caller) {
         rotationLockEnabled = enabled;
     }
 
diff --git a/tests/robotests/src/com/android/settings/users/UserDetailsSettingsTest.java b/tests/robotests/src/com/android/settings/users/UserDetailsSettingsTest.java
index 256e08b..b339052 100644
--- a/tests/robotests/src/com/android/settings/users/UserDetailsSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/users/UserDetailsSettingsTest.java
@@ -80,7 +80,8 @@
 
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = {
-        // ShadowUserManager.class,
+        ShadowUserManager.class,
+        com.android.settings.testutils.shadow.ShadowFragment.class,
         ShadowDevicePolicyManager.class
 })
 public class UserDetailsSettingsTest {
diff --git a/tests/robotests/src/com/android/settings/vpn2/AppDialogFragmentTest.java b/tests/robotests/src/com/android/settings/vpn2/AppDialogFragmentTest.java
index 2b81f16..b13ec6a 100644
--- a/tests/robotests/src/com/android/settings/vpn2/AppDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/vpn2/AppDialogFragmentTest.java
@@ -29,8 +29,13 @@
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
+import org.robolectric.annotation.Config;
 
 @RunWith(RobolectricTestRunner.class)
+@Config(shadows = {
+        com.android.settings.testutils.shadow.ShadowFragment.class,
+})
+
 public class AppDialogFragmentTest {
 
     @Mock
diff --git a/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java b/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
index bed88e7..c693938 100644
--- a/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
+++ b/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
@@ -66,6 +66,7 @@
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = {
         ShadowUserManager.class,
+        com.android.settings.testutils.shadow.ShadowFragment.class,
 })
 public class WebViewAppPickerTest {
 
diff --git a/tests/robotests/src/com/android/settings/widget/EntityHeaderControllerTest.java b/tests/robotests/src/com/android/settings/widget/EntityHeaderControllerTest.java
index 06b99a4..9ed6de3 100644
--- a/tests/robotests/src/com/android/settings/widget/EntityHeaderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/widget/EntityHeaderControllerTest.java
@@ -52,8 +52,12 @@
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
 
 @RunWith(RobolectricTestRunner.class)
+@Config(shadows = {
+        com.android.settings.testutils.shadow.ShadowFragment.class,
+})
 public class EntityHeaderControllerTest {
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
diff --git a/tests/robotests/src/com/android/settings/widget/HighlightablePreferenceGroupAdapterTest.java b/tests/robotests/src/com/android/settings/widget/HighlightablePreferenceGroupAdapterTest.java
index d6d5abf..29560ab 100644
--- a/tests/robotests/src/com/android/settings/widget/HighlightablePreferenceGroupAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/widget/HighlightablePreferenceGroupAdapterTest.java
@@ -53,9 +53,13 @@
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
 import org.robolectric.util.ReflectionHelpers;
 
 @RunWith(RobolectricTestRunner.class)
+@Config(shadows = {
+        com.android.settings.testutils.shadow.ShadowFragment.class,
+})
 public class HighlightablePreferenceGroupAdapterTest {
 
     private static final String TEST_KEY = "key";
diff --git a/tests/robotests/src/com/android/settings/widget/SettingsMainSwitchPreferenceTest.java b/tests/robotests/src/com/android/settings/widget/SettingsMainSwitchPreferenceTest.java
index d64d237..a5ebdad 100644
--- a/tests/robotests/src/com/android/settings/widget/SettingsMainSwitchPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/widget/SettingsMainSwitchPreferenceTest.java
@@ -22,12 +22,9 @@
 
 import android.content.Context;
 import android.view.View;
-import android.widget.ImageView;
 
 import androidx.preference.PreferenceViewHolder;
 
-import com.android.settings.R;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -59,17 +56,6 @@
     }
 
     @Test
-    public void onBindViewHolder_isRestricted_restrictIconShouldDisplay() {
-        mPreference.onBindViewHolder(mHolder);
-
-        final SettingsMainSwitchBar switchBar = mPreference.getSwitchBar();
-        final ImageView restrictedIcon = switchBar.findViewById(
-                com.android.settingslib.widget.restricted.R.id.restricted_icon);
-
-        assertThat(restrictedIcon.getVisibility() == View.VISIBLE).isTrue();
-    }
-
-    @Test
     public void show_preferenceShouldDisplay() {
         mPreference.show();
 
diff --git a/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java b/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java
index 5e3d715..5bacfab 100644
--- a/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/ConfigureWifiSettingsTest.java
@@ -45,6 +45,9 @@
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
+@Config(shadows = {
+        com.android.settings.testutils.shadow.ShadowFragment.class,
+})
 public class ConfigureWifiSettingsTest {
 
     @Rule
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiDialogActivityTest.java b/tests/robotests/src/com/android/settings/wifi/WifiDialogActivityTest.java
index c9cc02e..5a39368 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiDialogActivityTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiDialogActivityTest.java
@@ -27,7 +27,9 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
 import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
@@ -42,6 +44,7 @@
 
 import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settingslib.wifi.AccessPoint;
+import com.android.wifitrackerlib.NetworkDetailsTracker;
 import com.android.wifitrackerlib.WifiEntry;
 
 import com.google.android.setupcompat.util.WizardManagerHelper;
@@ -59,14 +62,13 @@
 
     static final String CALLING_PACKAGE = "calling_package";
     static final int REQUEST_CODE = REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER;
+    private static final String SSID = "SSID";
 
     @Mock
     UserManager mUserManager;
     @Mock
     PackageManager mPackageManager;
     @Mock
-    WifiManager mWifiManager;
-    @Mock
     WifiDialog mWifiDialog;
     @Mock
     WifiConfiguration mWifiConfiguration;
@@ -91,16 +93,22 @@
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         when(mWifiDialog.getController()).thenReturn(mController);
+        mWifiConfiguration.SSID = SSID;
         when(mController.getConfig()).thenReturn(mWifiConfiguration);
         when(mController.getAccessPoint()).thenReturn(mAccessPoint);
         when(mWifiDialog2.getController()).thenReturn(mWifiConfiguration2);
         when(mWifiConfiguration2.getWifiEntry()).thenReturn(mWifiEntry);
         when(mWifiEntry.canConnect()).thenReturn(true);
         FakeFeatureFactory.setupForTest();
+        WifiTrackerLibProvider mockWifiTrackerLibProvider =
+                FakeFeatureFactory.getFeatureFactory().getWifiTrackerLibProvider();
+        when(mockWifiTrackerLibProvider.createNetworkDetailsTracker(
+                any(), any(), any(), any(), any(), anyLong(), anyLong(), any())
+        ).thenReturn(mock(NetworkDetailsTracker.class));
 
         mActivity = spy(Robolectric.setupActivity(WifiDialogActivity.class));
         when(mActivity.getSystemService(UserManager.class)).thenReturn(mUserManager);
-        when(mActivity.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
+
         when(mActivity.getSystemService(KeyguardManager.class)).thenReturn(mKeyguardManager);
     }
 
@@ -108,7 +116,8 @@
     public void onSubmit_shouldConnectToNetwork() {
         mActivity.onSubmit(mWifiDialog);
 
-        verify(mWifiManager).connect(any(), any());
+        WifiManager wifiManager = mActivity.getSystemService(WifiManager.class);
+        assertThat(wifiManager.getConnectionInfo().getSSID()).isEqualTo("\"SSID\"");
     }
 
     @Test
@@ -155,7 +164,6 @@
         intent.putExtra(WifiDialogActivity.KEY_CHOSEN_WIFIENTRY_KEY, "FAKE_KEY");
         intent.putExtra(WifiDialogActivity.KEY_CONNECT_FOR_CALLER, true);
         mActivity = spy(Robolectric.buildActivity(WifiDialogActivity.class, intent).setup().get());
-        when(mActivity.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
 
         mActivity.onSubmit(mWifiDialog2);
 
@@ -167,11 +175,11 @@
         final Intent intent = new Intent();
         intent.putExtra(WifiDialogActivity.KEY_CONNECT_FOR_CALLER, false);
         mActivity = spy(Robolectric.buildActivity(WifiDialogActivity.class, intent).setup().get());
-        when(mActivity.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
 
         mActivity.onSubmit(mWifiDialog);
 
-        verify(mWifiManager, never()).connect(any(), any());
+        WifiManager wifiManager = mActivity.getSystemService(WifiManager.class);
+        assertThat(wifiManager.getConnectionInfo().getSSID()).isEqualTo(WifiManager.UNKNOWN_SSID);
     }
 
     @Test
@@ -180,7 +188,6 @@
         intent.putExtra(WifiDialogActivity.KEY_CHOSEN_WIFIENTRY_KEY, "FAKE_KEY");
         intent.putExtra(WifiDialogActivity.KEY_CONNECT_FOR_CALLER, false);
         mActivity = spy(Robolectric.buildActivity(WifiDialogActivity.class, intent).setup().get());
-        when(mActivity.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
 
         mActivity.onSubmit(mWifiDialog2);
 
@@ -193,8 +200,7 @@
         intent.putExtra(WifiDialogActivity.KEY_CONNECT_FOR_CALLER, false);
         intent.putExtra(WizardManagerHelper.EXTRA_IS_FIRST_RUN, true);
         intent.putExtra(WizardManagerHelper.EXTRA_IS_SETUP_FLOW, true);
-        mActivity = spy(Robolectric.buildActivity(WifiDialogActivity.class, intent).setup().get());
-        when(mActivity.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
+        mActivity = spy(Robolectric.buildActivity(WifiDialogActivity.class, intent).create().get());
         doNothing().when(mActivity).createDialogWithSuwTheme();
 
         mActivity.onStart();
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiScanningRequiredFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/WifiScanningRequiredFragmentTest.java
index 6969e14..f732b5e 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiScanningRequiredFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiScanningRequiredFragmentTest.java
@@ -47,8 +47,12 @@
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
 
 @RunWith(RobolectricTestRunner.class)
+@Config(shadows = {
+        com.android.settings.testutils.shadow.ShadowFragment.class,
+})
 public class WifiScanningRequiredFragmentTest {
 
     private WifiScanningRequiredFragment mFragment;
diff --git a/tests/robotests/src/com/android/settings/wifi/addappnetworks/AddAppNetworksFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/addappnetworks/AddAppNetworksFragmentTest.java
index 303963d..699a8e8 100644
--- a/tests/robotests/src/com/android/settings/wifi/addappnetworks/AddAppNetworksFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/addappnetworks/AddAppNetworksFragmentTest.java
@@ -55,12 +55,16 @@
 import org.mockito.MockitoAnnotations;
 import org.robolectric.Robolectric;
 import org.robolectric.RobolectricTestRunner;
+import org.robolectric.annotation.Config;
 import org.robolectric.shadows.androidx.fragment.FragmentController;
 
 import java.util.ArrayList;
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
+@Config(shadows = {
+        com.android.settings.testutils.shadow.ShadowFragment.class,
+})
 public class AddAppNetworksFragmentTest {
 
     private static final String FAKE_APP_NAME = "fake_app_name";
diff --git a/tests/robotests/src/com/android/settings/wifi/calling/WifiCallingSliceHelperTest.java b/tests/robotests/src/com/android/settings/wifi/calling/WifiCallingSliceHelperTest.java
index bcc0933..2d64e16 100644
--- a/tests/robotests/src/com/android/settings/wifi/calling/WifiCallingSliceHelperTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/calling/WifiCallingSliceHelperTest.java
@@ -47,7 +47,6 @@
 import androidx.slice.widget.SliceContent;
 import androidx.slice.widget.SliceLiveData;
 
-import com.android.ims.ImsManager;
 import com.android.settings.R;
 import com.android.settings.network.ims.MockWifiCallingQueryImsState;
 import com.android.settings.slices.CustomSliceRegistry;
@@ -79,9 +78,6 @@
     private CarrierConfigManager mMockCarrierConfigManager;
 
     @Mock
-    private ImsManager mMockImsManager;
-
-    @Mock
     private ImsMmTelManager mMockImsMmTelManager;
 
     private MockWifiCallingQueryImsState mQueryImsState;
@@ -122,20 +118,7 @@
     }
 
     @Test
-    public void test_CreateWifiCallingSlice_invalidSubId() {
-        mQueryImsState.setIsEnabledByUser(true);
-        mQueryImsState.setIsProvisionedOnDevice(false);
-        mWfcSliceHelper.setDefaultVoiceSubId(-1);
-        mQueryImsState.setIsReadyToWifiCalling(true);
-
-        final Slice slice = mWfcSliceHelper.createWifiCallingSlice(
-                CustomSliceRegistry.WIFI_CALLING_URI);
-
-        assertThat(slice).isNull();
-    }
-
-    @Test
-    public void test_CreateWifiCallingSlice_wfcNotSupported() {
+    public void createWifiCallingSlice_notReadyToWifiCalling_wfcNotSupported() {
         mQueryImsState.setIsProvisionedOnDevice(false);
         mQueryImsState.setIsReadyToWifiCalling(false);
 
diff --git a/tests/robotests/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2Test.java b/tests/robotests/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2Test.java
index 4b01aaf..11d421c 100644
--- a/tests/robotests/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2Test.java
+++ b/tests/robotests/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2Test.java
@@ -120,7 +120,10 @@
 
 // TODO(b/143326832): Should add test cases for connect button.
 @RunWith(RobolectricTestRunner.class)
-@Config(shadows = {ShadowDevicePolicyManager.class, ShadowEntityHeaderController.class})
+@Config(shadows = {
+        ShadowDevicePolicyManager.class,
+        com.android.settings.testutils.shadow.ShadowFragment.class,
+        ShadowEntityHeaderController.class})
 public class WifiDetailPreferenceController2Test {
 
     private static final int LEVEL = 1;
@@ -434,16 +437,6 @@
     }
 
     @Test
-    public void latestWifiInfo_shouldBeFetchedInDisplayPreferenceForConnectedNetwork() {
-        setUpForConnectedNetwork();
-        setUpSpyController();
-
-        displayAndResume();
-
-        verify(mMockWifiManager, times(1)).getConnectionInfo();
-    }
-
-    @Test
     public void latestWifiInfo_shouldNotBeFetchedInDisplayPreferenceForDisconnectedNetwork() {
         setUpForDisconnectedNetwork();
 
@@ -462,16 +455,6 @@
     }
 
     @Test
-    public void latestNetworkInfo_shouldBeFetchedInDisplayPreferenceForConnectedNetwork() {
-        setUpForConnectedNetwork();
-        setUpSpyController();
-
-        displayAndResume();
-
-        verify(mMockConnectivityManager, times(1)).getNetworkInfo(any(Network.class));
-    }
-
-    @Test
     public void latestNetworkInfo_shouldNotBeFetchedInDisplayPreferenceForDisconnectedNetwork() {
         setUpForDisconnectedNetwork();
 
@@ -1280,8 +1263,9 @@
 
         displayAndResume();
 
-        verify(mMockConnectivityManager, times(1)).getNetworkInfo(any(Network.class));
-        verify(mMockWifiManager, times(1)).getConnectionInfo();
+        verify(mMockWifiManager, times(1)).getCurrentNetwork();
+        verify(mMockConnectivityManager, times(1)).getLinkProperties(any(Network.class));
+        verify(mMockConnectivityManager, times(1)).getNetworkCapabilities(any(Network.class));
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java
index bf978c7..ff1125d 100644
--- a/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java
@@ -43,10 +43,14 @@
 import org.mockito.junit.MockitoJUnit;
 import org.mockito.junit.MockitoRule;
 import org.robolectric.RobolectricTestRunner;
+import org.robolectric.annotation.Config;
 
 import java.util.Arrays;
 
 @RunWith(RobolectricTestRunner.class)
+@Config(shadows = {
+        com.android.settings.testutils.shadow.ShadowFragment.class,
+})
 public class WifiDppQrCodeScannerFragmentTest {
 
     static final String WIFI_SSID = "wifi-ssid";
diff --git a/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2pSettingsTest.java b/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2pSettingsTest.java
index a8b1d9c..99286cf 100644
--- a/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2pSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/p2p/WifiP2pSettingsTest.java
@@ -51,6 +51,7 @@
 import com.android.settingslib.core.AbstractPreferenceController;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -65,6 +66,7 @@
 
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = ShadowInteractionJankMonitor.class)
+@Ignore
 public class WifiP2pSettingsTest {
 
     private Context mContext;
diff --git a/tests/shared/Android.bp b/tests/shared/Android.bp
new file mode 100644
index 0000000..fca24b6
--- /dev/null
+++ b/tests/shared/Android.bp
@@ -0,0 +1,9 @@
+android_library {
+    name: "Settings-testutils2",
+    srcs: [
+        "src/**/*.kt"
+    ],
+    libs: [
+        "FingerprintManagerInteractor",
+    ],
+}
diff --git a/tests/shared/AndroidManifest.xml b/tests/shared/AndroidManifest.xml
new file mode 100644
index 0000000..7e1842c
--- /dev/null
+++ b/tests/shared/AndroidManifest.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2022 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.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.android.settings.testutils2">
+</manifest>
diff --git a/tests/unit/src/com/android/settings/fingerprint2/domain/interactor/FakeFingerprintManagerInteractor.kt b/tests/shared/src/com/android/settings/testutils2/FakeFingerprintManagerInteractor.kt
similarity index 71%
rename from tests/unit/src/com/android/settings/fingerprint2/domain/interactor/FakeFingerprintManagerInteractor.kt
rename to tests/shared/src/com/android/settings/testutils2/FakeFingerprintManagerInteractor.kt
index f807f70..05c3e3c 100644
--- a/tests/unit/src/com/android/settings/fingerprint2/domain/interactor/FakeFingerprintManagerInteractor.kt
+++ b/tests/shared/src/com/android/settings/testutils2/FakeFingerprintManagerInteractor.kt
@@ -14,18 +14,19 @@
  * limitations under the License.
  */
 
-package com.android.settings.fingerprint2.domain.interactor
+package com.android.settings.testutils2
 
-import android.hardware.biometrics.SensorProperties
-import android.hardware.fingerprint.FingerprintSensorProperties.TYPE_POWER_BUTTON
-import android.hardware.fingerprint.FingerprintSensorPropertiesInternal
-import com.android.settings.biometrics.fingerprint2.domain.interactor.FingerprintManagerInteractor
+import com.android.settings.biometrics.fingerprint2.shared.domain.interactor.FingerprintManagerInteractor
 import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintAuthAttemptViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintSensorPropertyViewModel
 import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintViewModel
-import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.EnrollReason
-import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.FingerEnrollStateViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.EnrollReason
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerEnrollStateViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorStrength
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorType
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.flow
+import kotlinx.coroutines.flow.flowOf
 
 /** Fake to be used by other classes to easily fake the FingerprintManager implementation. */
 class FakeFingerprintManagerInteractor : FingerprintManagerInteractor {
@@ -37,17 +38,8 @@
   val enrollStateViewModel = FingerEnrollStateViewModel.EnrollProgress(1)
   var pressToAuthEnabled = true
 
-  var sensorProps =
-    listOf(
-      FingerprintSensorPropertiesInternal(
-        0 /* sensorId */,
-        SensorProperties.STRENGTH_STRONG,
-        5 /* maxEnrollmentsPerUser */,
-        emptyList() /* ComponentInfoInternal */,
-        TYPE_POWER_BUTTON,
-        true /* resetLockoutRequiresHardwareAuthToken */
-      )
-    )
+  var sensorProp =
+    FingerprintSensorPropertyViewModel(0 /* sensorId */, SensorStrength.Strong, 5, SensorType.SFPS)
 
   override suspend fun authenticate(): FingerprintAuthAttemptViewModel {
     return authenticateAttempt
@@ -65,8 +57,8 @@
     emit(enrolledFingerprintsInternal.size < enrollableFingerprints)
   }
 
-  override val sensorPropertiesInternal: Flow<FingerprintSensorPropertiesInternal?> = flow {
-    emit(sensorProps.first())
+  override val sensorPropertiesInternal: Flow<FingerprintSensorPropertyViewModel?> = flow {
+    emit(sensorProp)
   }
 
   override val maxEnrollableFingerprints: Flow<Int> = flow { emit(enrollableFingerprints) }
@@ -74,7 +66,7 @@
   override suspend fun enroll(
     hardwareAuthToken: ByteArray?,
     enrollReason: EnrollReason
-  ): Flow<FingerEnrollStateViewModel> = flow { emit(enrollStateViewModel) }
+  ): Flow<FingerEnrollStateViewModel> = flowOf(enrollStateViewModel)
 
   override suspend fun removeFingerprint(fp: FingerprintViewModel): Boolean {
     return enrolledFingerprintsInternal.remove(fp)
@@ -87,7 +79,7 @@
   }
 
   override suspend fun hasSideFps(): Boolean {
-    return sensorProps.any { it.isAnySidefpsType }
+    return sensorProp.sensorType == SensorType.SFPS
   }
 
   override suspend fun pressToAuthEnabled(): Boolean {
diff --git a/tests/spa_unit/src/com/android/settings/datausage/ChartDataUsagePreferenceControllerTest.kt b/tests/spa_unit/src/com/android/settings/datausage/ChartDataUsagePreferenceControllerTest.kt
new file mode 100644
index 0000000..1748f07
--- /dev/null
+++ b/tests/spa_unit/src/com/android/settings/datausage/ChartDataUsagePreferenceControllerTest.kt
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2023 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.datausage
+
+import android.content.Context
+import androidx.lifecycle.testing.TestLifecycleOwner
+import androidx.preference.PreferenceScreen
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.settings.datausage.lib.INetworkCycleDataRepository
+import com.android.settings.datausage.lib.NetworkCycleChartData
+import com.android.settings.datausage.lib.NetworkUsageData
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.runBlocking
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.verify
+
+@RunWith(AndroidJUnit4::class)
+class ChartDataUsagePreferenceControllerTest {
+    private val context: Context = ApplicationProvider.getApplicationContext()
+
+    private val repository = object : INetworkCycleDataRepository {
+        override suspend fun loadCycles() = emptyList<NetworkUsageData>()
+
+        override fun getPolicy() = null
+
+        override suspend fun querySummary(startTime: Long, endTime: Long) = when {
+            startTime == START_TIME && endTime == END_TIME -> CycleChartDate
+            else -> null
+        }
+    }
+
+    private val preference = mock<ChartDataUsagePreference>()
+    private val preferenceScreen = mock<PreferenceScreen> {
+        onGeneric { findPreference(KEY) } doReturn preference
+    }
+
+    private val controller = ChartDataUsagePreferenceController(context, KEY)
+
+    @Before
+    fun setUp() {
+        controller.init(repository)
+        controller.displayPreference(preferenceScreen)
+        controller.onViewCreated(TestLifecycleOwner())
+    }
+
+    @Test
+    fun update() = runBlocking {
+        controller.update(START_TIME, END_TIME)
+        delay(100L)
+
+        verify(preference).setTime(START_TIME, END_TIME)
+        verify(preference).setNetworkCycleData(CycleChartDate)
+    }
+
+    private companion object {
+        const val KEY = "test_key"
+        const val START_TIME = 1L
+        const val END_TIME = 2L
+
+        val UsageData = NetworkUsageData(startTime = START_TIME, endTime = END_TIME, usage = 10)
+        val CycleChartDate =
+            NetworkCycleChartData(total = UsageData, dailyUsage = listOf(UsageData))
+    }
+}
diff --git a/tests/spa_unit/src/com/android/settings/datausage/DataUsageListAppsControllerTest.kt b/tests/spa_unit/src/com/android/settings/datausage/DataUsageListAppsControllerTest.kt
index af5dc89..2646323 100644
--- a/tests/spa_unit/src/com/android/settings/datausage/DataUsageListAppsControllerTest.kt
+++ b/tests/spa_unit/src/com/android/settings/datausage/DataUsageListAppsControllerTest.kt
@@ -22,8 +22,8 @@
 import androidx.test.core.app.ApplicationProvider
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import com.android.settings.SettingsActivity
+import com.android.settings.datausage.lib.NetworkUsageData
 import com.android.settingslib.AppItem
-import com.android.settingslib.net.NetworkCycleChartData
 import com.google.common.truth.Truth.assertThat
 import org.junit.Before
 import org.junit.Test
@@ -48,11 +48,8 @@
     @Before
     fun setUp() {
         controller.init(mock<NetworkTemplate>())
-        val data = NetworkCycleChartData.Builder().apply {
-            setStartTime(START_TIME)
-            setEndTime(END_TIME)
-        }.build()
-        controller.setCycleData(listOf(data))
+        val data = NetworkUsageData(START_TIME, END_TIME, 0)
+        controller.updateCycles(listOf(data))
     }
 
     @Test
diff --git a/tests/spa_unit/src/com/android/settings/datausage/DataUsageListHeaderControllerTest.kt b/tests/spa_unit/src/com/android/settings/datausage/DataUsageListHeaderControllerTest.kt
index a1eebe7..35b70d6 100644
--- a/tests/spa_unit/src/com/android/settings/datausage/DataUsageListHeaderControllerTest.kt
+++ b/tests/spa_unit/src/com/android/settings/datausage/DataUsageListHeaderControllerTest.kt
@@ -21,10 +21,16 @@
 import android.view.LayoutInflater
 import android.view.View
 import android.widget.Spinner
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.testing.TestLifecycleOwner
 import androidx.test.core.app.ApplicationProvider
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import com.android.settings.R
+import com.android.settings.datausage.lib.INetworkCycleDataRepository
+import com.android.settings.datausage.lib.NetworkUsageData
 import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.runBlocking
 import org.junit.Test
 import org.junit.runner.RunWith
 import org.mockito.kotlin.any
@@ -40,6 +46,14 @@
         doNothing().whenever(mock).startActivity(any())
     }
 
+    private val repository = object : INetworkCycleDataRepository {
+        override suspend fun loadCycles() = emptyList<NetworkUsageData>()
+
+        override fun getPolicy() = null
+
+        override suspend fun querySummary(startTime: Long, endTime: Long) = null
+    }
+
     private val header =
         LayoutInflater.from(context).inflate(R.layout.apps_filter_spinner, null, false)
 
@@ -47,11 +61,16 @@
 
     private val spinner: Spinner = header.requireViewById(R.id.filter_spinner)
 
+    private val testLifecycleOwner = TestLifecycleOwner(initialState = Lifecycle.State.CREATED)
+
     private val controller = DataUsageListHeaderController(
         header = header,
         template = mock<NetworkTemplate>(),
         sourceMetricsCategory = 0,
-        onItemSelected = { _, _ -> },
+        viewLifecycleOwner = testLifecycleOwner,
+        onCyclesLoad = {},
+        onItemSelected = {},
+        repository = repository,
     )
 
     @Test
@@ -60,8 +79,9 @@
     }
 
     @Test
-    fun updateCycleData_shouldShowCycleSpinner() {
-        controller.updateCycleData(emptyList())
+    fun updateCycleData_shouldShowCycleSpinner() = runBlocking {
+        testLifecycleOwner.handleLifecycleEvent(Lifecycle.Event.ON_START)
+        delay(100)
 
         assertThat(spinner.visibility).isEqualTo(View.VISIBLE)
     }
diff --git a/tests/spa_unit/src/com/android/settings/datausage/lib/NetworkCycleDataRepositoryTest.kt b/tests/spa_unit/src/com/android/settings/datausage/lib/NetworkCycleDataRepositoryTest.kt
new file mode 100644
index 0000000..fb5e820
--- /dev/null
+++ b/tests/spa_unit/src/com/android/settings/datausage/lib/NetworkCycleDataRepositoryTest.kt
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2023 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.datausage.lib
+
+import android.app.usage.NetworkStats.Bucket
+import android.app.usage.NetworkStatsManager
+import android.content.Context
+import android.net.NetworkPolicy
+import android.net.NetworkTemplate
+import android.text.format.DateUtils
+import android.util.Range
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.google.common.truth.Truth.assertThat
+import java.time.Instant
+import java.time.ZoneId
+import java.time.ZonedDateTime
+import kotlinx.coroutines.test.runTest
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.eq
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.whenever
+
+@RunWith(AndroidJUnit4::class)
+class NetworkCycleDataRepositoryTest {
+    private val mockNetworkStatsManager = mock<NetworkStatsManager> {
+        on { querySummaryForDevice(any(), eq(CYCLE1_START_TIME), eq(CYCLE1_END_TIME)) } doReturn
+            CYCLE1_BUCKET
+
+        on {
+            querySummaryForDevice(
+                any(),
+                eq(CYCLE2_END_TIME - DateUtils.WEEK_IN_MILLIS * 4),
+                eq(CYCLE2_END_TIME),
+            )
+        } doReturn CYCLE2_BUCKET
+
+        on { querySummaryForDevice(any(), eq(CYCLE3_START_TIME), eq(CYCLE4_END_TIME)) } doReturn
+            CYCLE3_AND_4_BUCKET
+
+        on { querySummaryForDevice(any(), eq(CYCLE3_START_TIME), eq(CYCLE3_END_TIME)) } doReturn
+            CYCLE3_BUCKET
+
+        on { querySummaryForDevice(any(), eq(CYCLE4_START_TIME), eq(CYCLE4_END_TIME)) } doReturn
+            CYCLE4_BUCKET
+    }
+
+    private val context: Context = spy(ApplicationProvider.getApplicationContext()) {
+        on { getSystemService(NetworkStatsManager::class.java) } doReturn mockNetworkStatsManager
+    }
+
+    private val template = mock<NetworkTemplate>()
+
+    private val repository = spy(NetworkCycleDataRepository(context, template))
+
+    @Test
+    fun loadCycles_byPolicy() = runTest {
+        val policy = mock<NetworkPolicy> {
+            on { cycleIterator() } doReturn listOf(
+                Range(zonedDateTime(CYCLE1_START_TIME), zonedDateTime(CYCLE1_END_TIME))
+            ).iterator()
+        }
+        doReturn(policy).whenever(repository).getPolicy()
+
+        val cycles = repository.loadCycles()
+
+        assertThat(cycles).containsExactly(NetworkUsageData(startTime = 1, endTime = 2, usage = 11))
+    }
+
+    @Test
+    fun loadCycles_asFourWeeks() = runTest {
+        doReturn(null).whenever(repository).getPolicy()
+        doReturn(Range(CYCLE2_START_TIME, CYCLE2_END_TIME)).whenever(repository).getTimeRange()
+
+        val cycles = repository.loadCycles()
+
+        assertThat(cycles).containsExactly(
+            NetworkUsageData(
+                startTime = CYCLE2_END_TIME - DateUtils.WEEK_IN_MILLIS * 4,
+                endTime = CYCLE2_END_TIME,
+                usage = 22,
+            ),
+        )
+    }
+
+    @Test
+    fun querySummary() = runTest {
+        val summary = repository.querySummary(CYCLE3_START_TIME, CYCLE4_END_TIME)
+
+        assertThat(summary).isEqualTo(
+            NetworkCycleChartData(
+                total = NetworkUsageData(
+                    startTime = CYCLE3_START_TIME,
+                    endTime = CYCLE4_END_TIME,
+                    usage = 77,
+                ),
+                dailyUsage = listOf(
+                    NetworkUsageData(
+                        startTime = CYCLE3_START_TIME,
+                        endTime = CYCLE3_END_TIME,
+                        usage = 33,
+                    ),
+                    NetworkUsageData(
+                        startTime = CYCLE4_START_TIME,
+                        endTime = CYCLE4_END_TIME,
+                        usage = 44,
+                    ),
+                ),
+            )
+        )
+    }
+
+    private fun zonedDateTime(epochMilli: Long): ZonedDateTime? =
+        ZonedDateTime.ofInstant(Instant.ofEpochMilli(epochMilli), ZoneId.systemDefault())
+
+    private companion object {
+        const val CYCLE1_START_TIME = 1L
+        const val CYCLE1_END_TIME = 2L
+        val CYCLE1_BUCKET = mock<Bucket> {
+            on { rxBytes } doReturn 1
+            on { txBytes } doReturn 10
+        }
+
+        const val CYCLE2_START_TIME = 1695555555000L
+        const val CYCLE2_END_TIME = 1695566666000L
+        val CYCLE2_BUCKET = mock<Bucket> {
+            on { rxBytes } doReturn 2
+            on { txBytes } doReturn 20
+        }
+
+        const val CYCLE3_START_TIME = 1695555555000L
+        const val CYCLE3_END_TIME = CYCLE3_START_TIME + DateUtils.DAY_IN_MILLIS
+        val CYCLE3_BUCKET = mock<Bucket> {
+            on { rxBytes } doReturn 3
+            on { txBytes } doReturn 30
+        }
+
+        const val CYCLE4_START_TIME = CYCLE3_END_TIME
+        const val CYCLE4_END_TIME = CYCLE4_START_TIME + DateUtils.DAY_IN_MILLIS
+        val CYCLE4_BUCKET = mock<Bucket> {
+            on { rxBytes } doReturn 4
+            on { txBytes } doReturn 40
+        }
+
+        val CYCLE3_AND_4_BUCKET = mock<Bucket> {
+            on { rxBytes } doReturn 7
+            on { txBytes } doReturn 70
+        }
+    }
+}
diff --git a/tests/spa_unit/src/com/android/settings/network/apn/ApnEditPageProviderTest.kt b/tests/spa_unit/src/com/android/settings/network/apn/ApnEditPageProviderTest.kt
index 0d2dcef..d744181 100644
--- a/tests/spa_unit/src/com/android/settings/network/apn/ApnEditPageProviderTest.kt
+++ b/tests/spa_unit/src/com/android/settings/network/apn/ApnEditPageProviderTest.kt
@@ -59,6 +59,7 @@
         context.resources.getStringArray(R.array.apn_protocol_entries).toList()
     private val bearer = context.resources.getString(R.string.bearer)
     private val bearerOptions = context.resources.getStringArray(R.array.bearer_entries).toList()
+    private val passwordTitle = context.resources.getString(R.string.apn_password)
     private val apnData = mutableStateOf(
         ApnData(
             name = apnName,
@@ -241,4 +242,16 @@
         composeTestRule.onNode(hasText(bearerOptions[0]) and isFocused(), true).assertIsDisplayed()
         composeTestRule.onNode(hasText(bearerOptions[1]) and isFocused(), true).assertDoesNotExist()
     }
+
+    @Test
+    fun password_displayed() {
+        composeTestRule.setContent {
+            ApnPage(remember {
+                apnData
+            })
+        }
+        composeTestRule.onRoot().onChild().onChildAt(0)
+            .performScrollToNode(hasText(passwordTitle, true))
+        composeTestRule.onNodeWithText(passwordTitle, true).assertIsDisplayed()
+    }
 }
\ No newline at end of file
diff --git a/tests/spa_unit/src/com/android/settings/spa/app/appcompat/UserAspectRatioAppPreferenceTest.kt b/tests/spa_unit/src/com/android/settings/spa/app/appcompat/UserAspectRatioAppPreferenceTest.kt
index 9a17032..dd5b929 100644
--- a/tests/spa_unit/src/com/android/settings/spa/app/appcompat/UserAspectRatioAppPreferenceTest.kt
+++ b/tests/spa_unit/src/com/android/settings/spa/app/appcompat/UserAspectRatioAppPreferenceTest.kt
@@ -17,10 +17,10 @@
 package com.android.settings.spa.app.appcompat
 
 import android.content.Context
-import android.content.pm.ActivityInfo
 import android.content.pm.ApplicationInfo
+import android.content.pm.LauncherActivityInfo
+import android.content.pm.LauncherApps
 import android.content.pm.PackageManager
-import android.content.pm.ResolveInfo
 import android.provider.DeviceConfig.NAMESPACE_WINDOW_MANAGER
 import android.view.WindowManager.PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_OVERRIDE
 import androidx.compose.runtime.CompositionLocalProvider
@@ -46,9 +46,9 @@
 import org.junit.Rule
 import org.junit.Test
 import org.junit.runner.RunWith
+import org.mockito.ArgumentMatchers.anyString
 import org.mockito.Mock
 import org.mockito.Mockito.any
-import org.mockito.Mockito.anyInt
 import org.mockito.MockitoSession
 import org.mockito.Spy
 import org.mockito.quality.Strictness
@@ -76,6 +76,12 @@
     @Mock
     private lateinit var packageManager: PackageManager
 
+    @Mock
+    private lateinit var launcherApps: LauncherApps
+
+    @Mock
+    private lateinit var launcherActivities: List<LauncherActivityInfo>
+
     @Before
     fun setUp() {
         mockSession = ExtendedMockito.mockitoSession()
@@ -86,6 +92,8 @@
             .startMocking()
         whenever(context.resources).thenReturn(resources)
         whenever(context.packageManager).thenReturn(packageManager)
+        whenever(context.getSystemService(Context.LAUNCHER_APPS_SERVICE)).thenReturn(launcherApps)
+        whenever(launcherApps.getActivityList(anyString(), any())).thenReturn(launcherActivities)
         // True is ignored but need this here or getBoolean will complain null object
         mockProperty(PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_OVERRIDE, true)
     }
@@ -107,6 +115,8 @@
 
     @Test
     fun whenCannotDisplayAspectRatioUi_notDisplayed() {
+        whenever(launcherActivities.isEmpty()).thenReturn(true)
+
         setContent()
 
         composeTestRule.onRoot().assertIsNotDisplayed()
@@ -115,8 +125,7 @@
     @Test
     fun whenCanDisplayAspectRatioUiAndConfigFalse_notDisplayed() {
         setConfig(false)
-        whenever(packageManager.queryIntentActivities(any(), anyInt()))
-            .thenReturn(listOf(RESOLVE_INFO))
+        whenever(launcherActivities.isEmpty()).thenReturn(false)
 
         setContent()
 
@@ -127,6 +136,8 @@
     fun whenCannotDisplayAspectRatioUiAndConfigTrue_notDisplayed() {
         setConfig(true)
 
+        whenever(launcherActivities.isEmpty()).thenReturn(true)
+
         setContent()
 
         composeTestRule.onRoot().assertIsNotDisplayed()
@@ -135,9 +146,7 @@
     @Test
     fun whenCanDisplayAspectRatioUiAndConfigTrue_Displayed() {
         setConfig(true)
-        whenever(packageManager.queryIntentActivities(any(), anyInt()))
-            .thenReturn(listOf(RESOLVE_INFO))
-
+        whenever(launcherActivities.isEmpty()).thenReturn(false)
         setContent()
 
         composeTestRule.onNode(
@@ -151,8 +160,7 @@
     @Test
     fun onClick_startActivity() {
         setConfig(true)
-        whenever(packageManager.queryIntentActivities(any(), anyInt()))
-            .thenReturn(listOf(RESOLVE_INFO))
+        whenever(launcherActivities.isEmpty()).thenReturn(false)
 
         setContent()
         composeTestRule.onRoot().performClick()
@@ -196,10 +204,5 @@
             packageName = PACKAGE_NAME
             uid = UID
         }
-        private val RESOLVE_INFO = ResolveInfo().apply {
-            activityInfo = ActivityInfo().apply {
-                packageName = PACKAGE_NAME
-            }
-        }
     }
 }
\ No newline at end of file
diff --git a/tests/unit/Android.bp b/tests/unit/Android.bp
index 196b809..4f044c7 100644
--- a/tests/unit/Android.bp
+++ b/tests/unit/Android.bp
@@ -28,6 +28,7 @@
         "truth-prebuilt",
         "kotlinx_coroutines_test",
         "flag-junit",
+        "Settings-testutils2",
         // Don't add SettingsLib libraries here - you can use them directly as they are in the
         // instrumented Settings app.
     ],
diff --git a/tests/unit/src/com/android/settings/applications/appcompat/UserAspectRatioManagerTest.java b/tests/unit/src/com/android/settings/applications/appcompat/UserAspectRatioManagerTest.java
index 6cc386b..81078e8 100644
--- a/tests/unit/src/com/android/settings/applications/appcompat/UserAspectRatioManagerTest.java
+++ b/tests/unit/src/com/android/settings/applications/appcompat/UserAspectRatioManagerTest.java
@@ -32,15 +32,18 @@
 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
 
 import android.content.Context;
-import android.content.pm.ActivityInfo;
 import android.content.pm.ApplicationInfo;
+import android.content.pm.LauncherActivityInfo;
+import android.content.pm.LauncherApps;
 import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
 import android.provider.DeviceConfig;
 
@@ -55,6 +58,8 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import java.util.List;
+
 /**
  * To run this test: atest SettingsUnitTests:UserAspectRatioManagerTest
  */
@@ -67,14 +72,23 @@
     private String mOriginalSettingsFlag;
     private String mOriginalFullscreenFlag;
     private String mPackageName = "com.test.mypackage";
-
+    private LauncherApps mLauncherApps;
+    private List<LauncherActivityInfo> mLauncherActivities;
     @Before
     public void setUp() {
         mContext = spy(ApplicationProvider.getApplicationContext());
         mResources = spy(mContext.getResources());
-        mUtils = new UserAspectRatioManager(mContext);
+        mLauncherApps = mock(LauncherApps.class);
+        mLauncherActivities = mock(List.class);
+        mUtils = new UserAspectRatioManager(mContext) {
+            @Override
+            LauncherApps getLauncherApps() {
+                return mLauncherApps;
+            }
+        };
 
         when(mContext.getResources()).thenReturn(mResources);
+        doReturn(mLauncherActivities).when(mLauncherApps).getActivityList(anyString(), any());
 
         mOriginalSettingsFlag = DeviceConfig.getProperty(
                 DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_ENABLE_USER_ASPECT_RATIO_SETTINGS);
@@ -98,13 +112,14 @@
     public void testCanDisplayAspectRatioUi() {
         final ApplicationInfo canDisplay = new ApplicationInfo();
         canDisplay.packageName = "com.app.candisplay";
-        addResolveInfoLauncherEntry(canDisplay.packageName);
 
+        doReturn(false).when(mLauncherActivities).isEmpty();
         assertTrue(mUtils.canDisplayAspectRatioUi(canDisplay));
 
         final ApplicationInfo noLauncherEntry = new ApplicationInfo();
         noLauncherEntry.packageName = "com.app.nolauncherentry";
 
+        doReturn(true).when(mLauncherActivities).isEmpty();
         assertFalse(mUtils.canDisplayAspectRatioUi(noLauncherEntry));
     }
 
@@ -112,10 +127,10 @@
     public void testCanDisplayAspectRatioUi_hasLauncher_propertyFalse_returnFalse()
             throws PackageManager.NameNotFoundException {
         mockProperty(PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_OVERRIDE, false);
+        doReturn(true).when(mLauncherActivities).isEmpty();
 
         final ApplicationInfo canDisplay = new ApplicationInfo();
         canDisplay.packageName = mPackageName;
-        addResolveInfoLauncherEntry(canDisplay.packageName);
 
         assertFalse(mUtils.canDisplayAspectRatioUi(canDisplay));
     }
@@ -124,6 +139,7 @@
     public void testCanDisplayAspectRatioUi_noLauncher_propertyTrue_returnFalse()
             throws PackageManager.NameNotFoundException {
         mockProperty(PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_OVERRIDE, true);
+        doReturn(true).when(mLauncherActivities).isEmpty();
 
         final ApplicationInfo noLauncherEntry = new ApplicationInfo();
         noLauncherEntry.packageName = mPackageName;
@@ -267,12 +283,4 @@
         DeviceConfig.setProperty(DeviceConfig.NAMESPACE_WINDOW_MANAGER,
                 KEY_ENABLE_USER_ASPECT_RATIO_FULLSCREEN, enabled, makeDefault);
     }
-
-    private void addResolveInfoLauncherEntry(String packageName) {
-        final ResolveInfo resolveInfo = mock(ResolveInfo.class);
-        final ActivityInfo activityInfo = mock(ActivityInfo.class);
-        activityInfo.packageName = packageName;
-        resolveInfo.activityInfo = activityInfo;
-        mUtils.addInfoHasLauncherEntry(resolveInfo);
-    }
 }
diff --git a/tests/unit/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerJUnitTest.java b/tests/unit/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerJUnitTest.java
index ae35431..4aa38ae 100644
--- a/tests/unit/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerJUnitTest.java
+++ b/tests/unit/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerJUnitTest.java
@@ -18,12 +18,14 @@
 
 import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.ANGLE_DRIVER_SUFFIX;
 import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.Injector;
+import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_DEBUG_ANGLE_DEVELOPER_OPTION;
 import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_PERSISTENT_GRAPHICS_EGL;
 import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_RO_GFX_ANGLE_SUPPORTED;
 
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.when;
 
@@ -98,6 +100,8 @@
         }
 
         mContext = ApplicationProvider.getApplicationContext();
+        when(mSystemPropertiesMock.getBoolean(eq(PROPERTY_DEBUG_ANGLE_DEVELOPER_OPTION),
+                                              anyBoolean())).thenReturn(true);
 
         // Construct a GraphicsDriverEnableAngleAsSystemDriverController with two Overrides:
         // 1) Override the mSystemProperties with mSystemPropertiesMock,
diff --git a/tests/unit/src/com/android/settings/fingerprint2/domain/interactor/FingerprintManagerInteractorTest.kt b/tests/unit/src/com/android/settings/fingerprint2/domain/interactor/FingerprintManagerInteractorTest.kt
index de2c494..f0d0a0a 100644
--- a/tests/unit/src/com/android/settings/fingerprint2/domain/interactor/FingerprintManagerInteractorTest.kt
+++ b/tests/unit/src/com/android/settings/fingerprint2/domain/interactor/FingerprintManagerInteractorTest.kt
@@ -26,12 +26,12 @@
 import android.os.Handler
 import androidx.test.core.app.ApplicationProvider
 import com.android.settings.biometrics.GatekeeperPasswordProvider
-import com.android.settings.biometrics.fingerprint2.domain.interactor.FingerprintManagerInteractor
+import com.android.settings.biometrics.fingerprint2.shared.domain.interactor.FingerprintManagerInteractor
 import com.android.settings.biometrics.fingerprint2.domain.interactor.FingerprintManagerInteractorImpl
+import com.android.settings.biometrics.fingerprint2.shared.model.EnrollReason
 import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintAuthAttemptViewModel
 import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintViewModel
-import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.EnrollReason.FindSensor
-import com.android.settings.biometrics.fingerprint2.ui.enrollment.viewmodel.FingerEnrollStateViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerEnrollStateViewModel
 import com.android.settings.password.ChooseLockSettingsHelper
 import com.google.common.truth.Truth.assertThat
 import kotlinx.coroutines.cancelAndJoin
@@ -283,7 +283,7 @@
     testScope.runTest {
       val token = byteArrayOf(5, 3, 2)
       var result: FingerEnrollStateViewModel? = null
-      val job = launch { underTest.enroll(token, FindSensor).collect { result = it } }
+      val job = launch { underTest.enroll(token, EnrollReason.FindSensor).collect { result = it } }
       val enrollCallback: ArgumentCaptor<FingerprintManager.EnrollmentCallback> = argumentCaptor()
       runCurrent()
 
@@ -307,7 +307,7 @@
     testScope.runTest {
       val token = byteArrayOf(5, 3, 2)
       var result: FingerEnrollStateViewModel? = null
-      val job = launch { underTest.enroll(token, FindSensor).collect { result = it } }
+      val job = launch { underTest.enroll(token, EnrollReason.FindSensor).collect { result = it } }
       val enrollCallback: ArgumentCaptor<FingerprintManager.EnrollmentCallback> = argumentCaptor()
       runCurrent()
 
@@ -331,7 +331,7 @@
     testScope.runTest {
       val token = byteArrayOf(5, 3, 2)
       var result: FingerEnrollStateViewModel? = null
-      val job = launch { underTest.enroll(token, FindSensor).collect { result = it } }
+      val job = launch { underTest.enroll(token, EnrollReason.FindSensor).collect { result = it } }
       val enrollCallback: ArgumentCaptor<FingerprintManager.EnrollmentCallback> = argumentCaptor()
       runCurrent()
 
diff --git a/tests/unit/src/com/android/settings/fingerprint2/settings/viewmodel/FingerprintSettingsNavigationViewModelTest.kt b/tests/unit/src/com/android/settings/fingerprint2/ui/settings/FingerprintSettingsNavigationViewModelTest.kt
similarity index 94%
rename from tests/unit/src/com/android/settings/fingerprint2/settings/viewmodel/FingerprintSettingsNavigationViewModelTest.kt
rename to tests/unit/src/com/android/settings/fingerprint2/ui/settings/FingerprintSettingsNavigationViewModelTest.kt
index 6bb8a16..d4dbec5 100644
--- a/tests/unit/src/com/android/settings/fingerprint2/settings/viewmodel/FingerprintSettingsNavigationViewModelTest.kt
+++ b/tests/unit/src/com/android/settings/fingerprint2/ui/settings/FingerprintSettingsNavigationViewModelTest.kt
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.settings.fingerprint2.settings.viewmodel
+package com.android.settings.fingerprint2.ui.settings
 
 import androidx.arch.core.executor.testing.InstantTaskExecutorRule
 import com.android.settings.biometrics.BiometricEnrollBase
@@ -26,7 +26,7 @@
 import com.android.settings.biometrics.fingerprint2.ui.settings.viewmodel.LaunchConfirmDeviceCredential
 import com.android.settings.biometrics.fingerprint2.ui.settings.viewmodel.NextStepViewModel
 import com.android.settings.biometrics.fingerprint2.ui.settings.viewmodel.ShowSettings
-import com.android.settings.fingerprint2.domain.interactor.FakeFingerprintManagerInteractor
+import com.android.settings.testutils2.FakeFingerprintManagerInteractor
 import com.google.common.truth.Truth.assertThat
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
@@ -133,22 +133,6 @@
     }
 
   @Test
-  fun firstEnrollment_fails() =
-    testScope.runTest {
-      fakeFingerprintManagerInteractor.enrolledFingerprintsInternal = mutableListOf()
-
-      var nextStep: NextStepViewModel? = null
-      val job = launch { underTest.nextStep.collect { nextStep = it } }
-
-      underTest.onConfirmDevice(true, 10L)
-      underTest.onEnrollFirstFailure("We failed!!")
-      runCurrent()
-
-      assertThat(nextStep).isInstanceOf(FinishSettings::class.java)
-      job.cancel()
-    }
-
-  @Test
   fun firstEnrollment_failsWithReason() =
     testScope.runTest {
       fakeFingerprintManagerInteractor.enrolledFingerprintsInternal = mutableListOf()
diff --git a/tests/unit/src/com/android/settings/fingerprint2/settings/viewmodel/FingerprintSettingsViewModelTest.kt b/tests/unit/src/com/android/settings/fingerprint2/ui/settings/FingerprintSettingsViewModelTest.kt
similarity index 86%
rename from tests/unit/src/com/android/settings/fingerprint2/settings/viewmodel/FingerprintSettingsViewModelTest.kt
rename to tests/unit/src/com/android/settings/fingerprint2/ui/settings/FingerprintSettingsViewModelTest.kt
index e8a4d55..fb1d05a 100644
--- a/tests/unit/src/com/android/settings/fingerprint2/settings/viewmodel/FingerprintSettingsViewModelTest.kt
+++ b/tests/unit/src/com/android/settings/fingerprint2/ui/settings/FingerprintSettingsViewModelTest.kt
@@ -14,18 +14,18 @@
  * limitations under the License.
  */
 
-package com.android.settings.fingerprint2.settings.viewmodel
+package com.android.settings.fingerprint2.ui.settings
 
-import android.hardware.biometrics.SensorProperties
-import android.hardware.fingerprint.FingerprintSensorProperties
-import android.hardware.fingerprint.FingerprintSensorPropertiesInternal
 import androidx.arch.core.executor.testing.InstantTaskExecutorRule
 import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintAuthAttemptViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintSensorPropertyViewModel
 import com.android.settings.biometrics.fingerprint2.shared.model.FingerprintViewModel
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorStrength
+import com.android.settings.biometrics.fingerprint2.shared.model.SensorType
 import com.android.settings.biometrics.fingerprint2.ui.settings.viewmodel.FingerprintSettingsNavigationViewModel
 import com.android.settings.biometrics.fingerprint2.ui.settings.viewmodel.FingerprintSettingsViewModel
 import com.android.settings.biometrics.fingerprint2.ui.settings.viewmodel.PreferenceViewModel
-import com.android.settings.fingerprint2.domain.interactor.FakeFingerprintManagerInteractor
+import com.android.settings.testutils2.FakeFingerprintManagerInteractor
 import com.google.common.truth.Truth.assertThat
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.flow.collectLatest
@@ -95,16 +95,12 @@
   @Test
   fun authenticate_DoesNotRun_ifOptical() =
     testScope.runTest {
-      fakeFingerprintManagerInteractor.sensorProps =
-        listOf(
-          FingerprintSensorPropertiesInternal(
-            0 /* sensorId */,
-            SensorProperties.STRENGTH_STRONG,
-            5 /* maxEnrollmentsPerUser */,
-            emptyList() /* ComponentInfoInternal */,
-            FingerprintSensorProperties.TYPE_UDFPS_OPTICAL,
-            true /* resetLockoutRequiresHardwareAuthToken */
-          )
+      fakeFingerprintManagerInteractor.sensorProp =
+        FingerprintSensorPropertyViewModel(
+          0 /* sensorId */,
+          SensorStrength.Strong,
+          5 /* maxEnrollmentsPerUser */,
+          SensorType.Optical,
         )
       fakeFingerprintManagerInteractor.enrolledFingerprintsInternal =
         mutableListOf(FingerprintViewModel("a", 1, 3L))
@@ -135,16 +131,12 @@
   @Test
   fun authenticate_DoesNotRun_ifUltrasonic() =
     testScope.runTest {
-      fakeFingerprintManagerInteractor.sensorProps =
-        listOf(
-          FingerprintSensorPropertiesInternal(
-            0 /* sensorId */,
-            SensorProperties.STRENGTH_STRONG,
-            5 /* maxEnrollmentsPerUser */,
-            emptyList() /* ComponentInfoInternal */,
-            FingerprintSensorProperties.TYPE_UDFPS_ULTRASONIC,
-            true /* resetLockoutRequiresHardwareAuthToken */
-          )
+      fakeFingerprintManagerInteractor.sensorProp =
+        FingerprintSensorPropertyViewModel(
+          0 /* sensorId */,
+          SensorStrength.Strong,
+          5 /* maxEnrollmentsPerUser */,
+          SensorType.Ultrasonic,
         )
       fakeFingerprintManagerInteractor.enrolledFingerprintsInternal =
         mutableListOf(FingerprintViewModel("a", 1, 3L))
@@ -173,16 +165,12 @@
   @Test
   fun authenticate_DoesRun_ifNotUdfps() =
     testScope.runTest {
-      fakeFingerprintManagerInteractor.sensorProps =
-        listOf(
-          FingerprintSensorPropertiesInternal(
-            0 /* sensorId */,
-            SensorProperties.STRENGTH_STRONG,
-            5 /* maxEnrollmentsPerUser */,
-            emptyList() /* ComponentInfoInternal */,
-            FingerprintSensorProperties.TYPE_POWER_BUTTON,
-            true /* resetLockoutRequiresHardwareAuthToken */
-          )
+      fakeFingerprintManagerInteractor.sensorProp =
+        FingerprintSensorPropertyViewModel(
+          0 /* sensorId */,
+          SensorStrength.Strong,
+          5 /* maxEnrollmentsPerUser */,
+          SensorType.SFPS
         )
       fakeFingerprintManagerInteractor.enrolledFingerprintsInternal =
         mutableListOf(FingerprintViewModel("a", 1, 3L))
@@ -383,16 +371,12 @@
     }
 
   private fun setupAuth(): MutableList<FingerprintViewModel> {
-    fakeFingerprintManagerInteractor.sensorProps =
-      listOf(
-        FingerprintSensorPropertiesInternal(
-          0 /* sensorId */,
-          SensorProperties.STRENGTH_STRONG,
-          5 /* maxEnrollmentsPerUser */,
-          emptyList() /* ComponentInfoInternal */,
-          FingerprintSensorProperties.TYPE_POWER_BUTTON,
-          true /* resetLockoutRequiresHardwareAuthToken */
-        )
+    fakeFingerprintManagerInteractor.sensorProp =
+      FingerprintSensorPropertyViewModel(
+        0 /* sensorId */,
+        SensorStrength.Strong,
+        5 /* maxEnrollmentsPerUser */,
+        SensorType.SFPS
       )
     val fingerprints =
       mutableListOf(FingerprintViewModel("a", 1, 3L), FingerprintViewModel("b", 2, 5L))
diff --git a/tests/unit/src/com/android/settings/localepicker/TermsOfAddressFeminineControllerTest.java b/tests/unit/src/com/android/settings/localepicker/TermsOfAddressFeminineControllerTest.java
new file mode 100644
index 0000000..c04e5f9
--- /dev/null
+++ b/tests/unit/src/com/android/settings/localepicker/TermsOfAddressFeminineControllerTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2023 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.localepicker;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.spy;
+
+import android.content.Context;
+import android.os.Looper;
+
+import com.android.settings.widget.TickButtonPreference;
+
+import androidx.preference.PreferenceManager;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceCategory;
+import androidx.preference.PreferenceScreen;
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class TermsOfAddressFeminineControllerTest {
+
+    private static final String KEY_CATEGORY_TERMS_OF_ADDRESS = "key_category_terms_of_address";
+    private static final String KEY_FEMININE = "key_terms_of_address_feminine";
+    private static final String KEY_MASCULINE = "key_terms_of_address_masculine";
+    private static final String KEY_NEUTRAL = "key_terms_of_address_neutral";
+    private static final String KEY_NOT_SPECIFIED = "key_terms_of_address_not_specified";
+
+    private Context mContext;
+    private PreferenceManager mPreferenceManager;
+    private PreferenceCategory mPreferenceCategory;
+    private PreferenceScreen mPreferenceScreen;
+    private TermsOfAddressFeminineController mController;
+    private TickButtonPreference mFemininePreference;
+    private TickButtonPreference mMasculinePreference;
+    private TickButtonPreference mNotSpecifiedPreference;
+    private TickButtonPreference mNeutralPreference;
+
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(ApplicationProvider.getApplicationContext());
+
+        if (Looper.myLooper() == null) {
+            Looper.prepare();
+        }
+
+        mPreferenceManager = new PreferenceManager(mContext);
+        mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
+        mPreferenceCategory = new PreferenceCategory(mContext);
+        mPreferenceCategory.setKey(KEY_CATEGORY_TERMS_OF_ADDRESS);
+        mNotSpecifiedPreference = new TickButtonPreference(mContext);
+        mNotSpecifiedPreference.setKey(KEY_NOT_SPECIFIED);
+        mFemininePreference = new TickButtonPreference(mContext);
+        mFemininePreference.setKey(KEY_FEMININE);
+        mMasculinePreference = new TickButtonPreference(mContext);
+        mMasculinePreference.setKey(KEY_MASCULINE);
+        mNeutralPreference = new TickButtonPreference(mContext);
+        mNeutralPreference.setKey(KEY_NEUTRAL);
+        mPreferenceScreen.addPreference(mPreferenceCategory);
+        mPreferenceScreen.addPreference(mNotSpecifiedPreference);
+        mPreferenceScreen.addPreference(mFemininePreference);
+        mPreferenceScreen.addPreference(mMasculinePreference);
+        mPreferenceScreen.addPreference(mNeutralPreference);
+        mController = new TermsOfAddressFeminineController(mContext, KEY_FEMININE);
+        mController.displayPreference(mPreferenceScreen);
+    }
+
+    @Test
+    public void displayPreference_setGrammaticalGenderIsFeminine_FeminineIsSelected() {
+        TickButtonPreference selectedPreference =
+                (TickButtonPreference) mPreferenceScreen.getPreference(2);
+        TickButtonPreference pref = (TickButtonPreference) mPreferenceScreen.getPreference(1);
+
+        selectedPreference.performClick();
+
+        assertThat(selectedPreference.getKey()).isEqualTo(KEY_FEMININE);
+        assertThat(selectedPreference.isSelected()).isTrue();
+        assertThat(pref.isSelected()).isFalse();
+    }
+}
diff --git a/tests/unit/src/com/android/settings/localepicker/TermsOfAddressMasculineControllerTest.java b/tests/unit/src/com/android/settings/localepicker/TermsOfAddressMasculineControllerTest.java
new file mode 100644
index 0000000..c2298be
--- /dev/null
+++ b/tests/unit/src/com/android/settings/localepicker/TermsOfAddressMasculineControllerTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2023 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.localepicker;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.spy;
+
+import android.content.Context;
+import android.os.Looper;
+
+import com.android.settings.widget.TickButtonPreference;
+
+import androidx.preference.PreferenceManager;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceCategory;
+import androidx.preference.PreferenceScreen;
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class TermsOfAddressMasculineControllerTest {
+
+    private static final String KEY_CATEGORY_TERMS_OF_ADDRESS = "key_category_terms_of_address";
+    private static final String KEY_FEMININE = "key_terms_of_address_feminine";
+    private static final String KEY_MASCULINE = "key_terms_of_address_masculine";
+    private static final String KEY_NEUTRAL = "key_terms_of_address_neutral";
+    private static final String KEY_NOT_SPECIFIED = "key_terms_of_address_not_specified";
+
+    private Context mContext;
+    private PreferenceManager mPreferenceManager;
+    private PreferenceCategory mPreferenceCategory;
+    private PreferenceScreen mPreferenceScreen;
+    private TermsOfAddressMasculineController mController;
+    private TickButtonPreference mFemininePreference;
+    private TickButtonPreference mMasculinePreference;
+    private TickButtonPreference mNotSpecifiedPreference;
+    private TickButtonPreference mNeutralPreference;
+
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(ApplicationProvider.getApplicationContext());
+
+        if (Looper.myLooper() == null) {
+            Looper.prepare();
+        }
+
+        mPreferenceManager = new PreferenceManager(mContext);
+        mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
+        mPreferenceCategory = new PreferenceCategory(mContext);
+        mPreferenceCategory.setKey(KEY_CATEGORY_TERMS_OF_ADDRESS);
+        mNotSpecifiedPreference = new TickButtonPreference(mContext);
+        mNotSpecifiedPreference.setKey(KEY_NOT_SPECIFIED);
+        mFemininePreference = new TickButtonPreference(mContext);
+        mFemininePreference.setKey(KEY_FEMININE);
+        mMasculinePreference = new TickButtonPreference(mContext);
+        mMasculinePreference.setKey(KEY_MASCULINE);
+        mNeutralPreference = new TickButtonPreference(mContext);
+        mNeutralPreference.setKey(KEY_NEUTRAL);
+        mPreferenceScreen.addPreference(mPreferenceCategory);
+        mPreferenceScreen.addPreference(mNotSpecifiedPreference);
+        mPreferenceScreen.addPreference(mFemininePreference);
+        mPreferenceScreen.addPreference(mMasculinePreference);
+        mPreferenceScreen.addPreference(mNeutralPreference);
+        mController = new TermsOfAddressMasculineController(mContext, KEY_MASCULINE);
+        mController.displayPreference(mPreferenceScreen);
+    }
+
+    @Test
+    public void displayPreference_setGrammaticalGenderIsMasculine_MasculineIsSelected() {
+        TickButtonPreference selectedPreference =
+                (TickButtonPreference) mPreferenceScreen.getPreference(3);
+        TickButtonPreference pref = (TickButtonPreference) mPreferenceScreen.getPreference(1);
+
+        selectedPreference.performClick();
+
+        assertThat(selectedPreference.getKey()).isEqualTo(KEY_MASCULINE);
+        assertThat(selectedPreference.isSelected()).isTrue();
+        assertThat(pref.isSelected()).isFalse();
+    }
+}
diff --git a/tests/unit/src/com/android/settings/localepicker/TermsOfAddressNeutralControllerTest.java b/tests/unit/src/com/android/settings/localepicker/TermsOfAddressNeutralControllerTest.java
new file mode 100644
index 0000000..fb207fc
--- /dev/null
+++ b/tests/unit/src/com/android/settings/localepicker/TermsOfAddressNeutralControllerTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2023 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.localepicker;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.spy;
+
+import android.content.Context;
+import android.os.Looper;
+
+import com.android.settings.widget.TickButtonPreference;
+
+import androidx.preference.PreferenceManager;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceCategory;
+import androidx.preference.PreferenceScreen;
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class TermsOfAddressNeutralControllerTest {
+
+    private static final String KEY_CATEGORY_TERMS_OF_ADDRESS = "key_category_terms_of_address";
+    private static final String KEY_FEMININE = "key_terms_of_address_feminine";
+    private static final String KEY_MASCULINE = "key_terms_of_address_masculine";
+    private static final String KEY_NEUTRAL = "key_terms_of_address_neutral";
+    private static final String KEY_NOT_SPECIFIED = "key_terms_of_address_not_specified";
+
+    private Context mContext;
+    private PreferenceManager mPreferenceManager;
+    private PreferenceCategory mPreferenceCategory;
+    private PreferenceScreen mPreferenceScreen;
+    private TermsOfAddressNeutralController mController;
+    private TickButtonPreference mFemininePreference;
+    private TickButtonPreference mMasculinePreference;
+    private TickButtonPreference mNotSpecifiedPreference;
+    private TickButtonPreference mNeutralPreference;
+
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(ApplicationProvider.getApplicationContext());
+
+        if (Looper.myLooper() == null) {
+            Looper.prepare();
+        }
+
+        mPreferenceManager = new PreferenceManager(mContext);
+        mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
+        mPreferenceCategory = new PreferenceCategory(mContext);
+        mPreferenceCategory.setKey(KEY_CATEGORY_TERMS_OF_ADDRESS);
+        mNotSpecifiedPreference = new TickButtonPreference(mContext);
+        mNotSpecifiedPreference.setKey(KEY_NOT_SPECIFIED);
+        mFemininePreference = new TickButtonPreference(mContext);
+        mFemininePreference.setKey(KEY_FEMININE);
+        mMasculinePreference = new TickButtonPreference(mContext);
+        mMasculinePreference.setKey(KEY_MASCULINE);
+        mNeutralPreference = new TickButtonPreference(mContext);
+        mNeutralPreference.setKey(KEY_NEUTRAL);
+        mPreferenceScreen.addPreference(mPreferenceCategory);
+        mPreferenceScreen.addPreference(mNotSpecifiedPreference);
+        mPreferenceScreen.addPreference(mFemininePreference);
+        mPreferenceScreen.addPreference(mMasculinePreference);
+        mPreferenceScreen.addPreference(mNeutralPreference);
+        mController = new TermsOfAddressNeutralController(mContext, KEY_NEUTRAL);
+        mController.displayPreference(mPreferenceScreen);
+    }
+
+    @Test
+    public void displayPreference_setGrammaticalGenderIsNotSpecified_NotSpecifiedIsSelected() {
+        TickButtonPreference selectedPreference =
+                (TickButtonPreference) mPreferenceScreen.getPreference(4);
+        TickButtonPreference pref = (TickButtonPreference) mPreferenceScreen.getPreference(1);
+
+        selectedPreference.performClick();
+
+        assertThat(selectedPreference.getKey()).isEqualTo(KEY_NEUTRAL);
+        assertThat(selectedPreference.isSelected()).isTrue();
+        assertThat(pref.isSelected()).isFalse();
+    }
+}
diff --git a/tests/unit/src/com/android/settings/localepicker/TermsOfAddressNotSpecifiedControllerTest.java b/tests/unit/src/com/android/settings/localepicker/TermsOfAddressNotSpecifiedControllerTest.java
new file mode 100644
index 0000000..8492c3b
--- /dev/null
+++ b/tests/unit/src/com/android/settings/localepicker/TermsOfAddressNotSpecifiedControllerTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2023 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.localepicker;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.spy;
+
+import android.content.Context;
+import android.os.Looper;
+
+import com.android.settings.widget.TickButtonPreference;
+
+import androidx.preference.PreferenceManager;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceCategory;
+import androidx.preference.PreferenceScreen;
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class TermsOfAddressNotSpecifiedControllerTest {
+
+    private static final String KEY_CATEGORY_TERMS_OF_ADDRESS = "key_category_terms_of_address";
+    private static final String KEY_FEMININE = "key_terms_of_address_feminine";
+    private static final String KEY_MASCULINE = "key_terms_of_address_masculine";
+    private static final String KEY_NEUTRAL = "key_terms_of_address_neutral";
+    private static final String KEY_NOT_SPECIFIED = "key_terms_of_address_not_specified";
+
+    private Context mContext;
+    private PreferenceManager mPreferenceManager;
+    private PreferenceCategory mPreferenceCategory;
+    private PreferenceScreen mPreferenceScreen;
+    private TermsOfAddressNotSpecifiedController mController;
+    private TickButtonPreference mFemininePreference;
+    private TickButtonPreference mMasculinePreference;
+    private TickButtonPreference mNotSpecifiedPreference;
+    private TickButtonPreference mNeutralPreference;
+
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(ApplicationProvider.getApplicationContext());
+
+        if (Looper.myLooper() == null) {
+            Looper.prepare();
+        }
+
+        mPreferenceManager = new PreferenceManager(mContext);
+        mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
+        mPreferenceCategory = new PreferenceCategory(mContext);
+        mPreferenceCategory.setKey(KEY_CATEGORY_TERMS_OF_ADDRESS);
+        mNotSpecifiedPreference = new TickButtonPreference(mContext);
+        mNotSpecifiedPreference.setKey(KEY_NOT_SPECIFIED);
+        mFemininePreference = new TickButtonPreference(mContext);
+        mFemininePreference.setKey(KEY_FEMININE);
+        mMasculinePreference = new TickButtonPreference(mContext);
+        mMasculinePreference.setKey(KEY_MASCULINE);
+        mNeutralPreference = new TickButtonPreference(mContext);
+        mNeutralPreference.setKey(KEY_NEUTRAL);
+        mPreferenceScreen.addPreference(mPreferenceCategory);
+        mPreferenceScreen.addPreference(mNotSpecifiedPreference);
+        mPreferenceScreen.addPreference(mFemininePreference);
+        mPreferenceScreen.addPreference(mMasculinePreference);
+        mPreferenceScreen.addPreference(mNeutralPreference);
+        mController = new TermsOfAddressNotSpecifiedController(mContext, KEY_NOT_SPECIFIED);
+        mController.displayPreference(mPreferenceScreen);
+    }
+
+    @Test
+    public void displayPreference_setGrammaticalGenderIsNotSpecified_NotSpecifiedIsSelected() {
+        TickButtonPreference selectedPreference =
+                (TickButtonPreference) mPreferenceScreen.getPreference(1);
+        TickButtonPreference pref = (TickButtonPreference) mPreferenceScreen.getPreference(2);
+
+        selectedPreference.performClick();
+
+        assertThat(selectedPreference.getKey()).isEqualTo(KEY_NOT_SPECIFIED);
+        assertThat(selectedPreference.isSelected()).isTrue();
+        assertThat(pref.isSelected()).isFalse();
+    }
+}
