android: rockchip: Minor fixes for HDMI & rotation

Signed-off-by: hmz007 <hmz007@gmail.com>
master
hmz007 6 years ago
parent 6dc96aef5b
commit 8e003cc651

@ -677,6 +677,18 @@ final class LogicalDisplay {
int orientation = Surface.ROTATION_0;
if ((displayDeviceInfo.flags & DisplayDeviceInfo.FLAG_ROTATES_WITH_CONTENT) != 0) {
orientation = displayInfo.rotation;
// Fixup the orientation of HDMI for portrait built-in display
if (displayDeviceInfo.type == Display.TYPE_EXTERNAL) {
DisplayDeviceInfo primaryDeviceInfo = mPrimaryDisplayDevice.getDisplayDeviceInfoLocked();
if (primaryDeviceInfo.width < primaryDeviceInfo.height) {
if (displayInfo.logicalWidth < displayInfo.logicalHeight) {
orientation += Surface.ROTATION_90;
} else if (displayInfo.rotation > 0) {
orientation -= Surface.ROTATION_90;
}
}
}
}
// Apply the physical rotation of the display device itself.

@ -12380,8 +12380,9 @@
<string name="help_url_screenshot" translatable="false"></string>
<!--hdmi settings-->
<string name="hdmi_settings">HDMI</string>
<string name="system_rotation">System Direction</string>
<string name="hdmi_settings">HDMI &amp; Rotation</string>
<string name="hdmi_dashboard_summary">Set preferred Resolution, Overscan and Rotation</string>
<string name="system_rotation">Display Rotation</string>
<string name="screen_title">Screen Setting</string>
<string name="screen_main_title">Main Screen</string>
<string name="screen_aux_title">Aux Screen</string>

@ -184,6 +184,7 @@
<Preference
android:key="hdmi_settings"
android:title="@string/hdmi_settings"
android:summary="@string/hdmi_dashboard_summary"
settings:keywords="@string/hdmi_settings"
android:fragment="com.android.settings.display.HdmiSettings" />

@ -100,6 +100,7 @@ public class HdmiSettings extends SettingsPreferenceFragment
private String main_switch_node = SYS_NODE_HDMI_STATUS;
private String aux_switch_node = SYS_NODE_DP_STATUS;
private boolean mShowSystemRotation = true;
private ListPreference mSystemRotation;
private PreferenceCategory mAuxCategory;
private CheckBoxPreference mAuxScreenVH;
@ -329,9 +330,7 @@ public class HdmiSettings extends SettingsPreferenceFragment
}
private void init() {
//boolean showSystemRotation = mShowSettings != DISPLAY_SHOW_SETTINGS.ONLY_SHOW_AUX;
boolean showSystemRotation = false;
if (showSystemRotation) {
if (mShowSystemRotation) {
mSystemRotation = (ListPreference) findPreference(KEY_SYSTEM_ROTATION);
mSystemRotation.setOnPreferenceChangeListener(this);
try {
@ -357,7 +356,8 @@ public class HdmiSettings extends SettingsPreferenceFragment
}
} else {
removePreference(KEY_SYSTEM_ROTATION);
}//这边
}
int displayNumber = DrmDisplaySetting.getDisplayNumber();
Log.v(TAG, "displayNumber=" + displayNumber);
String[] connectorInfos = DrmDisplaySetting.getConnectorInfo();
@ -366,6 +366,7 @@ public class HdmiSettings extends SettingsPreferenceFragment
Log.v(TAG, i + " connectorInfo====" + connectorInfos[i]);
}
}
mDisplayInfoList.clear();
for (int i = 0; i < displayNumber; i++) {
String typeName = "";

Loading…
Cancel
Save