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

Commit 4b0fa173 authored by Michael Wright's avatar Michael Wright
Browse files

Make display mirroring for local displays configurable.

While in general we still want to mirror the content of the default
displays onto content-less displays, some devices (e.g. Android Auto)
know they're going to have a secondary display for specific
information and don't want this behavior.

Change-Id: I068cc898a4118e78a5fff67bba27ad54504d9e2f
parent 7014a3a8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1853,6 +1853,10 @@
        <item>-1</item>
    </integer-array>

    <!-- When true, local displays that do not contain any of their own content will automatically
         mirror the content of the default display. -->
    <bool name="config_localDisplaysMirrorContent">true</bool>

    <!-- When true use the linux /dev/input/event subsystem to detect the switch changes
         on the headphone/microphone jack. When false use the older uevent framework. -->
    <bool name="config_useDevInputEventForAudioJack">false</bool>
+1 −0
Original line number Diff line number Diff line
@@ -306,6 +306,7 @@
  <java-symbol type="bool" name="config_freeformWindowManagement" />
  <java-symbol type="bool" name="config_supportsMultiWindow" />
  <java-symbol type="bool" name="config_guestUserEphemeral" />
  <java-symbol type="bool" name="config_localDisplaysMirrorContent" />
  <java-symbol type="string" name="config_defaultPictureInPictureBounds" />
  <java-symbol type="string" name="config_centeredPictureInPictureBounds" />
  <java-symbol type="string" name="config_pictureInPictureBoundsInRecents" />
+6 −1
Original line number Diff line number Diff line
@@ -381,8 +381,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
                            | DisplayDeviceInfo.FLAG_SUPPORTS_PROTECTED_BUFFERS;
                }

                if (mBuiltInDisplayId == SurfaceControl.BUILT_IN_DISPLAY_ID_MAIN) {
                final Resources res = getContext().getResources();
                if (mBuiltInDisplayId == SurfaceControl.BUILT_IN_DISPLAY_ID_MAIN) {
                    mInfo.name = res.getString(
                            com.android.internal.R.string.display_manager_built_in_display_name);
                    mInfo.flags |= DisplayDeviceInfo.FLAG_DEFAULT_DISPLAY
@@ -416,6 +416,11 @@ final class LocalDisplayAdapter extends DisplayAdapter {
                    if (SystemProperties.getBoolean("persist.demo.hdmirotates", false)) {
                        mInfo.flags |= DisplayDeviceInfo.FLAG_ROTATES_WITH_CONTENT;
                    }

                    if (!res.getBoolean(
                                com.android.internal.R.bool.config_localDisplaysMirrorContent)) {
                        mInfo.flags |= DisplayDeviceInfo.FLAG_OWN_CONTENT_ONLY;
                    }
                }
            }
            return mInfo;