Unbind screenshot connection even if the binding attempt fails

Bug: 273563486
Test: manual, by forcing the bindServiceAsUser method to return false
for screenshots after connecting. we do get spurious logs in that case
before the fix, but not after.

Change-Id: Ic729a3aad9dc7f7a6c396746c6c8ae706384fb5f
This commit is contained in:
Miranda Kephart
2023-03-14 15:33:35 -04:00
parent 9d177c7193
commit 4870ad4018

View File

@@ -195,6 +195,8 @@ public class ScreenshotHelper {
UserHandle.CURRENT)) {
mScreenshotConnection = conn;
handler.postDelayed(mScreenshotTimeout, timeoutMs);
} else {
mContext.unbindService(conn);
}
} else {
Messenger messenger = new Messenger(mScreenshotService);