Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3bb4afa authored by Manoj Kumar AVM's avatar Manoj Kumar AVM Committed by Ricardo Cerqueira
Browse files

framework: update WFD session orientation based on UIBC rotation

User Input Back Channel (UIBC) support in Wifi Display stack
allows the sink to send control/commands/preferences to the source
e.g. touch, keyboard/mouse entry, or orientation/rotation.

PhoneWindowManager needs to listen for UIBC rotation
intents and update the preferred rotation when WFD is active.

Note: HDMI rotation lock overrides WiFi Display UIBC rotation.

Change-Id: I1869b21c3c03b5b36c5381933b50dfbfeca88db6
Conflicts:
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
parent 0b11476f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -556,7 +556,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private static final int MSG_DISPATCH_SHOW_GLOBAL_ACTIONS = 10;
    private static final int MSG_HIDE_BOOT_MESSAGE = 11;
    private static final int MSG_LAUNCH_VOICE_ASSIST_WITH_WAKE_LOCK = 12;
    boolean mWifiDisplayConnected;
    boolean mWifiDisplayConnected = false;
    int     mWifiDisplayCustomRotation = -1;

    private class PolicyHandler extends Handler {
        @Override
@@ -4872,6 +4873,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                } else {
                    mWifiDisplayConnected = false;
                }
                mWifiDisplayCustomRotation =
                        intent.getIntExtra("wfd_UIBC_rot", -1);
                updateRotation(true);
            }
        }
@@ -5203,6 +5206,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                // Ignore sensor when plugged into HDMI when demo HDMI rotation lock enabled.
                // Note that the dock orientation overrides the HDMI orientation.
                preferredRotation = mDemoHdmiRotation;
            } else if ( mWifiDisplayConnected && (mWifiDisplayCustomRotation > -1)) {
                // Ignore sensor when WFD is active and UIBC rotation is enabled
                preferredRotation = mWifiDisplayCustomRotation;
            } else if (mHdmiPlugged && mDockMode == Intent.EXTRA_DOCK_STATE_UNDOCKED
                    && mUndockedHdmiRotation >= 0) {
                // Ignore sensor when plugged into HDMI and an undocked orientation has