Update when Desktop Mode Dev Option is enabled by default.

The new condition requires accessing the context.

Bug: 382238347
Flag: EXEMPT Bug fix
Test: atest DesktopModePreferenceControllerTest
Test: Build and test on devices with only the dev option enabled.
Change-Id: If9cacea948ccee2bc5a5b4fae07f3ad69efb0af2
This commit is contained in:
Pierre Barbier de Reuille
2025-01-24 13:05:37 +00:00
parent 5161aff82e
commit 0a49a01210

View File

@@ -89,7 +89,7 @@ public class DesktopModePreferenceController extends DeveloperOptionsPreferenceC
final boolean shouldDevOptionBeEnabled = switch (toggleOverride) {
case OVERRIDE_OFF -> false;
case OVERRIDE_ON -> true;
case OVERRIDE_UNSET -> DesktopModeStatus.shouldDevOptionBeEnabledByDefault();
case OVERRIDE_UNSET -> DesktopModeStatus.shouldDevOptionBeEnabledByDefault(mContext);
};
((TwoStatePreference) mPreference).setChecked(shouldDevOptionBeEnabled);
}