Program: 95009
Project: 95009
Buggy source:
@Override public void onDroneEvent(DroneInterfaces.DroneEventsType event,Drone drone){
  final IDroidPlannerApiCallback callback=getCallback();
  Bundle extrasBundle;
  try {
switch (event) {
case DISCONNECTED:
      callback.onDroneEvent(Event.EVENT_DISCONNECTED,emptyBundle);
    break;
case GUIDEDPOINT:
  callback.onDroneEvent(Event.EVENT_GUIDED_POINT,emptyBundle);
break;
case NAVIGATION:
break;
case RADIO:
callback.onDroneEvent(Event.EVENT_RADIO,emptyBundle);
break;
case RC_IN:
break;
case RC_OUT:
break;
case ARMING_STARTED:
case ARMING:
callback.onDroneEvent(Event.EVENT_ARMING,emptyBundle);
break;
case AUTOPILOT_WARNING:
String warning=drone.getState().getWarning();
extrasBundle=new Bundle();
extrasBundle.putString(Extra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE,warning);
callback.onDroneEvent(Event.EVENT_AUTOPILOT_FAILSAFE,extrasBundle);
break;
case MODE:
callback.onDroneEvent(Event.EVENT_VEHICLE_MODE,emptyBundle);
break;
case ATTITUDE:
case ORIENTATION:
callback.onDroneEvent(Event.EVENT_ATTITUDE,emptyBundle);
break;
case SPEED:
callback.onDroneEvent(Event.EVENT_SPEED,emptyBundle);
break;
case BATTERY:
callback.onDroneEvent(Event.EVENT_BATTERY,emptyBundle);
break;
case STATE:
callback.onDroneEvent(Event.EVENT_STATE,emptyBundle);
break;
case MISSION_UPDATE:
break;
case MISSION_RECEIVED:
break;
case FIRMWARE:
case TYPE:
callback.onDroneEvent(Event.EVENT_TYPE_UPDATED,emptyBundle);
break;
case HOME:
callback.onDroneEvent(Event.EVENT_HOME,emptyBundle);
break;
case GPS:
callback.onDroneEvent(Event.EVENT_GPS,emptyBundle);
break;
case GPS_FIX:
case GPS_COUNT:
callback.onDroneEvent(Event.EVENT_GPS_STATE,emptyBundle);
break;
case PARAMETER:
case PARAMETERS_DOWNLOADED:
callback.onDroneEvent(Event.EVENT_PARAMETERS_RECEIVED,emptyBundle);
break;
case CALIBRATION_IMU:
callback.onDroneEvent(Event.EVENT_CALIBRATION_IMU,emptyBundle);
break;
case CALIBRATION_TIMEOUT:
final Calibration calibration=getDroneMgr().getDrone().getCalibrationSetup();
final String message=calibration.getMessage();
if (calibration.isCalibrating() && TextUtils.isEmpty(message)) {
calibration.setCalibrating(false);
callback.onDroneEvent(Event.EVENT_HEARTBEAT_TIMEOUT,emptyBundle);
}
 else {
extrasBundle=new Bundle(1);
extrasBundle.putString(Extra.EXTRA_CALIBRATION_IMU_MESSAGE,message);
callback.onDroneEvent(Event.EVENT_CALIBRATION_IMU_TIMEOUT,extrasBundle);
}
break;
case HEARTBEAT_TIMEOUT:
callback.onDroneEvent(Event.EVENT_HEARTBEAT_TIMEOUT,emptyBundle);
break;
case HEARTBEAT_FIRST:
extrasBundle=new Bundle();
extrasBundle.putInt(Extra.EXTRA_MAVLINK_VERSION,drone.getMavlinkVersion());
callback.onDroneEvent(Event.EVENT_HEARTBEAT_FIRST,extrasBundle);
break;
case HEARTBEAT_RESTORED:
extrasBundle=new Bundle();
extrasBundle.putInt(Extra.EXTRA_MAVLINK_VERSION,drone.getMavlinkVersion());
callback.onDroneEvent(Event.EVENT_HEARTBEAT_RESTORED,extrasBundle);
break;
case CONNECTED:
callback.onDroneEvent(Event.EVENT_CONNECTED,emptyBundle);
break;
case MISSION_SENT:
break;
case INVALID_POLYGON:
break;
case MISSION_WP_UPDATE:
break;
case FOLLOW_START:
callback.onDroneEvent(Event.EVENT_FOLLOW_START,emptyBundle);
break;
case FOLLOW_STOP:
callback.onDroneEvent(Event.EVENT_FOLLOW_STOP,emptyBundle);
break;
case FOLLOW_UPDATE:
case FOLLOW_CHANGE_TYPE:
callback.onDroneEvent(Event.EVENT_FOLLOW_UPDATE,emptyBundle);
break;
case WARNING_400FT_EXCEEDED:
break;
case WARNING_SIGNAL_WEAK:
break;
case WARNING_NO_GPS:
break;
case MAGNETOMETER:
break;
case FOOTPRINT:
break;
}
}
 catch (DeadObjectException e) {
handleDeadObjectException(e);
}
catch (RemoteException e) {
Log.e(TAG,e.getMessage(),e);
}
}

Fixed version (ground truth):
@Override public void onDroneEvent(DroneInterfaces.DroneEventsType event,Drone drone){
  final IDroidPlannerApiCallback callback=getCallback();
  Bundle extrasBundle;
  try {
switch (event) {
case DISCONNECTED:
      callback.onDroneEvent(Event.EVENT_DISCONNECTED,emptyBundle);
    break;
case GUIDEDPOINT:
  callback.onDroneEvent(Event.EVENT_GUIDED_POINT,emptyBundle);
break;
case NAVIGATION:
break;
case RADIO:
callback.onDroneEvent(Event.EVENT_RADIO,emptyBundle);
break;
case RC_IN:
break;
case RC_OUT:
break;
case ARMING_STARTED:
case ARMING:
callback.onDroneEvent(Event.EVENT_ARMING,emptyBundle);
break;
case AUTOPILOT_WARNING:
String warning=drone.getState().getWarning();
extrasBundle=new Bundle();
extrasBundle.putString(Extra.EXTRA_AUTOPILOT_FAILSAFE_MESSAGE,warning);
callback.onDroneEvent(Event.EVENT_AUTOPILOT_FAILSAFE,extrasBundle);
break;
case MODE:
callback.onDroneEvent(Event.EVENT_VEHICLE_MODE,emptyBundle);
break;
case ATTITUDE:
case ORIENTATION:
callback.onDroneEvent(Event.EVENT_ATTITUDE,emptyBundle);
break;
case SPEED:
callback.onDroneEvent(Event.EVENT_SPEED,emptyBundle);
break;
case BATTERY:
callback.onDroneEvent(Event.EVENT_BATTERY,emptyBundle);
break;
case STATE:
callback.onDroneEvent(Event.EVENT_STATE,emptyBundle);
break;
case MISSION_UPDATE:
break;
case MISSION_RECEIVED:
break;
case FIRMWARE:
case TYPE:
callback.onDroneEvent(Event.EVENT_TYPE_UPDATED,emptyBundle);
break;
case HOME:
callback.onDroneEvent(Event.EVENT_HOME,emptyBundle);
break;
case GPS:
callback.onDroneEvent(Event.EVENT_GPS,emptyBundle);
break;
case GPS_FIX:
case GPS_COUNT:
callback.onDroneEvent(Event.EVENT_GPS_STATE,emptyBundle);
break;
case PARAMETER:
case PARAMETERS_DOWNLOADED:
callback.onDroneEvent(Event.EVENT_PARAMETERS_RECEIVED,emptyBundle);
break;
case CALIBRATION_IMU:
final String calIMUMessage=getDroneMgr().getDrone().getCalibrationSetup().getMessage();
extrasBundle=new Bundle();
extrasBundle.putString(Extra.EXTRA_CALIBRATION_IMU_MESSAGE,calIMUMessage);
callback.onDroneEvent(Event.EVENT_CALIBRATION_IMU,extrasBundle);
break;
case CALIBRATION_TIMEOUT:
final Calibration calibration=getDroneMgr().getDrone().getCalibrationSetup();
final String message=calibration.getMessage();
if (calibration.isCalibrating() && TextUtils.isEmpty(message)) {
calibration.setCalibrating(false);
callback.onDroneEvent(Event.EVENT_HEARTBEAT_TIMEOUT,emptyBundle);
}
 else {
extrasBundle=new Bundle(1);
extrasBundle.putString(Extra.EXTRA_CALIBRATION_IMU_MESSAGE,message);
callback.onDroneEvent(Event.EVENT_CALIBRATION_IMU_TIMEOUT,extrasBundle);
}
break;
case HEARTBEAT_TIMEOUT:
callback.onDroneEvent(Event.EVENT_HEARTBEAT_TIMEOUT,emptyBundle);
break;
case HEARTBEAT_FIRST:
extrasBundle=new Bundle();
extrasBundle.putInt(Extra.EXTRA_MAVLINK_VERSION,drone.getMavlinkVersion());
callback.onDroneEvent(Event.EVENT_HEARTBEAT_FIRST,extrasBundle);
break;
case HEARTBEAT_RESTORED:
extrasBundle=new Bundle();
extrasBundle.putInt(Extra.EXTRA_MAVLINK_VERSION,drone.getMavlinkVersion());
callback.onDroneEvent(Event.EVENT_HEARTBEAT_RESTORED,extrasBundle);
break;
case CONNECTED:
callback.onDroneEvent(Event.EVENT_CONNECTED,emptyBundle);
break;
case MISSION_SENT:
break;
case INVALID_POLYGON:
break;
case MISSION_WP_UPDATE:
break;
case FOLLOW_START:
callback.onDroneEvent(Event.EVENT_FOLLOW_START,emptyBundle);
break;
case FOLLOW_STOP:
callback.onDroneEvent(Event.EVENT_FOLLOW_STOP,emptyBundle);
break;
case FOLLOW_UPDATE:
case FOLLOW_CHANGE_TYPE:
callback.onDroneEvent(Event.EVENT_FOLLOW_UPDATE,emptyBundle);
break;
case WARNING_400FT_EXCEEDED:
break;
case WARNING_SIGNAL_WEAK:
break;
case WARNING_NO_GPS:
break;
case MAGNETOMETER:
break;
case FOOTPRINT:
break;
}
}
 catch (DeadObjectException e) {
handleDeadObjectException(e);
}
catch (RemoteException e) {
Log.e(TAG,e.getMessage(),e);
}
}