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

Commit b7d43f18 authored by Marzia Favaro's avatar Marzia Favaro Committed by Android (Google) Code Review
Browse files

Merge "Create config to enable app handle independently from desktop mode" into main

parents baec17e1 24b7260a
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
@@ -5635,6 +5635,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.
     */