mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-29 05:16:51 +01:00
Fossil/Skagen Hybrids: Show some toasts only on debug builds
This commit is contained in:
parent
ee3ce06899
commit
b8912976f1
@ -46,6 +46,7 @@ import java.util.GregorianCalendar;
|
||||
import java.util.TimeZone;
|
||||
import java.util.UUID;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.BuildConfig;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHandler;
|
||||
@ -219,6 +220,7 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
requestQueue.clear();
|
||||
}
|
||||
log("characteristic write failed: " + status);
|
||||
if (BuildConfig.DEBUG)
|
||||
GB.toast(fossilRequest.getName() + " characteristic write failed: " + status, Toast.LENGTH_SHORT, GB.ERROR);
|
||||
fossilRequest = null;
|
||||
|
||||
@ -551,6 +553,7 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
provider.addGBActivitySamples(samples);
|
||||
|
||||
queueWrite(new FileDeleteRequest(getHandle()));
|
||||
if (BuildConfig.DEBUG)
|
||||
GB.toast("synced activity data", Toast.LENGTH_SHORT, GB.INFO);
|
||||
} catch (Exception ex) {
|
||||
GB.toast(getContext(), "Error saving steps data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
@ -561,7 +564,7 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
|
||||
@Override
|
||||
public void handleFileLookupError(FILE_LOOKUP_ERROR error) {
|
||||
if(error == FILE_LOOKUP_ERROR.FILE_EMPTY){
|
||||
if(error == FILE_LOOKUP_ERROR.FILE_EMPTY && BuildConfig.DEBUG){
|
||||
GB.toast("activity file empty", Toast.LENGTH_SHORT, GB.INFO);
|
||||
}
|
||||
}
|
||||
@ -651,6 +654,7 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
// setDeviceState(GBDevice.State.AUTHENTICATION_REQUIRED);
|
||||
}else {
|
||||
GB.log("error", GB.ERROR, e);
|
||||
if (BuildConfig.DEBUG)
|
||||
GB.toast(fossilRequest.getName() + " failed", Toast.LENGTH_SHORT, GB.ERROR);
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,7 @@ import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.UUID;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.BuildConfig;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.activities.SettingsActivity;
|
||||
@ -1239,6 +1240,7 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
||||
writeFile(String.valueOf(System.currentTimeMillis()), fileData);
|
||||
}
|
||||
queueWrite(new FileDeleteRequest(fileHandle));
|
||||
if (BuildConfig.DEBUG)
|
||||
GB.toast(getContext().getString(R.string.fossil_hr_synced_activity_data), Toast.LENGTH_SHORT, GB.INFO);
|
||||
} catch (Exception ex) {
|
||||
GB.toast(getContext(), "Error saving steps data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
@ -1252,6 +1254,7 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
||||
@Override
|
||||
public void handleFileLookupError(FILE_LOOKUP_ERROR error) {
|
||||
if (error == FILE_LOOKUP_ERROR.FILE_EMPTY) {
|
||||
if (BuildConfig.DEBUG)
|
||||
GB.toast("activity file empty yet", Toast.LENGTH_LONG, GB.ERROR);
|
||||
} else {
|
||||
throw new RuntimeException("strange lookup stuff");
|
||||
|
Loading…
Reference in New Issue
Block a user