JDK-8345677 : Add reducedData preference
  • Type: CSR
  • Component: javafx
  • Sub-Component: graphics
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: jfx24
  • Submitted: 2024-12-06
  • Updated: 2025-01-06
  • Resolved: 2025-01-06
Related Reports
CSR :  
Description
Summary
-------

Add the `reducedData` platform preference.

Problem
-------

Users on a limited-data network will often request applications to minimize internet traffic. The `reducedData` preference allows JavaFX applications to detect this user request.

Solution
--------

The `reducedData` preference corresponds to the following OS settings:

Windows: Settings -> Network and Internet -> Ethernet/WiFi -> Metered connection

macOS: Settings -> Network -> Ethernet/WiFi -> Network Settings -> Low data mode

Ubuntu: Settings -> Network -> Wired/WiFi -> Metered connection

Specification
-------------

    --- a/modules/javafx.graphics/src/main/java/javafx/application/Platform.java
    +++ b/modules/javafx.graphics/src/main/java/javafx/application/Platform.java
    @@ -498,6 +498,7 @@
          *         <tr><td>{@code Windows.UIColor.AccentLight3}</td><td>{@link Color}</td></tr>
          *         <tr><td>{@code Windows.UISettings.AdvancedEffectsEnabled}</td><td>{@link Boolean}</td></tr>
          *         <tr><td>{@code Windows.UISettings.AutoHideScrollBars}</td><td>{@link Boolean}</td></tr>
    +     *         <tr><td>{@code Windows.NetworkInformation.InternetCostType}</td><td>{@link String}</td></tr>
          *         <tr></tr>
          *     </tbody>
          * </table>
    @@ -553,6 +554,8 @@
          *         <tr><td>{@code macOS.NSWorkspace.accessibilityDisplayShouldReduceMotion}</td><td>{@link Boolean}</td></tr>
          *         <tr><td>{@code macOS.NSWorkspace.accessibilityDisplayShouldReduceTransparency}</td><td>{@link Boolean}</td></tr>
          *         <tr><td>{@code macOS.NSScroller.preferredScrollerStyle}</td><td>{@link String}</td></tr>
    +     *         <tr><td>{@code macOS.NWPathMonitor.currentPathConstrained}</td><td>{@link Boolean}</td></tr>
    +     *         <tr><td>{@code macOS.NWPathMonitor.currentPathExpensive}</td><td>{@link Boolean}</td></tr>
          *         <tr></tr>
          *     </tbody>
          * </table>
    @@ -580,6 +583,7 @@
          *         <tr><td>{@code GTK.success_color}</td><td>{@link Color}</td></tr>
          *         <tr><td>{@code GTK.enable_animations}</td><td>{@link Boolean}</td></tr>
          *         <tr><td>{@code GTK.overlay_scrolling}</td><td>{@link Boolean}</td></tr>
    +     *         <tr><td>{@code GTK.network_metered}</td><td>{@link Boolean}</td></tr>
          *         <tr></tr>
          *     </tbody>
          * </table>
    @@ -631,6 +635,20 @@
     
             boolean isReducedTransparency();
     
    +        /**
    +         * Specifies whether applications should minimize the amount of internet traffic, which users
    +         * might request because they are on a metered network or a limited data plan.
    +         * <p>
    +         * If the platform does not report this preference, this property defaults to {@code false}.
    +         *
    +         * @return the {@code reducedData} property
    +         * @defaultValue {@code false}
    +         * @since 24
    +         */
    +        ReadOnlyBooleanProperty reducedDataProperty();
    +
    +        boolean isReducedData();
    +
             /**
              * The platform color scheme, which specifies whether applications should prefer light text on
              * dark backgrounds, or dark text on light backgrounds.

Comments
Moving to Approved.
06-01-2025

Looks good. Go ahead and Finalize the CSR.
20-12-2024

This looks good to me. I'll formally "Review" it when I review the PR. It is simple enough that you can go straight to Finalized once reviewed.
12-12-2024