Control commit

This commit is contained in:
Captain Arepa 2024-05-28 15:24:22 -04:00
parent 1ad060a816
commit 35a3f6cba3

View file

@ -275,7 +275,8 @@ public class SegpassCamera {
mBackgroundThread.join(); mBackgroundThread.join();
mBackgroundThread = null; mBackgroundThread = null;
mBackgroundHandler = null; mBackgroundHandler = null;
} catch (Exception e) { } catch (InterruptedException e) {
mBackgroundThread.interrupt();
Log.d(TAG, "InterruptedException@stopBackgroundThread(): " + e.getMessage()); Log.d(TAG, "InterruptedException@stopBackgroundThread(): " + e.getMessage());
} }
} }
@ -515,7 +516,8 @@ public class SegpassCamera {
} catch (CameraAccessException e) { } catch (CameraAccessException e) {
Log.e(TAG, "CameraAccessException@openCamera(): " + e.getMessage()); Log.e(TAG, "CameraAccessException@openCamera(): " + e.getMessage());
mCameraCallback.onCameraInitError(e.getMessage()); mCameraCallback.onCameraInitError(e.getMessage());
} catch (Exception e) { } catch (InterruptedException e) {
mBackgroundThread.interrupt();
Log.e(TAG, "InterruptedException@openCamera(): " + e.getMessage()); Log.e(TAG, "InterruptedException@openCamera(): " + e.getMessage());
} }
} }
@ -538,7 +540,8 @@ public class SegpassCamera {
mImageReader.close(); mImageReader.close();
mImageReader = null; mImageReader = null;
} }
} catch (Exception e) { } catch (InterruptedException e) {
mBackgroundThread.interrupt();
Log.e(TAG, "InterruptedException@closeCamera(): " + e.getMessage()); Log.e(TAG, "InterruptedException@closeCamera(): " + e.getMessage());
} finally { } finally {
mCameraOpenCloseLock.release(); mCameraOpenCloseLock.release();