Covert the mActiveSfDisplayModeAtStartId to framework mode id.

Bug: 213463860
Test: adb shell cmd display get-active-display-mode-at-start 0 returns
correct mode

Change-Id: I3b7b6d5554b914130b2201af1f643fc726b4b0c4
This commit is contained in:
Kriti Dang
2022-11-16 14:18:38 +01:00
parent 94f9574f29
commit ab68c9fe72

View File

@@ -209,7 +209,7 @@ final class LocalDisplayAdapter extends DisplayAdapter {
private int mUserPreferredModeId = INVALID_MODE_ID;
// This is used only for the purpose of testing, to verify if the mode was correct when the
// device started or booted.
private int mActiveDisplayModeAtStartId = INVALID_MODE_ID;
private int mActiveSfDisplayModeAtStartId = INVALID_MODE_ID;
private Display.Mode mUserPreferredMode;
private int mActiveModeId = INVALID_MODE_ID;
private boolean mDisplayModeSpecsInvalid;
@@ -241,7 +241,7 @@ final class LocalDisplayAdapter extends DisplayAdapter {
mSidekickInternal = LocalServices.getService(SidekickInternal.class);
mBacklightAdapter = new BacklightAdapter(displayToken, isFirstDisplay,
mSurfaceControlProxy);
mActiveDisplayModeAtStartId = dynamicInfo.activeDisplayModeId;
mActiveSfDisplayModeAtStartId = dynamicInfo.activeDisplayModeId;
}
@Override
@@ -255,7 +255,7 @@ final class LocalDisplayAdapter extends DisplayAdapter {
*/
@Override
public Display.Mode getActiveDisplayModeAtStartLocked() {
return findMode(mActiveDisplayModeAtStartId);
return findMode(findMatchingModeIdLocked(mActiveSfDisplayModeAtStartId));
}
/**