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

Commit 24b7260a authored by Marzia Favaro's avatar Marzia Favaro
Browse files

Create config to enable app handle independently from desktop mode

By default this is disabled. This change is not yet enabling this on any
device

Bug: 377689543
Test: N/A
Flag: com.android.window.flags.show_app_handle_large_screens
Change-Id: If52a842ecebccadc5a64794774d3099f09ce4e29
parent ed1405fe
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -199,6 +199,13 @@ flag {
  bug: "357141415"
}

flag {
  name: "show_app_handle_large_screens"
  namespace: "windowing_frontend"
  description: "Show the app handle and the app menu also on large screens that don't enable desktop mode"
  bug: "377689543"
}

flag {
  name: "filter_irrelevant_input_device_change"
  namespace: "windowing_frontend"
+4 −0
Original line number Diff line number Diff line
@@ -7184,6 +7184,10 @@
         screen. -->
    <bool name="config_dragToMaximizeInDesktopMode">false</bool>

    <!-- Whether showing the app handle is supported on this device.
         If config_isDesktopModeSupported, then this has no effect -->
    <bool name="config_enableAppHandle">false</bool>

    <!-- Frame rate compatibility value for Wallpaper
         FRAME_RATE_COMPATIBILITY_MIN (102) is used by default for lower power consumption -->
    <integer name="config_wallpaperFrameRateCompatibility">102</integer>
+3 −0
Original line number Diff line number Diff line
@@ -5634,6 +5634,9 @@
       screen. -->
  <java-symbol type="bool" name="config_dragToMaximizeInDesktopMode" />

  <!-- Whether showing the app handle is supported on this device -->
  <java-symbol type="bool" name="config_enableAppHandle" />

  <!-- Frame rate compatibility value for Wallpaper -->
  <java-symbol type="integer" name="config_wallpaperFrameRateCompatibility" />

+17 −0
Original line number Diff line number Diff line
@@ -190,6 +190,23 @@ public class DesktopModeStatus {
        return DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_MODE.isTrue();
    }

    /**
     * @return {@code true} if this device is requesting to show the app handle despite non
     * necessarily enabling desktop mode
     */
    public static boolean overridesShowAppHandle(@NonNull Context context) {
        return Flags.showAppHandleLargeScreens()
                && context.getResources().getBoolean(R.bool.config_enableAppHandle);
    }

    /**
     * @return {@code true} if the app handle should be shown because desktop mode is enabled or
     * the device is overriding {@code R.bool.config_enableAppHandle}
     */
    public static boolean canEnterDesktopModeOrShowAppHandle(@NonNull Context context) {
        return canEnterDesktopMode(context) || overridesShowAppHandle(context);
    }

    /**
     * Return {@code true} if the override desktop density is enabled and valid.
     */