mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-25 19:36:50 +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.TimeZone;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.BuildConfig;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.database.DBHandler;
|
import nodomain.freeyourgadget.gadgetbridge.database.DBHandler;
|
||||||
@ -219,6 +220,7 @@ public class FossilWatchAdapter extends WatchAdapter {
|
|||||||
requestQueue.clear();
|
requestQueue.clear();
|
||||||
}
|
}
|
||||||
log("characteristic write failed: " + status);
|
log("characteristic write failed: " + status);
|
||||||
|
if (BuildConfig.DEBUG)
|
||||||
GB.toast(fossilRequest.getName() + " characteristic write failed: " + status, Toast.LENGTH_SHORT, GB.ERROR);
|
GB.toast(fossilRequest.getName() + " characteristic write failed: " + status, Toast.LENGTH_SHORT, GB.ERROR);
|
||||||
fossilRequest = null;
|
fossilRequest = null;
|
||||||
|
|
||||||
@ -551,6 +553,7 @@ public class FossilWatchAdapter extends WatchAdapter {
|
|||||||
provider.addGBActivitySamples(samples);
|
provider.addGBActivitySamples(samples);
|
||||||
|
|
||||||
queueWrite(new FileDeleteRequest(getHandle()));
|
queueWrite(new FileDeleteRequest(getHandle()));
|
||||||
|
if (BuildConfig.DEBUG)
|
||||||
GB.toast("synced activity data", Toast.LENGTH_SHORT, GB.INFO);
|
GB.toast("synced activity data", Toast.LENGTH_SHORT, GB.INFO);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
GB.toast(getContext(), "Error saving steps data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
GB.toast(getContext(), "Error saving steps data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||||
@ -561,7 +564,7 @@ public class FossilWatchAdapter extends WatchAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleFileLookupError(FILE_LOOKUP_ERROR error) {
|
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);
|
GB.toast("activity file empty", Toast.LENGTH_SHORT, GB.INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -651,6 +654,7 @@ public class FossilWatchAdapter extends WatchAdapter {
|
|||||||
// setDeviceState(GBDevice.State.AUTHENTICATION_REQUIRED);
|
// setDeviceState(GBDevice.State.AUTHENTICATION_REQUIRED);
|
||||||
}else {
|
}else {
|
||||||
GB.log("error", GB.ERROR, e);
|
GB.log("error", GB.ERROR, e);
|
||||||
|
if (BuildConfig.DEBUG)
|
||||||
GB.toast(fossilRequest.getName() + " failed", Toast.LENGTH_SHORT, GB.ERROR);
|
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.TimerTask;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.BuildConfig;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.activities.SettingsActivity;
|
import nodomain.freeyourgadget.gadgetbridge.activities.SettingsActivity;
|
||||||
@ -1239,6 +1240,7 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
|||||||
writeFile(String.valueOf(System.currentTimeMillis()), fileData);
|
writeFile(String.valueOf(System.currentTimeMillis()), fileData);
|
||||||
}
|
}
|
||||||
queueWrite(new FileDeleteRequest(fileHandle));
|
queueWrite(new FileDeleteRequest(fileHandle));
|
||||||
|
if (BuildConfig.DEBUG)
|
||||||
GB.toast(getContext().getString(R.string.fossil_hr_synced_activity_data), Toast.LENGTH_SHORT, GB.INFO);
|
GB.toast(getContext().getString(R.string.fossil_hr_synced_activity_data), Toast.LENGTH_SHORT, GB.INFO);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
GB.toast(getContext(), "Error saving steps data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
GB.toast(getContext(), "Error saving steps data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||||
@ -1252,6 +1254,7 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
|||||||
@Override
|
@Override
|
||||||
public void handleFileLookupError(FILE_LOOKUP_ERROR error) {
|
public void handleFileLookupError(FILE_LOOKUP_ERROR error) {
|
||||||
if (error == FILE_LOOKUP_ERROR.FILE_EMPTY) {
|
if (error == FILE_LOOKUP_ERROR.FILE_EMPTY) {
|
||||||
|
if (BuildConfig.DEBUG)
|
||||||
GB.toast("activity file empty yet", Toast.LENGTH_LONG, GB.ERROR);
|
GB.toast("activity file empty yet", Toast.LENGTH_LONG, GB.ERROR);
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("strange lookup stuff");
|
throw new RuntimeException("strange lookup stuff");
|
||||||
|
Loading…
Reference in New Issue
Block a user