Skip to content

Commit

Permalink
Updated methods name to make them more clear
Browse files Browse the repository at this point in the history
Signed-off-by: pierantoniomerlino <[email protected]>
  • Loading branch information
pierantoniomerlino committed Jan 14, 2025
1 parent ef861e0 commit c41a287
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ protected void resetHandlersDisable(String deviceId) {
}
}

protected void failedModemResetTimerEnable(String deviceId, Optional<String> modemManagerDbusPath, int delayMinutes)
protected void failedModemResetTimerSchedule(String deviceId, Optional<String> modemManagerDbusPath, int delayMinutes)
throws DBusException {
if (!modemManagerDbusPath.isPresent()) {
logger.warn("Cannot retrieve modem device for {}. Skipping modem reset monitor setup.", deviceId);
Expand All @@ -303,14 +303,14 @@ protected void failedModemResetTimerEnable(String deviceId, Optional<String> mod
this.failedModemHandlers.put(deviceId, resetHandler);
}

protected void failedModemResetTimerDisable() {
protected void failedModemResetTimerCancel() {
for (String deviceId : this.failedModemHandlers.keySet()) {
failedModemResetTimerDisable(deviceId);
failedModemResetTimerCancel(deviceId);
}
this.modemHandlers.clear();
}

protected void failedModemResetTimerDisable(String deviceId) {
protected void failedModemResetTimerCancel(String deviceId) {
if (this.failedModemHandlers.containsKey(deviceId)) {
MMFailedModemResetTimer timer = this.failedModemHandlers.get(deviceId);
timer.cancel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ private void enableInterface(String deviceId, NetworkProperties properties, Devi

boolean activationSucceeded = true;
try {
this.modemManager.failedModemResetTimerDisable(deviceId);
this.modemManager.failedModemResetTimerCancel(deviceId);
this.networkManager.activateConnection(connection.get(), device);
dsLock.waitForSignal();
} catch (DBusExecutionException e) {
Expand Down Expand Up @@ -595,7 +595,7 @@ private void enableInterface(String deviceId, NetworkProperties properties, Devi
logger.info("Modem {} in failed state or unavailable. Scheduling modem reset in {} minutes ...",
device.getObjectPath(), delayMinutes);

this.modemManager.failedModemResetTimerEnable(deviceId, mmDbusPath, delayMinutes);
this.modemManager.failedModemResetTimerSchedule(deviceId, mmDbusPath, delayMinutes);
}

}
Expand Down Expand Up @@ -668,7 +668,7 @@ private void disable(Optional<Device> optDevice, String deviceId) throws DBusExc
logger.warn("Can't disable missing device {}", deviceId);
return;
}
this.modemManager.failedModemResetTimerDisable(deviceId);
this.modemManager.failedModemResetTimerCancel(deviceId);
Device device = optDevice.get();
Optional<Connection> appliedConnection = this.networkManager.getAppliedConnection(device);

Expand Down

0 comments on commit c41a287

Please sign in to comment.