diff options
| author | 2024-02-28 13:25:59 +0530 | |
|---|---|---|
| committer | 2024-03-28 09:28:11 -0700 | |
| commit | 1a37d86d4f288ff55a601e69fde1502acfa6d027 (patch) | |
| tree | efbcdd7e40c56e9a621223b28541b25ff5fb0fd2 | |
| parent | 8f5a75cd2e0accc67e6c3ca7b003ba33bc71dec6 (diff) | |
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
| -rw-r--r-- | core/java/android/service/wallpaper/WallpaperService.java | 9 | ||||
| -rw-r--r-- | core/res/res/values/config.xml | 4 | ||||
| -rw-r--r-- | core/res/res/values/symbols.xml | 3 |
3 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index f6d197ca4f93..0fc51e74d570 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -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. diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index a926a705bc07..7a5dc63305f0 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -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> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index fe4e4f0488e3..aabc4567192e 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -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> |