diff --git a/src/com/android/settings/RegulatoryInfoDisplayActivity.kt b/src/com/android/settings/RegulatoryInfoDisplayActivity.kt
index fdf66c3..6b5ccc7 100644
--- a/src/com/android/settings/RegulatoryInfoDisplayActivity.kt
+++ b/src/com/android/settings/RegulatoryInfoDisplayActivity.kt
@@ -23,6 +23,7 @@
 import android.widget.TextView
 import androidx.appcompat.app.AlertDialog
 import com.android.settings.deviceinfo.regulatory.RegulatoryInfo.getRegulatoryInfo
+import com.android.settings.overlay.FeatureFactory.Companion.featureFactory
 
 /**
  * [Activity] that displays regulatory information for the "Regulatory information"
@@ -53,8 +54,8 @@
             return
         }
 
-        val regulatoryText = resources.getText(R.string.regulatory_info_text)
-        if (regulatoryText.isNotEmpty()) {
+        val regulatoryText = getRegulatoryText()
+        if (!regulatoryText.isNullOrEmpty()) {
             builder.setMessage(regulatoryText)
             val dialog = builder.show()
             // we have to show the dialog first, or the setGravity() call will throw a NPE
@@ -64,4 +65,10 @@
             finish()
         }
     }
+
+    private fun getRegulatoryText(): CharSequence? {
+        val regulatoryInfoText = resources.getText(R.string.regulatory_info_text)
+        if (regulatoryInfoText.isNotBlank()) return regulatoryInfoText
+        return featureFactory.hardwareInfoFeatureProvider?.countryIfOriginLabel
+    }
 }
diff --git a/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProvider.kt b/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProvider.kt
index 400ece9..e9866d7 100644
--- a/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProvider.kt
+++ b/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProvider.kt
@@ -23,4 +23,9 @@
      * Returns the manufactured year
      */
     val manufacturedYear: String?
-}
\ No newline at end of file
+
+    /**
+     * The country of origin label.
+     */
+    val countryIfOriginLabel: String
+}
diff --git a/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProviderImpl.kt b/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProviderImpl.kt
deleted file mode 100644
index 54a112b..0000000
--- a/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProviderImpl.kt
+++ /dev/null
@@ -1,24 +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.deviceinfo.hardwareinfo
-
-/**
- * Feature provider for hardware info
- */
-object HardwareInfoFeatureProviderImpl : HardwareInfoFeatureProvider {
-    override val manufacturedYear: String?
-        get() = null
-}
\ No newline at end of file
diff --git a/src/com/android/settings/deviceinfo/hardwareinfo/ManufacturedYearPreferenceController.kt b/src/com/android/settings/deviceinfo/hardwareinfo/ManufacturedYearPreferenceController.kt
index 92d7733..9d1a826 100644
--- a/src/com/android/settings/deviceinfo/hardwareinfo/ManufacturedYearPreferenceController.kt
+++ b/src/com/android/settings/deviceinfo/hardwareinfo/ManufacturedYearPreferenceController.kt
@@ -22,7 +22,8 @@
 /** Preference controller for Manufactured Year. */
 class ManufacturedYearPreferenceController(context: Context, preferenceKey: String) :
     BasePreferenceController(context, preferenceKey) {
-    private val year: String? = featureFactory.hardwareInfoFeatureProvider.manufacturedYear
+
+    private val year: String? = featureFactory.hardwareInfoFeatureProvider?.manufacturedYear
 
     override fun getAvailabilityStatus(): Int =
         if (!year.isNullOrEmpty()) AVAILABLE else UNSUPPORTED_ON_DEVICE
diff --git a/src/com/android/settings/deviceinfo/regulatory/RegulatoryInfo.kt b/src/com/android/settings/deviceinfo/regulatory/RegulatoryInfo.kt
index e26e061..2982e47 100644
--- a/src/com/android/settings/deviceinfo/regulatory/RegulatoryInfo.kt
+++ b/src/com/android/settings/deviceinfo/regulatory/RegulatoryInfo.kt
@@ -23,8 +23,7 @@
 import androidx.annotation.DrawableRes
 import androidx.annotation.VisibleForTesting
 import com.android.settings.R
-
-
+import com.android.settings.overlay.FeatureFactory.Companion.featureFactory
 
 /** To load Regulatory Info from device. */
 object RegulatoryInfo {
@@ -38,10 +37,10 @@
 
     /** Gets the regulatory drawable. */
     fun Context.getRegulatoryInfo(): Drawable? {
-        val sku = getSku()
+        val sku = getSku().lowercase()
         if (sku.isNotBlank()) {
             // When hardware coo property exists, use regulatory_info_<sku>_<coo> resource if valid.
-            val coo = getCoo()
+            val coo = getCoo().lowercase()
             if (coo.isNotBlank()) {
                 getRegulatoryInfo("${REGULATORY_INFO_RESOURCE}_${sku}_$coo")?.let { return it }
             }
@@ -51,9 +50,9 @@
         return getRegulatoryInfo(REGULATORY_INFO_RESOURCE)
     }
 
-    private fun getCoo(): String = SystemProperties.get(KEY_COO).lowercase()
+    fun getCoo(): String = SystemProperties.get(KEY_COO)
 
-    private fun getSku(): String = SystemProperties.get(KEY_SKU).lowercase()
+    fun getSku(): String = SystemProperties.get(KEY_SKU)
 
     private fun Context.getRegulatoryInfo(fileName: String): Drawable? {
         val overlayPackageName =
diff --git a/src/com/android/settings/fuelgauge/batteryusage/BatteryChartPreferenceController.java b/src/com/android/settings/fuelgauge/batteryusage/BatteryChartPreferenceController.java
index 51dce26..5e6d7d5 100644
--- a/src/com/android/settings/fuelgauge/batteryusage/BatteryChartPreferenceController.java
+++ b/src/com/android/settings/fuelgauge/batteryusage/BatteryChartPreferenceController.java
@@ -556,9 +556,11 @@
                 String.format(
                         "getBatterySinceLastFullChargeUsageData() size=%d time=%d/ms",
                         batteryHistoryMap.size(), (System.currentTimeMillis() - start)));
-
         final Map<Integer, Map<Integer, BatteryDiffData>> batteryUsageData =
-                DataProcessor.getBatteryUsageData(context, batteryHistoryMap);
+                DataProcessor.getBatteryUsageData(
+                        context,
+                        new UserIdsSeries(context, /* mainUserOnly= */ false),
+                        batteryHistoryMap);
         if (batteryUsageData == null) {
             return null;
         }
diff --git a/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoader.java b/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoader.java
index fb5b9a1..d1bf0d2 100644
--- a/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoader.java
+++ b/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoader.java
@@ -84,12 +84,12 @@
     }
 
     @VisibleForTesting
-    static void loadAppUsageData(final Context context) {
+    static void loadAppUsageData(final Context context, final UserIdsSeries userIdsSeries) {
         final long start = System.currentTimeMillis();
         final Map<Long, UsageEvents> appUsageEvents =
                 sFakeAppUsageEventsSupplier != null
                         ? sFakeAppUsageEventsSupplier.get()
-                        : DataProcessor.getAppUsageEvents(context);
+                        : DataProcessor.getAppUsageEvents(context, userIdsSeries);
         if (appUsageEvents == null) {
             Log.w(TAG, "loadAppUsageData() returns null");
             return;
@@ -113,13 +113,15 @@
         DatabaseUtils.sendAppUsageEventData(context, appUsageEventList);
     }
 
-    private static void preprocessBatteryUsageSlots(final Context context) {
+    private static void preprocessBatteryUsageSlots(
+            final Context context, final UserIdsSeries userIdsSeries) {
         final long start = System.currentTimeMillis();
         final Handler handler = new Handler(Looper.getMainLooper());
         final BatteryLevelData batteryLevelData =
                 DataProcessManager.getBatteryLevelData(
                         context,
                         handler,
+                        userIdsSeries,
                         /* isFromPeriodJob= */ true,
                         batteryDiffDataMap -> {
                             DatabaseUtils.sendBatteryUsageSlotData(
@@ -162,8 +164,12 @@
             loadBatteryStatsData(context, isFullChargeStart);
             if (!isFullChargeStart) {
                 // No app usage data or battery diff data at this time.
-                loadAppUsageData(context);
-                preprocessBatteryUsageSlots(context);
+                final UserIdsSeries userIdsSeries =
+                        new UserIdsSeries(context, /* mainUserOnly= */ true);
+                if (!userIdsSeries.isCurrentUserLocked()) {
+                    loadAppUsageData(context, userIdsSeries);
+                    preprocessBatteryUsageSlots(context, userIdsSeries);
+                }
             }
             Log.d(
                     TAG,
diff --git a/src/com/android/settings/fuelgauge/batteryusage/DataProcessManager.java b/src/com/android/settings/fuelgauge/batteryusage/DataProcessManager.java
index b3bcb47..3e8df61 100644
--- a/src/com/android/settings/fuelgauge/batteryusage/DataProcessManager.java
+++ b/src/com/android/settings/fuelgauge/batteryusage/DataProcessManager.java
@@ -21,8 +21,6 @@
 import android.os.AsyncTask;
 import android.os.Handler;
 import android.os.Looper;
-import android.os.UserHandle;
-import android.os.UserManager;
 import android.util.ArrayMap;
 import android.util.Log;
 
@@ -30,7 +28,6 @@
 import androidx.annotation.Nullable;
 
 import com.android.internal.annotations.VisibleForTesting;
-import com.android.settings.Utils;
 
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -82,7 +79,7 @@
     private final long mLastFullChargeTimestamp;
     private final Context mContext;
     private final Handler mHandler;
-    private final UserManager mUserManager;
+    private final UserIdsSeries mUserIdsSeries;
     private final OnBatteryDiffDataMapLoadedListener mCallbackFunction;
     private final List<AppUsageEvent> mAppUsageEventList = new ArrayList<>();
     private final List<BatteryEvent> mBatteryEventList = new ArrayList<>();
@@ -123,6 +120,7 @@
     DataProcessManager(
             Context context,
             Handler handler,
+            final UserIdsSeries userIdsSeries,
             final long rawStartTimestamp,
             final long lastFullChargeTimestamp,
             @NonNull final OnBatteryDiffDataMapLoadedListener callbackFunction,
@@ -130,7 +128,7 @@
             @NonNull final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap) {
         mContext = context.getApplicationContext();
         mHandler = handler;
-        mUserManager = mContext.getSystemService(UserManager.class);
+        mUserIdsSeries = userIdsSeries;
         mRawStartTimestamp = rawStartTimestamp;
         mLastFullChargeTimestamp = lastFullChargeTimestamp;
         mCallbackFunction = callbackFunction;
@@ -142,10 +140,11 @@
     DataProcessManager(
             Context context,
             Handler handler,
+            final UserIdsSeries userIdsSeries,
             @NonNull final OnBatteryDiffDataMapLoadedListener callbackFunction) {
         mContext = context.getApplicationContext();
         mHandler = handler;
-        mUserManager = mContext.getSystemService(UserManager.class);
+        mUserIdsSeries = userIdsSeries;
         mCallbackFunction = callbackFunction;
         mRawStartTimestamp = 0L;
         mLastFullChargeTimestamp = 0L;
@@ -175,10 +174,18 @@
                 // Loads the latest app usage list from the service.
                 loadCurrentAppUsageList();
                 // Loads existing battery usage slots from database.
-                loadBatteryUsageSlotList();
+                if (mUserIdsSeries.isMainUserProfileOnly()) {
+                    loadBatteryUsageSlotList();
+                } else {
+                    mIsBatteryUsageSlotLoaded = true;
+                }
             }
             // Loads app usage list from database.
-            loadDatabaseAppUsageList();
+            if (mUserIdsSeries.isMainUserProfileOnly()) {
+                loadDatabaseAppUsageList();
+            } else {
+                mIsDatabaseAppUsageLoaded = true;
+            }
             // Loads the battery event list from database.
             loadPowerConnectionBatteryEventList();
         } else {
@@ -264,6 +271,7 @@
     private void loadCurrentAppUsageList() {
         new AsyncTask<Void, Void, List<AppUsageEvent>>() {
             @Override
+            @Nullable
             protected List<AppUsageEvent> doInBackground(Void... voids) {
                 if (!shouldLoadAppUsageData()) {
                     Log.d(TAG, "not loadCurrentAppUsageList");
@@ -271,33 +279,21 @@
                 }
                 final long startTime = System.currentTimeMillis();
                 // Loads the current battery usage data from the battery stats service.
-                final int currentUserId = getCurrentUserId();
-                final int workProfileUserId = getWorkProfileUserId();
-                final UsageEvents usageEventsForCurrentUser =
-                        DataProcessor.getAppUsageEventsForUser(
-                                mContext, currentUserId, mRawStartTimestamp);
-                // If fail to load usage events for current user, return null directly and screen-on
-                // time will not be shown in the UI.
-                if (usageEventsForCurrentUser == null) {
-                    Log.w(TAG, "usageEventsForCurrentUser is null");
-                    return null;
-                }
-                UsageEvents usageEventsForWorkProfile = null;
-                if (workProfileUserId != Integer.MIN_VALUE) {
-                    usageEventsForWorkProfile =
-                            DataProcessor.getAppUsageEventsForUser(
-                                    mContext, workProfileUserId, mRawStartTimestamp);
-                } else {
-                    Log.d(TAG, "there is no work profile");
-                }
-
                 final Map<Long, UsageEvents> usageEventsMap = new ArrayMap<>();
-                usageEventsMap.put(Long.valueOf(currentUserId), usageEventsForCurrentUser);
-                if (usageEventsForWorkProfile != null) {
-                    Log.d(TAG, "usageEventsForWorkProfile is null");
-                    usageEventsMap.put(Long.valueOf(workProfileUserId), usageEventsForWorkProfile);
+                for (int userId : mUserIdsSeries.getVisibleUserIds()) {
+                    final UsageEvents usageEventsForCurrentUser =
+                            DataProcessor.getCurrentAppUsageEventsForUser(
+                                    mContext, mUserIdsSeries, userId, mRawStartTimestamp);
+                    if (usageEventsForCurrentUser == null) {
+                        // If fail to load usage events for any user, return null directly and
+                        // screen-on time will not be shown in the UI.
+                        if (userId == mUserIdsSeries.getCurrentUserId()) {
+                            return null;
+                        }
+                    } else {
+                        usageEventsMap.put(Long.valueOf(userId), usageEventsForCurrentUser);
+                    }
                 }
-
                 final List<AppUsageEvent> appUsageEventList =
                         DataProcessor.generateAppUsageEventListFromUsageEvents(
                                 mContext, usageEventsMap);
@@ -337,7 +333,7 @@
                         DatabaseUtils.getAppUsageEventForUsers(
                                 mContext,
                                 Calendar.getInstance(),
-                                getCurrentUserIds(),
+                                mUserIdsSeries.getVisibleUserIds(),
                                 mRawStartTimestamp);
                 Log.d(
                         TAG,
@@ -435,6 +431,7 @@
                 final Map<Long, BatteryDiffData> batteryDiffDataMap =
                         DataProcessor.getBatteryDiffDataMapFromStatsService(
                                 mContext,
+                                mUserIdsSeries,
                                 mRawStartTimestamp,
                                 getSystemAppsPackageNames(),
                                 getSystemAppsUids());
@@ -514,6 +511,7 @@
                 batteryDiffDataMap.putAll(
                         DataProcessor.getBatteryDiffDataMap(
                                 mContext,
+                                mUserIdsSeries,
                                 mHourlyBatteryLevelsPerDay,
                                 mBatteryHistoryMap,
                                 mAppUsagePeriodMap,
@@ -546,9 +544,8 @@
         if (!mShowScreenOnTime) {
             return false;
         }
-        final int currentUserId = getCurrentUserId();
         // If current user is locked, no need to load app usage data from service or database.
-        if (mUserManager == null || !mUserManager.isUserUnlocked(currentUserId)) {
+        if (mUserIdsSeries.isCurrentUserLocked()) {
             Log.d(TAG, "shouldLoadAppUsageData: false, current user is locked");
             mShowScreenOnTime = false;
             return false;
@@ -556,26 +553,6 @@
         return true;
     }
 
-    // Returns the list of current user id and work profile id if exists.
-    private List<Integer> getCurrentUserIds() {
-        final List<Integer> userIds = new ArrayList<>();
-        userIds.add(getCurrentUserId());
-        final int workProfileUserId = getWorkProfileUserId();
-        if (workProfileUserId != Integer.MIN_VALUE) {
-            userIds.add(workProfileUserId);
-        }
-        return userIds;
-    }
-
-    private int getCurrentUserId() {
-        return mContext.getUserId();
-    }
-
-    private int getWorkProfileUserId() {
-        final UserHandle userHandle = Utils.getManagedProfile(mUserManager);
-        return userHandle != null ? userHandle.getIdentifier() : Integer.MIN_VALUE;
-    }
-
     private synchronized Set<String> getSystemAppsPackageNames() {
         if (mSystemAppsPackageNames == null) {
             mSystemAppsPackageNames = DataProcessor.getSystemAppsPackageNames(mContext);
@@ -599,6 +576,7 @@
     public static BatteryLevelData getBatteryLevelData(
             Context context,
             @Nullable Handler handler,
+            final UserIdsSeries userIdsSeries,
             final boolean isFromPeriodJob,
             final OnBatteryDiffDataMapLoadedListener onBatteryUsageMapLoadedListener) {
         final long start = System.currentTimeMillis();
@@ -610,13 +588,14 @@
                         lastFullChargeTime,
                         DatabaseUtils.BATTERY_LEVEL_RECORD_EVENTS);
         final long startTimestamp =
-                batteryLevelRecordEvents.isEmpty()
+                (batteryLevelRecordEvents.isEmpty() || !userIdsSeries.isMainUserProfileOnly())
                         ? lastFullChargeTime
                         : batteryLevelRecordEvents.get(0).getTimestamp();
         final BatteryLevelData batteryLevelData =
                 getPeriodBatteryLevelData(
                         context,
                         handler,
+                        userIdsSeries,
                         startTimestamp,
                         lastFullChargeTime,
                         isFromPeriodJob,
@@ -636,6 +615,7 @@
     private static BatteryLevelData getPeriodBatteryLevelData(
             Context context,
             @Nullable Handler handler,
+            final UserIdsSeries userIdsSeries,
             final long startTimestamp,
             final long lastFullChargeTime,
             final boolean isFromPeriodJob,
@@ -663,7 +643,9 @@
                                 lastFullChargeTime);
         if (batteryHistoryMap == null || batteryHistoryMap.isEmpty()) {
             Log.d(TAG, "batteryHistoryMap is null in getPeriodBatteryLevelData()");
-            new DataProcessManager(context, handler, onBatteryDiffDataMapLoadedListener).start();
+            new DataProcessManager(
+                            context, handler, userIdsSeries, onBatteryDiffDataMapLoadedListener)
+                    .start();
             return null;
         }
 
@@ -675,7 +657,9 @@
                 DataProcessor.getLevelDataThroughProcessedHistoryMap(
                         context, processedBatteryHistoryMap);
         if (batteryLevelData == null) {
-            new DataProcessManager(context, handler, onBatteryDiffDataMapLoadedListener).start();
+            new DataProcessManager(
+                            context, handler, userIdsSeries, onBatteryDiffDataMapLoadedListener)
+                    .start();
             Log.d(TAG, "getBatteryLevelData() returns null");
             return null;
         }
@@ -684,6 +668,7 @@
         new DataProcessManager(
                         context,
                         handler,
+                        userIdsSeries,
                         startTimestamp,
                         lastFullChargeTime,
                         onBatteryDiffDataMapLoadedListener,
diff --git a/src/com/android/settings/fuelgauge/batteryusage/DataProcessor.java b/src/com/android/settings/fuelgauge/batteryusage/DataProcessor.java
index 2ef12f1..da8481d 100644
--- a/src/com/android/settings/fuelgauge/batteryusage/DataProcessor.java
+++ b/src/com/android/settings/fuelgauge/batteryusage/DataProcessor.java
@@ -28,7 +28,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
-import android.content.pm.UserInfo;
 import android.os.BatteryConsumer;
 import android.os.BatteryStatsManager;
 import android.os.BatteryUsageStats;
@@ -52,7 +51,6 @@
 
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.internal.os.PowerProfile;
-import com.android.settings.Utils;
 import com.android.settings.fuelgauge.BatteryUtils;
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.fuelgauge.BatteryStatus;
@@ -134,6 +132,7 @@
     @Nullable
     public static Map<Integer, Map<Integer, BatteryDiffData>> getBatteryUsageData(
             Context context,
+            UserIdsSeries userIdsSeries,
             @Nullable final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap) {
         if (batteryHistoryMap == null || batteryHistoryMap.isEmpty()) {
             Log.d(TAG, "getBatteryLevelData() returns null");
@@ -161,6 +160,7 @@
                         context,
                         getBatteryDiffDataMap(
                                 context,
+                                userIdsSeries,
                                 batteryLevelData.getHourlyBatteryLevelsPerDay(),
                                 processedBatteryHistoryMap,
                                 /* appUsagePeriodMap= */ null,
@@ -183,24 +183,21 @@
 
     /** Gets the {@link UsageEvents} from system service for all unlocked users. */
     @Nullable
-    public static Map<Long, UsageEvents> getAppUsageEvents(Context context) {
+    public static Map<Long, UsageEvents> getAppUsageEvents(
+            Context context, UserIdsSeries userIdsSeries) {
         final long start = System.currentTimeMillis();
         context = DatabaseUtils.getParentContext(context);
         if (context == null) {
             return null;
         }
         final Map<Long, UsageEvents> resultMap = new ArrayMap();
-        final UserManager userManager = context.getSystemService(UserManager.class);
-        if (userManager == null) {
-            return null;
-        }
         final long sixDaysAgoTimestamp =
                 DatabaseUtils.getTimestampSixDaysAgo(Calendar.getInstance());
-        for (final UserInfo user : userManager.getAliveUsers()) {
+        for (final int userId : userIdsSeries.getVisibleUserIds()) {
             final UsageEvents events =
-                    getAppUsageEventsForUser(context, userManager, user.id, sixDaysAgoTimestamp);
+                    getAppUsageEventsForUser(context, userIdsSeries, userId, sixDaysAgoTimestamp);
             if (events != null) {
-                resultMap.put(Long.valueOf(user.id), events);
+                resultMap.put(Long.valueOf(userId), events);
             }
         }
         final long elapsedTime = System.currentTimeMillis() - start;
@@ -212,22 +209,21 @@
 
     /** Gets the {@link UsageEvents} from system service for the specific user. */
     @Nullable
-    public static UsageEvents getAppUsageEventsForUser(
-            Context context, final int userID, final long startTimestampOfLevelData) {
+    public static UsageEvents getCurrentAppUsageEventsForUser(
+            Context context,
+            final UserIdsSeries userIdsSeries,
+            final int userID,
+            final long startTimestampOfLevelData) {
         final long start = System.currentTimeMillis();
         context = DatabaseUtils.getParentContext(context);
         if (context == null) {
             return null;
         }
-        final UserManager userManager = context.getSystemService(UserManager.class);
-        if (userManager == null) {
-            return null;
-        }
         final long sixDaysAgoTimestamp =
                 DatabaseUtils.getTimestampSixDaysAgo(Calendar.getInstance());
         final long earliestTimestamp = Math.max(sixDaysAgoTimestamp, startTimestampOfLevelData);
         final UsageEvents events =
-                getAppUsageEventsForUser(context, userManager, userID, earliestTimestamp);
+                getAppUsageEventsForUser(context, userIdsSeries, userID, earliestTimestamp);
         final long elapsedTime = System.currentTimeMillis() - start;
         Log.d(
                 TAG,
@@ -521,6 +517,7 @@
 
     static Map<Long, BatteryDiffData> getBatteryDiffDataMap(
             Context context,
+            final UserIdsSeries userIdsSeries,
             final List<BatteryLevelData.PeriodBatteryLevelData> hourlyBatteryLevelsPerDay,
             final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap,
             final Map<Integer, Map<Integer, Map<Long, Map<String, List<AppUsagePeriod>>>>>
@@ -528,11 +525,6 @@
             final @NonNull Set<String> systemAppsPackageNames,
             final @NonNull Set<Integer> systemAppsUids) {
         final Map<Long, BatteryDiffData> batteryDiffDataMap = new ArrayMap<>();
-        final int currentUserId = context.getUserId();
-        final UserHandle userHandle =
-                Utils.getManagedProfile(context.getSystemService(UserManager.class));
-        final int workProfileUserId =
-                userHandle != null ? userHandle.getIdentifier() : Integer.MIN_VALUE;
         // Each time slot usage diff data =
         //     sum(Math.abs(timestamp[i+1] data - timestamp[i] data));
         // since we want to aggregate every hour usage diff data into a single time slot.
@@ -569,8 +561,7 @@
                                 endTimestamp,
                                 startBatteryLevel,
                                 endBatteryLevel,
-                                currentUserId,
-                                workProfileUserId,
+                                userIdsSeries,
                                 slotDuration,
                                 systemAppsPackageNames,
                                 systemAppsUids,
@@ -629,6 +620,7 @@
     @Nullable
     static BatteryDiffData generateBatteryDiffData(
             final Context context,
+            final UserIdsSeries userIdsSeries,
             final long startTimestamp,
             final List<BatteryHistEntry> batteryHistEntryList,
             final @NonNull Set<String> systemAppsPackageNames,
@@ -650,15 +642,9 @@
                     systemAppsUids,
                     /* isAccumulated= */ false);
         }
-        final int currentUserId = context.getUserId();
-        final UserHandle userHandle =
-                Utils.getManagedProfile(context.getSystemService(UserManager.class));
-        final int workProfileUserId =
-                userHandle != null ? userHandle.getIdentifier() : Integer.MIN_VALUE;
-
         for (BatteryHistEntry entry : batteryHistEntryList) {
             final boolean isFromOtherUsers =
-                    isConsumedFromOtherUsers(currentUserId, workProfileUserId, entry);
+                    isConsumedFromOtherUsers(userIdsSeries, entry);
             // Not show other users' battery usage data.
             if (isFromOtherUsers) {
                 continue;
@@ -905,6 +891,7 @@
 
     static Map<Long, BatteryDiffData> getBatteryDiffDataMapFromStatsService(
             final Context context,
+            final UserIdsSeries userIdsSeries,
             final long startTimestamp,
             @NonNull final Set<String> systemAppsPackageNames,
             @NonNull final Set<Integer> systemAppsUids) {
@@ -913,6 +900,7 @@
                 startTimestamp,
                 generateBatteryDiffData(
                         context,
+                        userIdsSeries,
                         startTimestamp,
                         getBatteryHistListFromFromStatsService(context),
                         systemAppsPackageNames,
@@ -1034,14 +1022,14 @@
     @Nullable
     private static UsageEvents getAppUsageEventsForUser(
             Context context,
-            final UserManager userManager,
+            final UserIdsSeries userIdsSeries,
             final int userID,
             final long earliestTimestamp) {
         final String callingPackage = context.getPackageName();
         final long now = System.currentTimeMillis();
         // When the user is not unlocked, UsageStatsManager will return null, so bypass the
         // following data loading logics directly.
-        if (!userManager.isUserUnlocked(userID)) {
+        if (userIdsSeries.isUserLocked(userID)) {
             Log.w(TAG, "fail to load app usage event for user :" + userID + " because locked");
             return null;
         }
@@ -1331,8 +1319,7 @@
             final long endTimestamp,
             final int startBatteryLevel,
             final int endBatteryLevel,
-            final int currentUserId,
-            final int workProfileUserId,
+            final UserIdsSeries userIdsSeries,
             final long slotDuration,
             final Set<String> systemAppsPackageNames,
             final Set<Integer> systemAppsUids,
@@ -1342,8 +1329,7 @@
         if (appUsageMap != null) {
             final List<AppUsagePeriod> flatAppUsagePeriodList = new ArrayList<>();
             for (final long userId : appUsageMap.keySet()) {
-                if ((userId != currentUserId && userId != workProfileUserId)
-                        || appUsageMap.get(userId) == null) {
+                if (userIdsSeries.isFromOtherUsers(userId) || appUsageMap.get(userId) == null) {
                     continue;
                 }
                 for (final String packageName : appUsageMap.get(userId).keySet()) {
@@ -1405,8 +1391,7 @@
 
             // Not show other users' battery usage data.
             final boolean isFromOtherUsers =
-                    isConsumedFromOtherUsers(
-                            currentUserId, workProfileUserId, selectedBatteryEntry);
+                    isConsumedFromOtherUsers(userIdsSeries, selectedBatteryEntry);
             if (isFromOtherUsers) {
                 continue;
             }
@@ -1593,12 +1578,10 @@
     }
 
     private static boolean isConsumedFromOtherUsers(
-            final int currentUserId,
-            final int workProfileUserId,
+            final UserIdsSeries userIdsSeries,
             final BatteryHistEntry batteryHistEntry) {
         return isUidConsumer(batteryHistEntry.mConsumerType)
-                && batteryHistEntry.mUserId != currentUserId
-                && batteryHistEntry.mUserId != workProfileUserId;
+                && userIdsSeries.isFromOtherUsers(batteryHistEntry.mUserId);
     }
 
     @Nullable
diff --git a/src/com/android/settings/fuelgauge/batteryusage/PowerUsageAdvanced.java b/src/com/android/settings/fuelgauge/batteryusage/PowerUsageAdvanced.java
index 29839e9..f5ed06d 100644
--- a/src/com/android/settings/fuelgauge/batteryusage/PowerUsageAdvanced.java
+++ b/src/com/android/settings/fuelgauge/batteryusage/PowerUsageAdvanced.java
@@ -492,6 +492,7 @@
                     return DataProcessManager.getBatteryLevelData(
                             getContext(),
                             mHandler,
+                            new UserIdsSeries(getContext(), /* mainUserOnly= */ false),
                             /* isFromPeriodJob= */ false,
                             PowerUsageAdvanced.this::onBatteryDiffDataMapUpdate);
                 }
diff --git a/src/com/android/settings/fuelgauge/batteryusage/UserIdsSeries.java b/src/com/android/settings/fuelgauge/batteryusage/UserIdsSeries.java
new file mode 100644
index 0000000..3dc311e
--- /dev/null
+++ b/src/com/android/settings/fuelgauge/batteryusage/UserIdsSeries.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2024 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.fuelgauge.batteryusage;
+
+import android.content.Context;
+import android.content.pm.UserInfo;
+import android.os.UserManager;
+
+import androidx.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+class UserIdsSeries {
+    private final UserManager mUserManager;
+    private final int mCurrentUserId;
+    private final List<Integer> mVisibleUserIds = new ArrayList<>();
+
+    @Nullable private UserInfo mPrivateUser = null;
+    @Nullable private UserInfo mManagedProfileUser = null;
+
+    UserIdsSeries(final Context context, final boolean mainUserOnly) {
+        mUserManager = context.getSystemService(UserManager.class);
+        mCurrentUserId = context.getUserId();
+        List<UserInfo> aliveUsers =
+                mUserManager != null ? mUserManager.getAliveUsers() : new ArrayList<>();
+
+        if (mainUserOnly) {
+            aliveUsers.stream()
+                    .filter(UserInfo::isMain)
+                    .forEach(userInfo -> mVisibleUserIds.add(userInfo.id));
+            return;
+        }
+
+        for (UserInfo userInfo : aliveUsers) {
+            if (!mUserManager.isSameProfileGroup(mCurrentUserId, userInfo.id)) {
+                continue;
+            }
+            if (!userInfo.isQuietModeEnabled() || userInfo.isManagedProfile()) {
+                mVisibleUserIds.add(userInfo.id);
+            }
+            if (userInfo.isPrivateProfile()) {
+                mPrivateUser = userInfo;
+            }
+            if (userInfo.isManagedProfile()) {
+                mManagedProfileUser = userInfo;
+            }
+        }
+    }
+
+    int getCurrentUserId() {
+        return mCurrentUserId;
+    }
+
+    List<Integer> getVisibleUserIds() {
+        return mVisibleUserIds;
+    }
+
+    boolean isCurrentUserLocked() {
+        return isUserLocked(mCurrentUserId);
+    }
+
+    boolean isUserLocked(int userId) {
+        return mUserManager == null || !mUserManager.isUserUnlocked(userId);
+    }
+
+    boolean isFromOtherUsers(long userId) {
+        return !mVisibleUserIds.contains((int) userId);
+    }
+
+    boolean isMainUserProfileOnly() {
+        return mUserManager != null
+                && mUserManager.isMainUser()
+                && mPrivateUser == null
+                && mManagedProfileUser == null;
+    }
+}
diff --git a/src/com/android/settings/localepicker/TermsOfAddressBaseController.java b/src/com/android/settings/localepicker/TermsOfAddressBaseController.java
index 34c502f..d9962de 100644
--- a/src/com/android/settings/localepicker/TermsOfAddressBaseController.java
+++ b/src/com/android/settings/localepicker/TermsOfAddressBaseController.java
@@ -26,8 +26,12 @@
 import com.android.settings.widget.TickButtonPreference;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+
 public abstract class TermsOfAddressBaseController extends BasePreferenceController {
 
+    private static final Executor sExecutor = Executors.newSingleThreadExecutor();
     private PreferenceScreen mPreferenceScreen;
     private MetricsFeatureProvider mMetricsFeatureProvider;
     private TickButtonPreference mPreference;
@@ -46,8 +50,11 @@
         mPreferenceScreen = screen;
         mPreference = screen.findPreference(getPreferenceKey());
         mPreference.setOnPreferenceClickListener(clickedPref -> {
-            mGrammaticalInflectionManager.setSystemWideGrammaticalGender(
-                    getGrammaticalGenderType());
+            sExecutor.execute(
+                    () -> {
+                        mGrammaticalInflectionManager.setSystemWideGrammaticalGender(
+                                getGrammaticalGenderType());
+                    });
             setSelected(mPreference);
             mMetricsFeatureProvider.action(mContext, getMetricsActionKey());
             return true;
diff --git a/src/com/android/settings/overlay/FeatureFactory.kt b/src/com/android/settings/overlay/FeatureFactory.kt
index 2c4a295..53ad8ba 100644
--- a/src/com/android/settings/overlay/FeatureFactory.kt
+++ b/src/com/android/settings/overlay/FeatureFactory.kt
@@ -68,7 +68,7 @@
     /**
      * Retrieves implementation for Hardware Info feature.
      */
-    abstract val hardwareInfoFeatureProvider: HardwareInfoFeatureProvider
+    open val hardwareInfoFeatureProvider: HardwareInfoFeatureProvider? = null
 
     /** Implementation for [SupportFeatureProvider]. */
     open val supportFeatureProvider: SupportFeatureProvider? = null
diff --git a/src/com/android/settings/overlay/FeatureFactoryImpl.kt b/src/com/android/settings/overlay/FeatureFactoryImpl.kt
index e1519b3..1770209 100644
--- a/src/com/android/settings/overlay/FeatureFactoryImpl.kt
+++ b/src/com/android/settings/overlay/FeatureFactoryImpl.kt
@@ -45,8 +45,6 @@
 import com.android.settings.dashboard.DashboardFeatureProviderImpl
 import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider
 import com.android.settings.dashboard.suggestions.SuggestionFeatureProviderImpl
-import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProvider
-import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProviderImpl
 import com.android.settings.display.DisplayFeatureProvider
 import com.android.settings.display.DisplayFeatureProviderImpl
 import com.android.settings.enterprise.EnterprisePrivacyFeatureProviderImpl
@@ -81,9 +79,6 @@
         ContextualCardFeatureProviderImpl(appContext)
     }
 
-    override val hardwareInfoFeatureProvider: HardwareInfoFeatureProvider =
-        HardwareInfoFeatureProviderImpl
-
     override val metricsFeatureProvider by lazy { SettingsMetricsFeatureProvider() }
 
     override val powerUsageFeatureProvider by lazy { PowerUsageFeatureProviderImpl(appContext) }
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoaderTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoaderTest.java
index 723a138..41379b3 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoaderTest.java
@@ -52,6 +52,7 @@
 public final class BatteryUsageDataLoaderTest {
 
     private Context mContext;
+    @Mock private UserIdsSeries mUserIdsSeries;
     @Mock private ContentResolver mMockContentResolver;
     @Mock private BatteryStatsManager mBatteryStatsManager;
     @Mock private PackageManager mPackageManager;
@@ -120,7 +121,7 @@
         BatteryUsageDataLoader.sFakeAppUsageEventsSupplier = () -> new HashMap<>();
         BatteryUsageDataLoader.sFakeUsageEventsListSupplier = () -> AppUsageEventList;
 
-        BatteryUsageDataLoader.loadAppUsageData(mContext);
+        BatteryUsageDataLoader.loadAppUsageData(mContext, mUserIdsSeries);
 
         verify(mMockContentResolver).bulkInsert(any(), any());
         verify(mMockContentResolver).notifyChange(any(), any());
@@ -130,7 +131,7 @@
     public void loadAppUsageData_nullAppUsageEvents_notInsertDataIntoProvider() {
         BatteryUsageDataLoader.sFakeAppUsageEventsSupplier = () -> null;
 
-        BatteryUsageDataLoader.loadAppUsageData(mContext);
+        BatteryUsageDataLoader.loadAppUsageData(mContext, mUserIdsSeries);
 
         verifyNoMoreInteractions(mMockContentResolver);
     }
@@ -140,7 +141,7 @@
         BatteryUsageDataLoader.sFakeAppUsageEventsSupplier = () -> new HashMap<>();
         BatteryUsageDataLoader.sFakeUsageEventsListSupplier = () -> null;
 
-        BatteryUsageDataLoader.loadAppUsageData(mContext);
+        BatteryUsageDataLoader.loadAppUsageData(mContext, mUserIdsSeries);
 
         verifyNoMoreInteractions(mMockContentResolver);
     }
@@ -150,7 +151,7 @@
         BatteryUsageDataLoader.sFakeAppUsageEventsSupplier = () -> new HashMap<>();
         BatteryUsageDataLoader.sFakeUsageEventsListSupplier = () -> new ArrayList<>();
 
-        BatteryUsageDataLoader.loadAppUsageData(mContext);
+        BatteryUsageDataLoader.loadAppUsageData(mContext, mUserIdsSeries);
 
         verifyNoMoreInteractions(mMockContentResolver);
     }
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/DataProcessManagerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/DataProcessManagerTest.java
index 6227790..b025db8 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/DataProcessManagerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/DataProcessManagerTest.java
@@ -70,6 +70,7 @@
     private Context mContext;
     private DataProcessManager mDataProcessManager;
 
+    @Mock private UserIdsSeries mUserIdsSeries;
     @Mock private IUsageStatsManager mUsageStatsManager;
     @Mock private UserManager mUserManager;
     @Mock private BatteryStatsManager mBatteryStatsManager;
@@ -95,11 +96,13 @@
         doReturn(mIntent).when(mContext).registerReceiver(any(), any());
         doReturn(100).when(mIntent).getIntExtra(eq(BatteryManager.EXTRA_SCALE), anyInt());
         doReturn(66).when(mIntent).getIntExtra(eq(BatteryManager.EXTRA_LEVEL), anyInt());
+        doReturn(true).when(mUserIdsSeries).isMainUserProfileOnly();
 
         mDataProcessManager =
                 new DataProcessManager(
                         mContext,
                         /* handler= */ null,
+                        mUserIdsSeries,
                         /* rawStartTimestamp= */ 0L,
                         /* lastFullChargeTimestamp= */ 0L,
                         /* callbackFunction= */ null,
@@ -117,7 +120,11 @@
     @LooperMode(LooperMode.Mode.LEGACY)
     public void constructor_noLevelData() {
         final DataProcessManager dataProcessManager =
-                new DataProcessManager(mContext, /* handler= */ null, /* callbackFunction= */ null);
+                new DataProcessManager(
+                        mContext,
+                        /* handler= */ null,
+                        mUserIdsSeries,
+                        /* callbackFunction= */ null);
         assertThat(dataProcessManager.getShowScreenOnTime()).isFalse();
     }
 
@@ -180,6 +187,7 @@
         doReturn(1).when(mContext).getUserId();
         // No work profile.
         doReturn(new ArrayList<>()).when(mUserManager).getUserProfiles();
+        doReturn(new ArrayList<>(List.of(1))).when(mUserIdsSeries).getVisibleUserIds();
 
         // Fake database usage data.
         final MatrixCursor cursor =
@@ -239,6 +247,7 @@
                 new DataProcessManager(
                         mContext,
                         /* handler= */ null,
+                        mUserIdsSeries,
                         /* rawStartTimestamp= */ 2L,
                         /* lastFullChargeTimestamp= */ 1L,
                         /* callbackFunction= */ null,
@@ -301,7 +310,7 @@
         doReturn(getUsageEvents(events))
                 .when(mUsageStatsManager)
                 .queryEventsForUser(anyLong(), anyLong(), anyInt(), any());
-        doReturn(false).when(mUserManager).isUserUnlocked(anyInt());
+        doReturn(true).when(mUserIdsSeries).isCurrentUserLocked();
         final MatrixCursor cursor =
                 new MatrixCursor(
                         new String[] {
@@ -327,6 +336,7 @@
                         DataProcessManager.getBatteryLevelData(
                                 mContext,
                                 /* handler= */ null,
+                                mUserIdsSeries,
                                 /* isFromPeriodJob= */ false,
                                 /* asyncResponseDelegate= */ null))
                 .isNull();
@@ -334,6 +344,7 @@
                         DataProcessManager.getBatteryLevelData(
                                 mContext,
                                 /* handler= */ null,
+                                mUserIdsSeries,
                                 /* isFromPeriodJob= */ true,
                                 /* asyncResponseDelegate= */ null))
                 .isNull();
@@ -355,6 +366,7 @@
                 DataProcessManager.getBatteryLevelData(
                         mContext,
                         /* handler= */ null,
+                        mUserIdsSeries,
                         /* isFromPeriodJob= */ false,
                         /* asyncResponseDelegate= */ null);
 
@@ -383,6 +395,7 @@
                 DataProcessManager.getBatteryLevelData(
                         mContext,
                         /* handler= */ null,
+                        mUserIdsSeries,
                         /* isFromPeriodJob= */ false,
                         /* asyncResponseDelegate= */ null);
 
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/DataProcessorTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/DataProcessorTest.java
index 7a67240..2897343 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/DataProcessorTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/batteryusage/DataProcessorTest.java
@@ -80,6 +80,7 @@
     @Mock private Intent mIntent;
     @Mock private BatteryUsageStats mBatteryUsageStats;
     @Mock private UserManager mUserManager;
+    @Mock private UserIdsSeries mUserIdsSeries;
     @Mock private IUsageStatsManager mUsageStatsManager;
     @Mock private BatteryEntry mMockBatteryEntry1;
     @Mock private BatteryEntry mMockBatteryEntry2;
@@ -95,6 +96,7 @@
         mContext = spy(RuntimeEnvironment.application);
         mFeatureFactory = FakeFeatureFactory.setupForTest();
         mPowerUsageFeatureProvider = mFeatureFactory.powerUsageFeatureProvider;
+        doReturn(true).when(mUserIdsSeries).isMainUserProfileOnly();
 
         DataProcessor.sTestSystemAppsPackageNames = Set.of();
         DataProcessor.sUsageStatsManager = mUsageStatsManager;
@@ -118,8 +120,10 @@
         doReturn(mUsageEvents1)
                 .when(mUsageStatsManager)
                 .queryEventsForUser(anyLong(), anyLong(), anyInt(), anyString());
+        doReturn(new ArrayList<>(List.of(0))).when(mUserIdsSeries).getVisibleUserIds();
 
-        final Map<Long, UsageEvents> resultMap = DataProcessor.getAppUsageEvents(mContext);
+        final Map<Long, UsageEvents> resultMap =
+                DataProcessor.getAppUsageEvents(mContext, mUserIdsSeries);
 
         assertThat(resultMap).hasSize(1);
         assertThat(resultMap.get(Long.valueOf(userInfo.id))).isEqualTo(mUsageEvents1);
@@ -134,7 +138,8 @@
         // Test locked user.
         doReturn(false).when(mUserManager).isUserUnlocked(userInfo.id);
 
-        final Map<Long, UsageEvents> resultMap = DataProcessor.getAppUsageEvents(mContext);
+        final Map<Long, UsageEvents> resultMap =
+                DataProcessor.getAppUsageEvents(mContext, mUserIdsSeries);
 
         assertThat(resultMap).isNull();
     }
@@ -150,7 +155,8 @@
                 .when(mUsageStatsManager)
                 .queryEventsForUser(anyLong(), anyLong(), anyInt(), anyString());
 
-        final Map<Long, UsageEvents> resultMap = DataProcessor.getAppUsageEvents(mContext);
+        final Map<Long, UsageEvents> resultMap =
+                DataProcessor.getAppUsageEvents(mContext, mUserIdsSeries);
 
         assertThat(resultMap).isNull();
     }
@@ -163,7 +169,8 @@
                 .when(mUsageStatsManager)
                 .queryEventsForUser(anyLong(), anyLong(), anyInt(), anyString());
 
-        assertThat(DataProcessor.getAppUsageEventsForUser(mContext, userId, 0))
+        assertThat(DataProcessor.getCurrentAppUsageEventsForUser(
+                mContext, mUserIdsSeries, userId, 0))
                 .isEqualTo(mUsageEvents1);
     }
 
@@ -173,7 +180,9 @@
         // Test locked user.
         doReturn(false).when(mUserManager).isUserUnlocked(userId);
 
-        assertThat(DataProcessor.getAppUsageEventsForUser(mContext, userId, 0)).isNull();
+        assertThat(DataProcessor.getCurrentAppUsageEventsForUser(
+                mContext, mUserIdsSeries, userId, 0))
+                .isNull();
     }
 
     @Test
@@ -184,7 +193,9 @@
                 .when(mUsageStatsManager)
                 .queryEventsForUser(anyLong(), anyLong(), anyInt(), anyString());
 
-        assertThat(DataProcessor.getAppUsageEventsForUser(mContext, userId, 0)).isNull();
+        assertThat(DataProcessor.getCurrentAppUsageEventsForUser(
+                mContext, mUserIdsSeries, userId, 0))
+                .isNull();
     }
 
     @Test
@@ -852,6 +863,7 @@
         assertThat(
                         DataProcessor.getBatteryDiffDataMap(
                                 mContext,
+                                mUserIdsSeries,
                                 hourlyBatteryLevelsPerDay,
                                 new HashMap<>(),
                                 /* appUsagePeriodMap= */ null,
@@ -938,6 +950,7 @@
         Map<Long, BatteryDiffData> batteryDiffDataMap =
                 DataProcessor.getBatteryDiffDataMap(
                         mContext,
+                        mUserIdsSeries,
                         batteryLevelData.getHourlyBatteryLevelsPerDay(),
                         batteryHistoryMap,
                         appUsagePeriodMap,
@@ -1154,6 +1167,7 @@
                         mContext,
                         DataProcessor.getBatteryDiffDataMap(
                                 mContext,
+                                mUserIdsSeries,
                                 batteryLevelData.getHourlyBatteryLevelsPerDay(),
                                 batteryHistoryMap,
                                 appUsagePeriodMap,
@@ -1271,6 +1285,10 @@
                 };
         final Map<Long, Map<String, BatteryHistEntry>> batteryHistoryMap = new HashMap<>();
         final int currentUserId = mContext.getUserId();
+        doReturn(false).when(mUserIdsSeries).isFromOtherUsers(currentUserId);
+        doReturn(true).when(mUserIdsSeries).isFromOtherUsers(currentUserId + 1);
+        doReturn(true).when(mUserIdsSeries).isFromOtherUsers(currentUserId + 2);
+
         // Adds the index = 0 data.
         Map<String, BatteryHistEntry> entryMap = new HashMap<>();
         BatteryHistEntry entry =
@@ -1431,6 +1449,7 @@
                         mContext,
                         DataProcessor.getBatteryDiffDataMap(
                                 mContext,
+                                mUserIdsSeries,
                                 batteryLevelData.getHourlyBatteryLevelsPerDay(),
                                 batteryHistoryMap,
                                 /* appUsagePeriodMap= */ null,
@@ -1546,6 +1565,7 @@
                         mContext,
                         DataProcessor.getBatteryDiffDataMap(
                                 mContext,
+                                mUserIdsSeries,
                                 batteryLevelData.getHourlyBatteryLevelsPerDay(),
                                 batteryHistoryMap,
                                 appUsagePeriodMap,
@@ -1701,6 +1721,7 @@
                         mContext,
                         DataProcessor.getBatteryDiffDataMap(
                                 mContext,
+                                mUserIdsSeries,
                                 batteryLevelData.getHourlyBatteryLevelsPerDay(),
                                 batteryHistoryMap,
                                 /* appUsagePeriodMap= */ null,
@@ -1851,6 +1872,7 @@
                         mContext,
                         DataProcessor.getBatteryDiffDataMap(
                                 mContext,
+                                mUserIdsSeries,
                                 batteryLevelData.getHourlyBatteryLevelsPerDay(),
                                 batteryHistoryMap,
                                 /* appUsagePeriodMap= */ null,
@@ -1873,6 +1895,7 @@
         final BatteryDiffData batteryDiffData =
                 DataProcessor.generateBatteryDiffData(
                         mContext,
+                        mUserIdsSeries,
                         System.currentTimeMillis(),
                         DataProcessor.convertToBatteryHistEntry(null, mBatteryUsageStats),
                         /* systemAppsPackageNames= */ Set.of(),
@@ -1933,6 +1956,7 @@
         final BatteryDiffData batteryDiffData =
                 DataProcessor.generateBatteryDiffData(
                         mContext,
+                        mUserIdsSeries,
                         System.currentTimeMillis(),
                         DataProcessor.convertToBatteryHistEntry(
                                 batteryEntryList, mBatteryUsageStats),
diff --git a/tests/robotests/testutils/com/android/settings/testutils/FakeFeatureFactory.java b/tests/robotests/testutils/com/android/settings/testutils/FakeFeatureFactory.java
index f49cc68..38683d0 100644
--- a/tests/robotests/testutils/com/android/settings/testutils/FakeFeatureFactory.java
+++ b/tests/robotests/testutils/com/android/settings/testutils/FakeFeatureFactory.java
@@ -32,8 +32,6 @@
 import com.android.settings.connecteddevice.stylus.StylusFeatureProvider;
 import com.android.settings.dashboard.DashboardFeatureProvider;
 import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
-import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProvider;
-import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProviderImpl;
 import com.android.settings.display.DisplayFeatureProvider;
 import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
 import com.android.settings.fuelgauge.BatterySettingsFeatureProvider;
@@ -299,11 +297,6 @@
     }
 
     @Override
-    public HardwareInfoFeatureProvider getHardwareInfoFeatureProvider() {
-        return HardwareInfoFeatureProviderImpl.INSTANCE;
-    }
-
-    @Override
     public AdvancedVpnFeatureProvider getAdvancedVpnFeatureProvider() {
         return mAdvancedVpnFeatureProvider;
     }
diff --git a/tests/spa_unit/src/com/android/settings/deviceinfo/regulatory/RegulatoryInfoTest.kt b/tests/spa_unit/src/com/android/settings/deviceinfo/regulatory/RegulatoryInfoTest.kt
index f1e18fc..7486e78 100644
--- a/tests/spa_unit/src/com/android/settings/deviceinfo/regulatory/RegulatoryInfoTest.kt
+++ b/tests/spa_unit/src/com/android/settings/deviceinfo/regulatory/RegulatoryInfoTest.kt
@@ -35,14 +35,12 @@
 import org.junit.Test
 import org.junit.runner.RunWith
 import org.mockito.MockitoSession
-import org.mockito.Spy
 import org.mockito.quality.Strictness
 
 @RunWith(AndroidJUnit4::class)
 class RegulatoryInfoTest {
     private lateinit var mockSession: MockitoSession
 
-    @Spy
     private val context: Context = ApplicationProvider.getApplicationContext()
 
     @Before
@@ -98,8 +96,31 @@
         assertDrawableSameAs(regulatoryInfo, R.drawable.regulatory_info_sku)
     }
 
+    @Test
+    fun getCoo() {
+        doReturn(COO).`when` { SystemProperties.get(KEY_COO) }
+
+        val coo = RegulatoryInfo.getCoo()
+
+        assertThat(coo).isEqualTo(COO)
+    }
+
+    @Test
+    fun getSku() {
+        doReturn(SKU).`when` { SystemProperties.get(KEY_SKU) }
+
+        val coo = RegulatoryInfo.getSku()
+
+        assertThat(coo).isEqualTo(SKU)
+    }
+
     private fun assertDrawableSameAs(drawable: Drawable?, @DrawableRes resId: Int) {
         val expected = context.getDrawable(resId)!!.toBitmap()
         assertThat(drawable!!.toBitmap().sameAs(expected)).isTrue()
     }
+
+    private companion object {
+        const val SKU = "ABC"
+        const val COO = "CN"
+    }
 }
diff --git a/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java b/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java
index 4f17a3a..29758de 100644
--- a/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java
+++ b/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java
@@ -32,8 +32,6 @@
 import com.android.settings.connecteddevice.stylus.StylusFeatureProvider;
 import com.android.settings.dashboard.DashboardFeatureProvider;
 import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
-import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProvider;
-import com.android.settings.deviceinfo.hardwareinfo.HardwareInfoFeatureProviderImpl;
 import com.android.settings.display.DisplayFeatureProvider;
 import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
 import com.android.settings.fuelgauge.BatterySettingsFeatureProvider;
@@ -300,11 +298,6 @@
     }
 
     @Override
-    public HardwareInfoFeatureProvider getHardwareInfoFeatureProvider() {
-        return HardwareInfoFeatureProviderImpl.INSTANCE;
-    }
-
-    @Override
     public AdvancedVpnFeatureProvider getAdvancedVpnFeatureProvider() {
         return mAdvancedVpnFeatureProvider;
     }
