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

Commit 1a37d86d authored by Ibrahim Pasha's avatar Ibrahim Pasha Committed by Lucas Dupin
Browse files

Make wallpaper default frame rate configurable

This change introduces a configuration option to adjust the frame rate
compatibility value for Wallpaper BBQ wrapper.
The frame rate value can be adjusted via RRO, providing more flexibility
in managing wallpaper performance across different device configurations.
The default value is FRAME_RATE_COMPATIBILITY_MIN (102) for lower power
consumption.

Bug: 326279062
Test: manual (check fps on live wallpapers)
Flag: NA (AOSP contribution from Sony)
Change-Id: I5cf13d3418eb29c642a564db2ffc75789c6c2b0f
parent 8f5a75cd
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ import android.window.ActivityWindowInfo;
import android.window.ClientWindowFrames;
import android.window.ScreenCapture;

import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.os.HandlerCaller;
@@ -1283,8 +1284,14 @@ public abstract class WallpaperService extends Service {
                                    .build();
                            SurfaceControl.Transaction transaction =
                                    new SurfaceControl.Transaction();
                            final int frameRateCompat = getResources().getInteger(
                                    R.integer.config_wallpaperFrameRateCompatibility);
                            if (DEBUG) {
                                Log.d(TAG, "Set frame rate compatibility value for Wallpaper: "
                                        + frameRateCompat);
                            }
                            transaction.setDefaultFrameRateCompatibility(mBbqSurfaceControl,
                                Surface.FRAME_RATE_COMPATIBILITY_MIN).apply();
                                    frameRateCompat).apply();
                        }
                        // Propagate transform hint from WM, so we can use the right hint for the
                        // first frame.
+4 −0
Original line number Diff line number Diff line
@@ -6990,4 +6990,8 @@

    <!-- Whether desktop mode is supported on the current device  -->
    <bool name="config_isDesktopModeSupported">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>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -5394,4 +5394,7 @@

  <!-- Whether desktop mode is supported on the current device  -->
  <java-symbol type="bool" name="config_isDesktopModeSupported" />

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