[HDR]:UserDisabledHdrTypes is not updated after system reboot

After system boots,the UserDisabledHdrTypes also needs to be updated
in the display information.

Bug:265724287

Test: Prepare a HDR/DolbyVision TV which supports DolbyVision/HDR10/HLG.
1.Connect the STB to the TV.
2.On UI Settings -> Device Preferences -> Display & Sound -> Advanced
  Display settings -> Format Selection,choose manual,disable DolbyVision
  format and keep HDR10/HLG formats enabled.
3.Reboot STB ,Check 2) , it is same as previous saved result.
4.Open Netflix, search DolbyVision contents movie and check the format.
  It should only list HDR contents, no DolbyVision contents.

Change-Id: I4c38532ad973a85c289796a9372413bd5491ca26
Signed-off-by: wangn <nan.wang@vantiva.net>
This commit is contained in:
wangn
2023-01-19 16:19:30 +08:00
committed by Kriti Dang
parent 6964ec7ba2
commit 8a6745e902

View File

@@ -845,6 +845,15 @@ public final class DisplayManagerService extends SystemService {
for (int i = 0; i < userDisabledHdrTypeStrings.length; i++) {
mUserDisabledHdrTypes[i] = Integer.parseInt(userDisabledHdrTypeStrings[i]);
}
if (!mAreUserDisabledHdrTypesAllowed) {
mLogicalDisplayMapper.forEachLocked(
display -> {
display.setUserDisabledHdrTypes(mUserDisabledHdrTypes);
handleLogicalDisplayChangedLocked(display);
});
}
} catch (NumberFormatException e) {
Slog.e(TAG, "Failed to parse USER_DISABLED_HDR_FORMATS. "
+ "Clearing the setting.", e);
@@ -872,6 +881,15 @@ public final class DisplayManagerService extends SystemService {
Settings.Global.USER_PREFERRED_RESOLUTION_WIDTH, Display.INVALID_DISPLAY_WIDTH);
Display.Mode mode = new Display.Mode(width, height, refreshRate);
mUserPreferredMode = isResolutionAndRefreshRateValid(mode) ? mode : null;
if (mUserPreferredMode != null) {
mDisplayDeviceRepo.forEachLocked((DisplayDevice device) -> {
device.setUserPreferredDisplayModeLocked(mode);
});
} else {
mLogicalDisplayMapper.forEachLocked((LogicalDisplay display) -> {
configurePreferredDisplayModeLocked(display);
});
}
}
private DisplayInfo getDisplayInfoForFrameRateOverride(DisplayEventReceiver.FrameRateOverride[]