igpsport: Removed all RuntimeException from igpsport and minor fixes

This commit is contained in:
Vitaliy Tomin
2026-05-13 23:33:24 +02:00
committed by José Rebelo
parent 5f9114c221
commit 6255057772
6 changed files with 17 additions and 9 deletions
@@ -148,7 +148,7 @@ public class IGPSportRouteInstallHandler implements InstallHandler {
R.string.installhandler_firmware_name,
mContext.getString(coordinator.getDeviceNameResource()),
mContext.getString(R.string.kind_gpx_route),
"test" //FIXME
filename
);
return new GenericItem(firmwareName);
}
@@ -946,7 +946,7 @@ public enum DeviceType {
SILVERCREST_SBM_67(SilverCrestSBM67Coordinator.class),
BRAUN_BPW4500(BraunBPW4500DeviceCoordinator.class),
IGPSPORT_BSC200(IGPSportBSC200Coordinator.class),
IGPSPORT_BSC200s(IGPSportBSC200SCoordinator.class),
IGPSPORT_BSC200S(IGPSportBSC200SCoordinator.class),
IGPSPORT_IGS630(IGPSportiGS630Coordinator.class),
IGPSPORT_IGS800(IGPSportiGS800Coordinator.class),
TEST(TestDeviceCoordinator.class);
@@ -265,7 +265,7 @@ public class IGPSportDeviceSupport extends AbstractBTLESingleDeviceSupport {
LOG.error("Unknown general operation received");
}
} catch (InvalidProtocolBufferException e) {
throw new RuntimeException(e);
LOG.error("Failed to parse protobuf packet" + e);
}
}
@@ -54,7 +54,7 @@ import nodomain.freeyourgadget.gadgetbridge.util.notifications.GBProgressNotific
public class IGPSportDownloadManager {
Logger LOG = LoggerFactory.getLogger(nodomain.freeyourgadget.gadgetbridge.service.devices.igpsport.IGPSportDownloadManager.class);
Logger LOG = LoggerFactory.getLogger(IGPSportDownloadManager.class);
private IGPSportDeviceSupport support = null;
private List<FileInfo> avaliableActivityFiles = new ArrayList<>();
private ByteArrayOutputStream recievingDataBuffer;
@@ -151,7 +151,7 @@ public class IGPSportDownloadManager {
try {
recievingDataBuffer.write(data);
} catch (IOException e) {
throw new RuntimeException(e);
LOG.error("Failed to add data to buffer" + e);
}
if (firstChunk) {
@@ -166,7 +166,7 @@ public class IGPSportDownloadManager {
downloadInProgress = false;
File dir;
File outputFile;
File outputFile = null;
try {
dir = support.getWritableExportDirectory();
@@ -180,7 +180,7 @@ public class IGPSportDownloadManager {
outputFile.setLastModified(garminTimestampToJavaMillis(downloadingFile.getGarminTimeStamp()));
filesToProcess.add(outputFile);
} catch (IOException e) {
throw new RuntimeException(e);
LOG.error("Failed to save fit file to: " + outputFile.getAbsolutePath() + e);
}
syncNextFile();
@@ -16,6 +16,11 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.service.devices.igpsport;
import android.widget.Toast;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.time.Instant;
import java.time.LocalDateTime;
@@ -28,8 +33,10 @@ import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.proto.igpsport.Back;
import nodomain.freeyourgadget.gadgetbridge.proto.igpsport.Common;
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
import nodomain.freeyourgadget.gadgetbridge.util.GB;
public class IGPSportWeather {
Logger LOG = LoggerFactory.getLogger(IGPSportWeather.class);
IGPSportDeviceSupport support;
public IGPSportWeather(IGPSportDeviceSupport support) {
this.support = support;
@@ -38,6 +45,7 @@ public class IGPSportWeather {
// A static map to hold the conversion logic from OWM to QWeather.
private static final Map<Integer, Integer> codeMap = new HashMap<>();
// Static initializer block to populate the map with conversion data.
static {
// === OWM Group 2xx: Thunderstorm ===
@@ -193,7 +201,7 @@ public class IGPSportWeather {
builder.queue();
} catch (IOException e) {
throw new RuntimeException(e);
LOG.error("Failed to encode weather " + e);
}
}
+1 -1
View File
@@ -2251,7 +2251,7 @@
<string name="devicetype_earfun_air_pro_4" translatable="false">EarFun Air Pro 4</string>
<string name="devicetype_atc_ble_oepl" translatable="false">ATC_BLE_OEPL</string>
<string name="devicetype_igpsport_bsc200" translatable="false">iGPSPORT BSC200</string>
<string name="devicetype_igpsport_bsc200s" translatable="false">iGPSPORT BSC200s</string>
<string name="devicetype_igpsport_bsc200s" translatable="false">iGPSPORT BSC200S</string>
<string name="devicetype_igpsport_igs630" translatable="false">iGPSPORT iGS630</string>
<string name="devicetype_igpsport_igs800" translatable="false">iGPSPORT iGS800</string>
<string name="task_installing_route">Installing route</string>