diff --git a/src/com/android/settings/RegulatoryInfoDisplayActivity.kt b/src/com/android/settings/RegulatoryInfoDisplayActivity.kt
index 6b5ccc7..4038aa8 100644
--- a/src/com/android/settings/RegulatoryInfoDisplayActivity.kt
+++ b/src/com/android/settings/RegulatoryInfoDisplayActivity.kt
@@ -69,6 +69,6 @@
     private fun getRegulatoryText(): CharSequence? {
         val regulatoryInfoText = resources.getText(R.string.regulatory_info_text)
         if (regulatoryInfoText.isNotBlank()) return regulatoryInfoText
-        return featureFactory.hardwareInfoFeatureProvider?.countryIfOriginLabel
+        return featureFactory.hardwareInfoFeatureProvider?.countryOfOriginLabel
     }
 }
diff --git a/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProvider.kt b/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProvider.kt
index e9866d7..4b2666f 100644
--- a/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProvider.kt
+++ b/src/com/android/settings/deviceinfo/hardwareinfo/HardwareInfoFeatureProvider.kt
@@ -27,5 +27,5 @@
     /**
      * The country of origin label.
      */
-    val countryIfOriginLabel: String
+    val countryOfOriginLabel: String
 }
diff --git a/src/com/android/settings/fuelgauge/BatteryBackupHelper.java b/src/com/android/settings/fuelgauge/BatteryBackupHelper.java
index 5822397..651a1b2 100644
--- a/src/com/android/settings/fuelgauge/BatteryBackupHelper.java
+++ b/src/com/android/settings/fuelgauge/BatteryBackupHelper.java
@@ -196,7 +196,9 @@
                     appOptModeMap.containsKey(info.uid)
                             ? (int) appOptModeMap.get(info.uid).getResetOptimizationMode()
                             : BatteryOptimizeUtils.getAppOptimizationMode(
-                                    mode, allowlistedApps.contains(info.packageName));
+                                    mode,
+                                    allowlistedApps.contains(info.packageName),
+                                    /* ignoreUnknownMode= */ false);
             // Ignores default optimized/unknown state or system/default apps.
             if (optimizationMode == BatteryOptimizeUtils.MODE_OPTIMIZED
                     || optimizationMode == BatteryOptimizeUtils.MODE_UNKNOWN
diff --git a/src/com/android/settings/fuelgauge/BatteryOptimizeUtils.java b/src/com/android/settings/fuelgauge/BatteryOptimizeUtils.java
index 3233f0d..6c95823 100644
--- a/src/com/android/settings/fuelgauge/BatteryOptimizeUtils.java
+++ b/src/com/android/settings/fuelgauge/BatteryOptimizeUtils.java
@@ -100,7 +100,8 @@
 
     /** Gets the {@link OptimizationMode} based on mode and allowed list. */
     @OptimizationMode
-    public static int getAppOptimizationMode(int mode, boolean isAllowListed) {
+    public static int getAppOptimizationMode(
+            int mode, boolean isAllowListed, boolean ignoreUnknownMode) {
         if (!isAllowListed && mode == AppOpsManager.MODE_IGNORED) {
             return MODE_RESTRICTED;
         } else if (isAllowListed && mode == AppOpsManager.MODE_ALLOWED) {
@@ -108,13 +109,15 @@
         } else if (!isAllowListed && mode == AppOpsManager.MODE_ALLOWED) {
             return MODE_OPTIMIZED;
         } else {
-            return MODE_UNKNOWN;
+            // MODE_UNKNOWN = isAllowListed + AppOpsManager.MODE_IGNORED
+            // Return Unrestricted mode for Unknown mode since it is in allowlist.
+            return ignoreUnknownMode ? MODE_UNRESTRICTED : MODE_UNKNOWN;
         }
     }
 
     /** Gets the {@link OptimizationMode} for associated app. */
     @OptimizationMode
-    public int getAppOptimizationMode(boolean refreshList) {
+    public int getAppOptimizationMode(boolean refreshList, boolean ignoreUnknownMode) {
         if (refreshList) {
             mPowerAllowListBackend.refreshList();
         }
@@ -127,13 +130,13 @@
                 String.format(
                         "refresh %s state, allowlisted = %s, mode = %d",
                         mPackageName, mAllowListed, mMode));
-        return getAppOptimizationMode(mMode, mAllowListed);
+        return getAppOptimizationMode(mMode, mAllowListed, ignoreUnknownMode);
     }
 
     /** Gets the {@link OptimizationMode} for associated app. */
     @OptimizationMode
     public int getAppOptimizationMode() {
-        return getAppOptimizationMode(true);
+        return getAppOptimizationMode(/* refreshList= */ true, /* ignoreUnknownMode= */ true);
     }
 
     /** Resets optimization mode for all applications. */
@@ -246,10 +249,11 @@
             @OptimizationMode
             final int optimizationMode =
                     getAppOptimizationMode(
-                            mode, allowlistBackend.isAllowlisted(info.packageName, info.uid));
-            // Ignores default optimized/unknown state or system/default apps.
+                            mode,
+                            allowlistBackend.isAllowlisted(info.packageName, info.uid),
+                            /* ignoreUnknownMode= */ false);
+            // Ignores default optimized state or system/default apps.
             if (optimizationMode == MODE_OPTIMIZED
-                    || optimizationMode == MODE_UNKNOWN
                     || isSystemOrDefaultApp(
                             context, allowlistBackend, info.packageName, info.uid)) {
                 continue;
@@ -374,7 +378,8 @@
                         "\tStandbyMode: %s, allowListed: %s, mode: %s",
                         appStandbyMode,
                         allowListed,
-                        getAppOptimizationMode(appStandbyMode, allowListed));
+                        getAppOptimizationMode(
+                                appStandbyMode, allowListed, /* ignoreUnknownMode= */ false));
     }
 
     private static @DataChangeReason int toChangeReason(Action action) {
diff --git a/src/com/android/settings/fuelgauge/BatterySettingsStorage.java b/src/com/android/settings/fuelgauge/BatterySettingsStorage.java
index 33a8025..eeebbec 100644
--- a/src/com/android/settings/fuelgauge/BatterySettingsStorage.java
+++ b/src/com/android/settings/fuelgauge/BatterySettingsStorage.java
@@ -347,7 +347,9 @@
                         appOptModeMap.containsKey(info.uid)
                                 ? (int) appOptModeMap.get(info.uid).getResetOptimizationMode()
                                 : BatteryOptimizeUtils.getAppOptimizationMode(
-                                        mode, mAllowlistedApps.contains(info.packageName));
+                                        mode,
+                                        mAllowlistedApps.contains(info.packageName),
+                                        /* ignoreUnknownMode= */ false);
                 // Ignores default optimized/unknown state or system/default apps.
                 if (optimizationMode == BatteryOptimizeUtils.MODE_OPTIMIZED
                         || optimizationMode == BatteryOptimizeUtils.MODE_UNKNOWN
diff --git a/src/com/android/settings/fuelgauge/batteryusage/BatteryOptimizationModeCache.java b/src/com/android/settings/fuelgauge/batteryusage/BatteryOptimizationModeCache.java
index 2084b66..076676d 100644
--- a/src/com/android/settings/fuelgauge/batteryusage/BatteryOptimizationModeCache.java
+++ b/src/com/android/settings/fuelgauge/batteryusage/BatteryOptimizationModeCache.java
@@ -51,7 +51,8 @@
                     Pair.create(
                             BatteryOptimizationMode.forNumber(
                                     batteryOptimizeUtils.getAppOptimizationMode(
-                                            /* refreshList= */ false)),
+                                            /* refreshList= */ false,
+                                            /* ignoreUnknownMode= */ false)),
                             batteryOptimizeUtils.isOptimizeModeMutable()));
         }
         final Pair<BatteryOptimizationMode, Boolean> batteryOptimizeModeInfo =
diff --git a/src/com/android/settings/notification/SoundSettings.java b/src/com/android/settings/notification/SoundSettings.java
index 596f19b..b069c7e 100644
--- a/src/com/android/settings/notification/SoundSettings.java
+++ b/src/com/android/settings/notification/SoundSettings.java
@@ -195,23 +195,21 @@
     @Override
     public void onAttach(Context context) {
         super.onAttach(context);
-        if (!isCatalystEnabled()) {
-            ArrayList<VolumeSeekBarPreferenceController> volumeControllers = new ArrayList<>();
-            volumeControllers.add(use(AlarmVolumePreferenceController.class));
-            volumeControllers.add(use(MediaVolumePreferenceController.class));
-            volumeControllers.add(use(SeparateRingVolumePreferenceController.class));
-            volumeControllers.add(use(NotificationVolumePreferenceController.class));
-            volumeControllers.add(use(CallVolumePreferenceController.class));
+        ArrayList<VolumeSeekBarPreferenceController> volumeControllers = new ArrayList<>();
+        volumeControllers.add(use(AlarmVolumePreferenceController.class));
+        volumeControllers.add(use(MediaVolumePreferenceController.class));
+        volumeControllers.add(use(SeparateRingVolumePreferenceController.class));
+        volumeControllers.add(use(NotificationVolumePreferenceController.class));
+        volumeControllers.add(use(CallVolumePreferenceController.class));
 
-            use(HandsFreeProfileOutputPreferenceController.class).setCallback(listPreference ->
-                    onPreferenceDataChanged(listPreference));
-            mHfpOutputControllerKey =
-                    use(HandsFreeProfileOutputPreferenceController.class).getPreferenceKey();
+        use(HandsFreeProfileOutputPreferenceController.class).setCallback(listPreference ->
+                onPreferenceDataChanged(listPreference));
+        mHfpOutputControllerKey =
+                use(HandsFreeProfileOutputPreferenceController.class).getPreferenceKey();
 
-            for (VolumeSeekBarPreferenceController controller : volumeControllers) {
-                controller.setCallback(mVolumeCallback);
-                getSettingsLifecycle().addObserver(controller);
-            }
+        for (VolumeSeekBarPreferenceController controller : volumeControllers) {
+            controller.setCallback(mVolumeCallback);
+            getSettingsLifecycle().addObserver(controller);
         }
     }
 
diff --git a/src/com/android/settings/spa/app/battery/BatteryOptimizationModeAppListPageProvider.kt b/src/com/android/settings/spa/app/battery/BatteryOptimizationModeAppListPageProvider.kt
index f077506..5c27f5b 100644
--- a/src/com/android/settings/spa/app/battery/BatteryOptimizationModeAppListPageProvider.kt
+++ b/src/com/android/settings/spa/app/battery/BatteryOptimizationModeAppListPageProvider.kt
@@ -107,7 +107,7 @@
         PowerAllowlistBackend.getInstance(context).refreshList()
         return recordListFlow.filterItem {
             val appOptimizationMode = BatteryOptimizeUtils(context, it.app.uid, it.app.packageName)
-                .getAppOptimizationMode(/* refreshList */ false);
+                .getAppOptimizationMode(/* refreshList */ false, /* ignoreUnknownMode */ true);
             when (OptimizationModeSpinnerItem.entries.getOrNull(option)) {
                 OptimizationModeSpinnerItem.Restricted ->
                     appOptimizationMode == BatteryOptimizeUtils.MODE_RESTRICTED
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryOptimizeUtilsTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryOptimizeUtilsTest.java
index 72b49e2..41e9dca 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryOptimizeUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryOptimizeUtilsTest.java
@@ -128,6 +128,15 @@
     }
 
     @Test
+    public void testGetAppOptimizationMode_unknownMode_returnOptimized() throws Exception {
+        when(mMockBackend.isAllowlisted(anyString(), anyInt())).thenReturn(true);
+        when(mMockAppOpsManager.checkOpNoThrow(anyInt(), anyInt(), anyString()))
+                .thenReturn(AppOpsManager.MODE_IGNORED);
+
+        assertThat(mBatteryOptimizeUtils.getAppOptimizationMode()).isEqualTo(MODE_UNRESTRICTED);
+    }
+
+    @Test
     public void testIsSystemOrDefaultApp_isSystemOrDefaultApp_returnTrue() {
         when(mMockBackend.isAllowlisted(anyString(), anyInt())).thenReturn(true);
         when(mMockBackend.isDefaultActiveApp(anyString(), anyInt())).thenReturn(true);
diff --git a/tests/unit/src/com/android/settings/fuelgauge/batteryusage/AppOptModeSharedPreferencesUtilsTest.kt b/tests/unit/src/com/android/settings/fuelgauge/batteryusage/AppOptModeSharedPreferencesUtilsTest.kt
index 95f69da..385de30 100644
--- a/tests/unit/src/com/android/settings/fuelgauge/batteryusage/AppOptModeSharedPreferencesUtilsTest.kt
+++ b/tests/unit/src/com/android/settings/fuelgauge/batteryusage/AppOptModeSharedPreferencesUtilsTest.kt
@@ -228,7 +228,7 @@
     @Test
     fun updateBatteryOptimizationMode_updateToOptimizedMode_verifyAction() {
         whenever(testBatteryOptimizeUtils?.isOptimizeModeMutable).thenReturn(true)
-        whenever(testBatteryOptimizeUtils?.getAppOptimizationMode(true))
+        whenever(testBatteryOptimizeUtils?.getAppOptimizationMode())
             .thenReturn(MODE_UNRESTRICTED)
 
         val currentOptMode =
@@ -246,9 +246,9 @@
     }
 
     @Test
-    fun updateBatteryOptimizationMode_optimizationModeNotChanged_verifyAction() {
+    fun updateBatteryOptimizationMode_optimizationModeImmutable_verifyAction() {
         whenever(testBatteryOptimizeUtils?.isOptimizeModeMutable).thenReturn(false)
-        whenever(testBatteryOptimizeUtils?.getAppOptimizationMode(true))
+        whenever(testBatteryOptimizeUtils?.appOptimizationMode)
             .thenReturn(MODE_UNRESTRICTED)
 
         val currentOptMode =
@@ -268,7 +268,7 @@
     @Test
     fun updateBatteryOptimizationMode_updateToSameOptimizationMode_verifyAction() {
         whenever(testBatteryOptimizeUtils?.isOptimizeModeMutable).thenReturn(true)
-        whenever(testBatteryOptimizeUtils?.getAppOptimizationMode(true)).thenReturn(MODE_RESTRICTED)
+        whenever(testBatteryOptimizeUtils?.appOptimizationMode).thenReturn(MODE_RESTRICTED)
 
         val currentOptMode =
             AppOptModeSharedPreferencesUtils.updateBatteryOptimizationMode(
@@ -286,7 +286,7 @@
 
     private fun insertAppOptModeEventForTest(expirationTime: Long, mode: Int = MODE_OPTIMIZED) {
         whenever(testBatteryOptimizeUtils?.isOptimizeModeMutable).thenReturn(true)
-        whenever(testBatteryOptimizeUtils?.getAppOptimizationMode(true)).thenReturn(mode)
+        whenever(testBatteryOptimizeUtils?.appOptimizationMode).thenReturn(mode)
         AppOptModeSharedPreferencesUtils.updateAppOptModeExpirationInternal(
             context,
             mutableListOf(UID),
