From c6ef99ae64b2c1fe399f13ac7c9634cc33db57b1 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 26 Mar 2021 20:17:44 +0100 Subject: close handle on requestaccess failure --- app/src/main/java/com/javispedro/rempe/Device.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/src/main/java') diff --git a/app/src/main/java/com/javispedro/rempe/Device.java b/app/src/main/java/com/javispedro/rempe/Device.java index 9258393..f4f2cce 100644 --- a/app/src/main/java/com/javispedro/rempe/Device.java +++ b/app/src/main/java/com/javispedro/rempe/Device.java @@ -177,6 +177,9 @@ public class Device { mCurState = initialDeviceState; if (resultCode == RequestAccessResult.SUCCESS) { setEnvPcc(result); + } else { + mEnvPccHandle.close(); + mEnvPccHandle = null; } if (mObserver != null) { mObserver.onDeviceSearchFinished(resultCode); -- cgit v1.2.3