summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2016-06-27 17:06:22 +0000
committer android-build-merger <android-build-merger@google.com> 2016-06-27 17:06:22 +0000
commit8a953d02d963add685e1c82480fb324c60e3e4b8 (patch)
treec7b9429f6c721c3747991cb6a32c51aae9e24788
parent3e81ab2c73db1e82f35055586b08716ba2dd7773 (diff)
parent02e391585d1a7eeccba13d02c69bd2e31cfddc0e (diff)
Merge \"Add missing null checks\" into nyc-dev
am: 02e391585d Change-Id: Ib081c05d197b01ec3a9039941dd1265bf0b9b92c
-rw-r--r--core/java/android/view/SurfaceView.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index ac43bb7adb8c..203b82563ef8 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -745,6 +745,12 @@ public class SurfaceView extends View {
Log.d(TAG, String.format("%d windowPositionLostRT RT, frameNr = %d",
System.identityHashCode(this), frameNumber));
}
+ IWindowSession session = mSession;
+ MyWindow window = mWindow;
+ if (session == null || window == null) {
+ // We got detached prior to receiving this, abort
+ return;
+ }
if (mRtHandlingPositionUpdates) {
mRtHandlingPositionUpdates = false;
// This callback will happen while the UI thread is blocked, so we can
@@ -757,7 +763,7 @@ public class SurfaceView extends View {
"postion = [%d, %d, %d, %d]", System.identityHashCode(this),
mWinFrame.left, mWinFrame.top,
mWinFrame.right, mWinFrame.bottom));
- mSession.repositionChild(mWindow, mWinFrame.left, mWinFrame.top,
+ session.repositionChild(window, mWinFrame.left, mWinFrame.top,
mWinFrame.right, mWinFrame.bottom, frameNumber, mWinFrame);
} catch (RemoteException ex) {
Log.e(TAG, "Exception from relayout", ex);