From a8e5a2bcd6a0d35893187c6df42425c03be005da Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Fri, 28 Oct 2011 13:18:16 -0700 Subject: Optimize handling of scrolled wallpapers Swiping the home screen causes the WindowManagerService to do a bunch of work to keep the wallpapers in sync. First, it lays out and places all windows. Also, it notifies the SystemUI process that the wallpaper position has changed. The layout/place operation is too much work - we only need to set the position values for the wallpaper, not relayout the whole system. The notification mechanism must exist, but should be optional. Most wallpapers don't care (especially static ImageWallpapers). So we'll give them a new API (WallpaperService.Engine.setWantsOffsets()) to allow wallpapers to opt out of this process and avoid the performance overhead. Change-Id: I66c38375438937f14f6f5550565b28eb204b1e06 --- core/java/android/view/WindowManager.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/java/android/view/WindowManager.java') diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index e8ab22715d58..e74fec6082a4 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -812,6 +812,17 @@ public interface WindowManager extends ViewManager { */ public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002; + /** + * By default, wallpapers are sent new offsets when the wallpaper is scrolled. Wallpapers + * may elect to skp these notifications if they are no doing anything productive with + * them (they do not affect the wallpaper scrolling operation) by calling + * {@link + * android.service.wallpaper.WallpaperService.Engine#setOffsetNotificationsEnabled(boolean)}. + * + * @hide + */ + public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004; + /** * Control flags that are private to the platform. * @hide -- cgit v1.2.3