diff options
author | Dianne Hackborn <hackbod@google.com> | 2009-08-20 19:31:38 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2009-08-20 20:34:42 -0700 |
commit | 3be63c09309b21c01b535271625d4c39045690e5 (patch) | |
tree | 5bc349f6c916ddb80bf852fa68de11cdfe3cfadf /core/java/android/service | |
parent | e13ec26e6cab65831eefbd7b3c7aeee9ea714c91 (diff) | |
download | frameworks_base-3be63c09309b21c01b535271625d4c39045690e5.zip frameworks_base-3be63c09309b21c01b535271625d4c39045690e5.tar.gz frameworks_base-3be63c09309b21c01b535271625d4c39045690e5.tar.bz2 |
Infrastructure for supporting wallpaper previews.
Various things that will allow us to show previews of wallpapers.
Also some fixes to animations across wallpapers.
Diffstat (limited to 'core/java/android/service')
-rw-r--r-- | core/java/android/service/wallpaper/IWallpaperService.aidl | 3 | ||||
-rw-r--r-- | core/java/android/service/wallpaper/WallpaperService.java | 25 |
2 files changed, 21 insertions, 7 deletions
diff --git a/core/java/android/service/wallpaper/IWallpaperService.aidl b/core/java/android/service/wallpaper/IWallpaperService.aidl index eb58c3b..bc7a1d7 100644 --- a/core/java/android/service/wallpaper/IWallpaperService.aidl +++ b/core/java/android/service/wallpaper/IWallpaperService.aidl @@ -23,5 +23,6 @@ import android.service.wallpaper.IWallpaperConnection; */ oneway interface IWallpaperService { void attach(IWallpaperConnection connection, - IBinder windowToken, int reqWidth, int reqHeight); + IBinder windowToken, int windowType, boolean isPreview, + int reqWidth, int reqHeight); } diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 5bb07f3..629e97e 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -212,6 +212,15 @@ public abstract class WallpaperService extends Service { } /** + * Returns true if this engine is running in preview mode -- that is, + * it is being shown to the user before they select it as the actual + * wallpaper. + */ + public boolean isPreview() { + return mIWallpaperEngine.mIsPreview; + } + + /** * Control whether this wallpaper will receive raw touch events * from the window manager as the user interacts with the window * that is currently displaying the wallpaper. By default they @@ -332,7 +341,7 @@ public abstract class WallpaperService extends Service { mLayout.token = mWindowToken; if (!mCreated) { - mLayout.type = WindowManager.LayoutParams.TYPE_WALLPAPER; + mLayout.type = mIWallpaperEngine.mWindowType; mLayout.gravity = Gravity.LEFT|Gravity.TOP; mSession.add(mWindow, mLayout, View.VISIBLE, mContentInsets); } @@ -465,6 +474,8 @@ public abstract class WallpaperService extends Service { final IWallpaperConnection mConnection; final IBinder mWindowToken; + final int mWindowType; + final boolean mIsPreview; int mReqWidth; int mReqHeight; @@ -472,10 +483,12 @@ public abstract class WallpaperService extends Service { IWallpaperEngineWrapper(WallpaperService context, IWallpaperConnection conn, IBinder windowToken, - int reqWidth, int reqHeight) { + int windowType, boolean isPreview, int reqWidth, int reqHeight) { mCaller = new HandlerCaller(context, this); mConnection = conn; mWindowToken = windowToken; + mWindowType = windowType; + mIsPreview = isPreview; mReqWidth = reqWidth; mReqHeight = reqHeight; @@ -567,10 +580,10 @@ public abstract class WallpaperService extends Service { mTarget = context; } - public void attach(IWallpaperConnection conn, - IBinder windowToken, int reqWidth, int reqHeight) { - new IWallpaperEngineWrapper( - mTarget, conn, windowToken, reqWidth, reqHeight); + public void attach(IWallpaperConnection conn, IBinder windowToken, + int windowType, boolean isPreview, int reqWidth, int reqHeight) { + new IWallpaperEngineWrapper(mTarget, conn, windowToken, + windowType, isPreview, reqWidth, reqHeight); } } |