From 6adba2467ca524b4c4f3d775de6aa10a9ad57aea Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 10 Nov 2009 11:10:09 -0800 Subject: Fix issue #2170897: wallpaper touch-up event not seen when exiting lock screen Make sure to deliver events to the wallpaper until the final up. Also fix behavior in the case where a window goes away while the pointer is still down in it, which is a fairly novel situation introduced by the new lock screen. Also add infrastructure for delivering motion events during preview. Change-Id: I0de7979be27e00caf0b1eff794ea899a815142f6 --- core/java/android/service/wallpaper/IWallpaperEngine.aidl | 3 +++ core/java/android/service/wallpaper/WallpaperService.java | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'core/java/android/service') diff --git a/core/java/android/service/wallpaper/IWallpaperEngine.aidl b/core/java/android/service/wallpaper/IWallpaperEngine.aidl index bbd9dde..37e6133 100644 --- a/core/java/android/service/wallpaper/IWallpaperEngine.aidl +++ b/core/java/android/service/wallpaper/IWallpaperEngine.aidl @@ -16,11 +16,14 @@ package android.service.wallpaper; +import android.view.MotionEvent; + /** * @hide */ oneway interface IWallpaperEngine { void setDesiredSize(int width, int height); void setVisibility(boolean visible); + void dispatchPointer(in MotionEvent event); void destroy(); } diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index e79832b..b29d837 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -746,6 +746,12 @@ public abstract class WallpaperService extends Service { mCaller.sendMessage(msg); } + public void dispatchPointer(MotionEvent event) { + if (mEngine != null) { + mEngine.mWindow.onDispatchPointer(event, event.getEventTime(), false); + } + } + public void destroy() { Message msg = mCaller.obtainMessage(DO_DETACH); mCaller.sendMessage(msg); @@ -805,6 +811,7 @@ public abstract class WallpaperService extends Service { mEngine.mPendingMove = null; } } + if (DEBUG) Log.v(TAG, "Delivering touch event: " + ev); mEngine.onTouchEvent(ev); ev.recycle(); } break; -- cgit v1.1