Merge "Fix NPE in ScreenshotHelper" into rvc-dev

This commit is contained in:
Miranda Kephart
2020-05-13 16:20:14 +00:00
committed by Android (Google) Code Review

View File

@@ -132,6 +132,7 @@ public class ScreenshotHelper {
}
};
}
private static final String TAG = "ScreenshotHelper";
// Time until we give up on the screenshot & show an error instead.
@@ -146,8 +147,6 @@ public class ScreenshotHelper {
mContext = context;
}
/**
* Request a screenshot be taken.
*
@@ -284,8 +283,8 @@ public class ScreenshotHelper {
break;
case SCREENSHOT_MSG_PROCESS_COMPLETE:
synchronized (mScreenshotLock) {
if (mScreenshotConnection == myConn) {
mContext.unbindService(mScreenshotConnection);
if (myConn != null && mScreenshotConnection == myConn) {
mContext.unbindService(myConn);
mScreenshotConnection = null;
mScreenshotService = null;
}