Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(feedback): send status for task id on disable bluetooth
Signed-off-by: Rafa Hernandez <rhernandez@teclib.com>
  • Loading branch information
rafaelje authored and ajsb85 committed Mar 26, 2018
1 parent a7af53b commit 35d9207
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Expand Up @@ -694,11 +694,8 @@ public void messageArrived(String topic, MqttMessage message) throws Exception {
Boolean disable = jsonObj.getBoolean(DISABLE_BLUETOOTH);
String taskId = jsonObj.getString("taskId");

// return the status of the task
policiesController.sendTaskStatus(taskId, FEEDBACK_RECEIVED);

// execute the policy
policiesController.disableBluetooth(disable);
policiesController.disableBluetooth(taskId, disable);
}
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
Expand Down
Expand Up @@ -277,13 +277,19 @@ public void disableUI(JSONObject json) {
}
}

public void disableBluetooth(boolean disable) {
public void disableBluetooth(String taskId, boolean disable) {
try {
cache.setConnectivityBluetoothDisable(disable);
PoliciesConnectivity.disableBluetooth(disable);
broadcastReceivedLog(Helpers.broadCastMessage(MQTT_SEND, "Bluetooth", "Bluetooth is disable: " + disable));

// return the status of the task
sendTaskStatus(taskId, FEEDBACK_DONE);
} catch (Exception ex) {
broadcastReceivedLog(Helpers.broadCastMessage(ERROR, "Error on Bluetooth", ex.getMessage()));

// return the status of the task
sendTaskStatus(taskId, FEEDBACK_FAILED);
}
}

Expand Down

0 comments on commit 35d9207

Please sign in to comment.