From 2118fe717fc2ce7164ac8fcb645a3fe7140a6fe6 Mon Sep 17 00:00:00 2001 From: Kunhung Li Date: Wed, 17 Apr 2019 13:49:40 +0800 Subject: Fix touch is being consumed by customizable panel This is caused by dispatching touch event to wallpaper engine without conditions. It will check if there is no other view to handle touch event then dispatch to wallpaper engine. Bug: 130681068 Test: Manual test Change-Id: Ie59e8af5afbfa4ac5e3d0bfe52faf3c4d7259ac0 --- .../android/wallpaper/livepicker/LiveWallpaperPreview.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java b/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java index 9cd50c3..7cfdb4d 100644 --- a/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java +++ b/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java @@ -504,14 +504,6 @@ public class LiveWallpaperPreview extends Activity { @Override public boolean dispatchTouchEvent(MotionEvent ev) { - if (mWallpaperConnection != null && mWallpaperConnection.mEngine != null) { - MotionEvent dup = MotionEvent.obtainNoHistory(ev); - try { - mWallpaperConnection.mEngine.dispatchPointer(dup); - } catch (RemoteException e) { - } - } - if (ev.getAction() == MotionEvent.ACTION_DOWN) { onUserInteraction(); } @@ -521,6 +513,12 @@ public class LiveWallpaperPreview extends Activity { } if (!handled && mWallpaperConnection != null && mWallpaperConnection.mEngine != null) { + MotionEvent dup = MotionEvent.obtainNoHistory(ev); + try { + mWallpaperConnection.mEngine.dispatchPointer(dup); + } catch (RemoteException e) { + } + int action = ev.getActionMasked(); try { if (action == MotionEvent.ACTION_UP) { -- cgit v1.2.3