From 4f2af261f35b1b18ddea853b2c0a226ee608ef8e Mon Sep 17 00:00:00 2001 From: Arian Date: Sun, 11 Oct 2020 15:40:19 +0200 Subject: [PATCH] davinci: parts: Delay creating MotorStatusCallback when the motor is opened * Give the motor enough time to close in case it was still opened on boot without showing the error dialog. Change-Id: Ibc00a999858f5067bbcf07bfecc779f1d0bf3664 --- .../org/lineageos/settings/popupcamera/PopupCameraService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parts/src/org/lineageos/settings/popupcamera/PopupCameraService.java b/parts/src/org/lineageos/settings/popupcamera/PopupCameraService.java index 4e69c7d..bc0ec52 100644 --- a/parts/src/org/lineageos/settings/popupcamera/PopupCameraService.java +++ b/parts/src/org/lineageos/settings/popupcamera/PopupCameraService.java @@ -140,10 +140,11 @@ public class PopupCameraService extends Service implements Handler.Callback { if (status == Constants.MOTOR_STATUS_POPUP_OK || status == Constants.MOTOR_STATUS_TAKEBACK_JAMMED) { mMotor.takebackMotor(1); + Thread.sleep(1200); } mMotorStatusCallback = new MotorStatusCallback(); mMotor.setMotorCallback(mMotorStatusCallback); - } catch (RemoteException e) { + } catch (InterruptedException | RemoteException e) { // Do nothing } }