mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-12 10:55:49 +01:00
Make exception notification only visible in debug builds
This commit is contained in:
parent
136825fa9d
commit
c766b1d1b7
@ -45,6 +45,7 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.BuildConfig;
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||
import nodomain.freeyourgadget.gadgetbridge.R;
|
||||
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo;
|
||||
@ -560,7 +561,13 @@ public class QHybridSupport extends QHybridBaseSupport {
|
||||
notifiyException("", e);
|
||||
}
|
||||
|
||||
public void notifiyException(String requestName, Exception e){
|
||||
public void notifiyException(String requestName, Exception e) {
|
||||
if (!BuildConfig.DEBUG) {
|
||||
logger.error("Error: " + requestName, e);
|
||||
return;
|
||||
}
|
||||
GB.toast("Please contact dakhnod@gmail.com\n", Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
e.printStackTrace(pw);
|
||||
@ -593,7 +600,6 @@ public class QHybridSupport extends QHybridBaseSupport {
|
||||
}
|
||||
|
||||
((NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE)).notify((int) System.currentTimeMillis(), notificationBuilder.build());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -623,7 +629,6 @@ public class QHybridSupport extends QHybridBaseSupport {
|
||||
gbDevice.addDeviceInfo(new GenericItem(ITEM_HAS_ACTIVITY_HAND, String.valueOf(watchAdapter.supportsActivityHand())));
|
||||
} catch (UnsupportedOperationException e) {
|
||||
notifiyException(e);
|
||||
GB.toast("Please contact dakhnod@gmail.com\n", Toast.LENGTH_SHORT, GB.INFO);
|
||||
gbDevice.addDeviceInfo(new GenericItem(ITEM_EXTENDED_VIBRATION_SUPPORT, "false"));
|
||||
}
|
||||
break;
|
||||
|
@ -521,7 +521,6 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
}
|
||||
} catch (UnsupportedOperationException e) {
|
||||
getDeviceSupport().notifiyException(e);
|
||||
GB.toast("Please contact dakhnod@gmail.com\n", Toast.LENGTH_SHORT, GB.INFO);
|
||||
}
|
||||
|
||||
if (start && getDeviceSupport().searchDevice) return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user