davinci: parts: Try to take the motor back on boot when opened
Co-authored-by: Arian <arian.kulmer@web.de> Change-Id: I36ff53e23221b6704f0fa5e108329722cf71f504
This commit is contained in:
parent
619c58031f
commit
b4dca743ea
@ -134,9 +134,23 @@ public class PopupCameraService extends Service implements Handler.Callback {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onBootCompleted(){
|
||||||
|
try {
|
||||||
|
int status = mMotor.getMotorStatus();
|
||||||
|
if (status == Constants.MOTOR_STATUS_POPUP ||
|
||||||
|
status == Constants.MOTOR_STATUS_TAKEBACK_JAM) {
|
||||||
|
if (DEBUG) Log.d(TAG, "Opened front camera detected, taking back");
|
||||||
|
mMotor.takebackMotor(1);
|
||||||
|
}
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
if (DEBUG) Log.d(TAG, "Starting service");
|
if (DEBUG) Log.d(TAG, "Starting service");
|
||||||
|
onBootCompleted();
|
||||||
return START_STICKY;
|
return START_STICKY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user