Merge "HdmiVideoExtconUEventObserver: handle "DP=1" state" into main

This commit is contained in:
Riddle Hsu
2023-07-18 07:29:17 +00:00
committed by Gerrit Code Review

View File

@@ -6131,6 +6131,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
private class HdmiVideoExtconUEventObserver extends ExtconStateObserver<Boolean> {
private static final String HDMI_EXIST = "HDMI=1";
private static final String DP_EXIST = "DP=1";
private static final String NAME = "hdmi";
private boolean init(ExtconInfo hdmi) {
@@ -6161,7 +6162,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
public Boolean parseState(ExtconInfo extconIfno, String state) {
// extcon event state changes from kernel4.9
// new state will be like STATE=HDMI=1
return state.contains(HDMI_EXIST);
// or like STATE=DP=1 for newer kernel
return state.contains(HDMI_EXIST) || state.contains(DP_EXIST);
}
}