Huawei: Prevent some crashes

This commit is contained in:
José Rebelo
2025-03-16 12:47:48 +00:00
committed by José Rebelo
parent dda96a9dd3
commit a66c8685ec
5 changed files with 10 additions and 6 deletions
@@ -431,7 +431,7 @@ public class NotificationsHandler implements MessageHandler {
}
return byteArrayOutputStream.toString();
} catch (IOException e) {
throw new RuntimeException(e);
throw new RuntimeException("this should never happen", e);
}
}
@@ -236,7 +236,7 @@ public class HuaweiWatchfaceManager
getWatchfacesList.setFinalizeReq(finalizeReq);
getWatchfacesList.doPerform();
} catch (IOException e) {
throw new RuntimeException(e);
LOG.error("Failed to get watchfaces list", e);
}
};
@@ -2,6 +2,9 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.datasync;
import android.content.SharedPreferences;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
@@ -12,6 +15,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.HuaweiSupportProvider;
public class HuaweiDataSyncGoals implements HuaweiDataSyncCommon.DataCallback {
private final Logger LOG = LoggerFactory.getLogger(HuaweiDataSyncGoals.class);
private final HuaweiSupportProvider support;
@@ -105,7 +109,7 @@ public class HuaweiDataSyncGoals implements HuaweiDataSyncCommon.DataCallback {
} break;
}
} catch (HuaweiPacket.MissingTagException e) {
throw new RuntimeException(e);
LOG.error("Failed to handle data sync goals config command", e);
}
}
@@ -64,7 +64,7 @@ public abstract class HuaweiBaseP2PService {
}
test.doPerform();
} catch (IOException e) {
throw new RuntimeException(e);
LOG.error("Failed to send p2p command", e);
}
}
@@ -77,7 +77,7 @@ public abstract class HuaweiBaseP2PService {
}
test.doPerform();
} catch (IOException e) {
throw new RuntimeException(e);
LOG.error("Failed to send ping", e);
}
}
@@ -132,7 +132,7 @@ public class HuaweiP2PCannedRepliesService extends HuaweiBaseP2PService {
}
}
} catch (HuaweiPacket.MissingTagException e) {
throw new RuntimeException(e);
LOG.error("Failed to handle p2p canned replies", e);
}
}
}