OSDN Git Service
(root)
/
android-x86
/
packages-apps-Camera2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e2d59dc
)
Prevent NPE in gesture handling.
author
Angus Kong
<shkong@google.com>
Tue, 1 Oct 2013 18:32:52 +0000
(11:32 -0700)
committer
Angus Kong
<shkong@google.com>
Tue, 1 Oct 2013 18:32:52 +0000
(11:32 -0700)
bug:
11023769
Change-Id: Iee9e5c2d295378f327c3b01349eda5d80a579ed7
src/com/android/camera/PreviewGestures.java
patch
|
blob
|
history
diff --git
a/src/com/android/camera/PreviewGestures.java
b/src/com/android/camera/PreviewGestures.java
index
466172b
..
91f5675
100644
(file)
--- a/
src/com/android/camera/PreviewGestures.java
+++ b/
src/com/android/camera/PreviewGestures.java
@@
-76,6
+76,10
@@
public class PreviewGestures
@Override
public boolean onScroll (MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
+ if (e1 == null) {
+ // e1 can be null if for some cases.
+ return false;
+ }
if (mZoomOnly || mMode == MODE_ZOOM) return false;
int deltaX = (int) (e1.getX() - e2.getX());
int deltaY = (int) (e1.getY() - e2.getY());