diff options
| -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> |