Prevent notifyScreenshotError() from calling twice
Found this while investigating the attached bug.
Fixes potential race condition between onServiceDisconnected and
mScreenshotTimeout both calling notifyScreenshotError.
If onServiceDisconnected is going to show an error to the user, I think
it should also unbind, as we would expect the user to re-take the shot
at that point. Ideally, this would replace the timeout handler entirely.
Not exactly sure how to test this - I tried crashing the
TakeScreenshotService locally, but onServiceDisconnected didn't trigger.
Bug: 28982719
Change-Id: I5093c61735b0661f9874c686e197cd894c3ef7ae
1 file changed