Skip to content

Commit da1c93a

Browse files
Yong Chenshuogao
authored andcommitted
Tests/RS: Add RS context check for RsBalls setAccel()
mRS could be null when lock and unlock screen by pressing power key several times, it causes RsBalls crash. Add null pointer check to fix. Change-Id: If37dee8609420daaff17772d5194cad5531f98e6 Author: Yong Chen <yong.a.chen@intel.com> Signed-off-by: Yong Chen <yong.a.chen@intel.com> Singed-off-by: Shuo Gao <shuo.gao@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Author-tracking-BZ: 31271
1 parent a950daf commit da1c93a

File tree

1 file changed

+1
-1
lines changed
  • tests/RenderScriptTests/Balls/src/com/example/android/rs/balls

1 file changed

+1
-1
lines changed

tests/RenderScriptTests/Balls/src/com/example/android/rs/balls/BallsView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public boolean onTouchEvent(MotionEvent ev)
105105
}
106106

107107
void setAccel(float x, float y, float z) {
108-
if (mRender == null) {
108+
if ((mRender == null) || (mRS == null)) {
109109
return;
110110
}
111111
mRender.setAccel(x, -y);

0 commit comments

Comments
 (0)