mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
log: exception handling toast should, if not already logged, log the exception stack trace (#5115)
This commit is contained in:
committed by
José Rebelo
parent
ad460a7846
commit
0b761558bd
+6
-6
@@ -170,8 +170,8 @@ public class ControlCenterv2 extends AppCompatActivity
|
||||
clDialog = cl.getMaterialFullLogDialog();
|
||||
}
|
||||
clDialog.show();
|
||||
} catch (Exception ignored) {
|
||||
GB.toast(getBaseContext(), getString(R.string.error_showing_changelog), Toast.LENGTH_LONG, GB.ERROR);
|
||||
} catch (Exception ex) {
|
||||
GB.toast(getBaseContext(), getString(R.string.error_showing_changelog), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -298,8 +298,8 @@ public class ControlCenterv2 extends AppCompatActivity
|
||||
if (showChangelog && cl.isFirstRun() && cl.hasChanges(cl.isFirstRunEver())) {
|
||||
try {
|
||||
cl.getMaterialLogDialog().show();
|
||||
} catch (Exception ignored) {
|
||||
GB.toast(this, getString(R.string.error_showing_changelog), Toast.LENGTH_LONG, GB.ERROR);
|
||||
} catch (Exception ex) {
|
||||
GB.toast(this, getString(R.string.error_showing_changelog), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,8 +369,8 @@ public class ControlCenterv2 extends AppCompatActivity
|
||||
clDialog = cl.getMaterialFullLogDialog();
|
||||
}
|
||||
clDialog.show();
|
||||
} catch (Exception ignored) {
|
||||
GB.toast(getBaseContext(), getString(R.string.error_showing_changelog), Toast.LENGTH_LONG, GB.ERROR);
|
||||
} catch (Exception ex) {
|
||||
GB.toast(getBaseContext(), getString(R.string.error_showing_changelog), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||
}
|
||||
return false;
|
||||
} else if (itemId == R.id.about) {
|
||||
|
||||
+1
-1
@@ -357,7 +357,7 @@ public class DataManagementActivity extends AbstractGBActivity {
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
GB.toast("Error importing device specific preferences", Toast.LENGTH_SHORT, GB.ERROR);
|
||||
GB.toast("Error importing device specific preferences", Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -209,7 +209,7 @@ public class ExternalPebbleJSActivity extends AbstractGBActivity {
|
||||
try {
|
||||
queryString = confUri.getEncodedQuery();
|
||||
} catch (IllegalArgumentException e) {
|
||||
GB.toast("returned uri: " + confUri.toString(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("returned uri: " + confUri.toString(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
myWebView.stopLoading();
|
||||
myWebView.loadUrl("file:///android_asset/app_config/configure.html?" + queryString);
|
||||
|
||||
+2
-2
@@ -102,7 +102,7 @@ public class NotificationFilterActivity extends AbstractGBActivity {
|
||||
setupView(db);
|
||||
|
||||
} catch (Exception e) {
|
||||
GB.toast(this, "Error accessing the database: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(this, "Error accessing the database: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
this.finish();
|
||||
}
|
||||
}
|
||||
@@ -209,7 +209,7 @@ public class NotificationFilterActivity extends AbstractGBActivity {
|
||||
NotificationFilterActivity.this.finish();
|
||||
|
||||
} catch (Exception e) {
|
||||
GB.toast(NotificationFilterActivity.this, "Error accessing the database: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(NotificationFilterActivity.this, "Error accessing the database: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -254,7 +254,7 @@ public class LoyaltyCardsSettingsFragment extends AbstractPreferenceFragment {
|
||||
try {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=me.hackerchick.catima")));
|
||||
} catch (final ActivityNotFoundException e) {
|
||||
GB.toast(requireContext(), requireContext().getString(R.string.loyalty_cards_install_catima_fail), Toast.LENGTH_LONG, GB.WARN);
|
||||
GB.toast(requireContext(), requireContext().getString(R.string.loyalty_cards_install_catima_fail), Toast.LENGTH_LONG, GB.WARN, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ public class FileManagementActivity extends AbstractGBActivity implements View.O
|
||||
return;
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
GB.toast("please choose a local file", Toast.LENGTH_LONG, GB.WARN);
|
||||
GB.toast("please choose a local file", Toast.LENGTH_LONG, GB.WARN, e);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -279,7 +279,7 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem
|
||||
try {
|
||||
AndroidUtils.openApp("d.d.hrmenucompanion");
|
||||
} catch (Exception e) {
|
||||
GB.toast(getString(R.string.error_menu_companion_not_installed), Toast.LENGTH_SHORT, GB.INFO);
|
||||
GB.toast(getString(R.string.error_menu_companion_not_installed), Toast.LENGTH_SHORT, GB.INFO, e);
|
||||
|
||||
AndroidUtils.openWebsite("https://github.com/dakhnod/Fossil-HR-Menu-Companion/releases/latest");
|
||||
}
|
||||
|
||||
+1
-1
@@ -482,7 +482,7 @@ public class QHybridConfigActivity extends AbstractGBActivity {
|
||||
buttonLayout.addView(buttonTextView);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
GB.toast("error parsing button config", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("error parsing button config", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ public class OpenTracksController extends Activity {
|
||||
try {
|
||||
context.startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
GB.toast(e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.WARN);
|
||||
GB.toast(e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.WARN, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -150,7 +150,7 @@ public class BandWPSeriesDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
try {
|
||||
payloadValue = response.payloadUnpacker.unpackInt();
|
||||
} catch (IOException e) {
|
||||
GB.toast("Could not extract ancMode from payload: " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR);
|
||||
GB.toast("Could not extract ancMode from payload: " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
return false;
|
||||
}
|
||||
Editor editor = GBApplication.getDeviceSpecificSharedPrefs(gbDevice.getAddress()).edit();
|
||||
@@ -185,7 +185,7 @@ public class BandWPSeriesDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
try {
|
||||
wearSensorEnabled = response.getPayloadBoolean();
|
||||
} catch (IOException e) {
|
||||
GB.toast("Failed to unpack wear sensor status from payload " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR);
|
||||
GB.toast("Failed to unpack wear sensor status from payload " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
return false;
|
||||
}
|
||||
Editor editor = GBApplication.getDeviceSpecificSharedPrefs(gbDevice.getAddress()).edit();
|
||||
@@ -229,7 +229,7 @@ public class BandWPSeriesDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
try {
|
||||
payloadValue = response.payloadUnpacker.unpackBoolean();
|
||||
} catch (IOException e) {
|
||||
GB.toast("Could not extract vptEnabled from payload: " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR);
|
||||
GB.toast("Could not extract vptEnabled from payload: " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
return false;
|
||||
}
|
||||
int vptLevel = GBApplication.getDeviceSpecificSharedPrefs(gbDevice.getAddress()).getInt(PREF_BANDW_PSERIES_VPT_LEVEL, 0);
|
||||
@@ -249,7 +249,7 @@ public class BandWPSeriesDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
try {
|
||||
payloadValue = response.payloadUnpacker.unpackInt();
|
||||
} catch (IOException e) {
|
||||
GB.toast("Could not extract vptLevel from payload: " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR);
|
||||
GB.toast("Could not extract vptLevel from payload: " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
return false;
|
||||
}
|
||||
boolean vptEnabled = GBApplication.getDeviceSpecificSharedPrefs(gbDevice.getAddress()).getBoolean(PREF_BANDW_PSERIES_VPT_ENABLED, false);
|
||||
@@ -283,7 +283,7 @@ public class BandWPSeriesDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
}
|
||||
builder.queueImmediately();
|
||||
} catch (IOException e) {
|
||||
GB.toast("Failed to send settings update", Toast.LENGTH_SHORT, GB.ERROR);
|
||||
GB.toast("Failed to send settings update", Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ public class BandWPSeriesDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
try {
|
||||
payloadValue = response.payloadUnpacker.unpackBoolean();
|
||||
} catch (IOException e) {
|
||||
GB.toast("Could not extract response from payload: " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR);
|
||||
GB.toast("Could not extract response from payload: " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
return false;
|
||||
}
|
||||
return payloadValue;
|
||||
@@ -308,7 +308,7 @@ public class BandWPSeriesDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
try {
|
||||
payloadValue = response.payloadUnpacker.unpackInt();
|
||||
} catch (IOException e) {
|
||||
GB.toast("Could not extract response from payload: " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR);
|
||||
GB.toast("Could not extract response from payload: " + Arrays.toString(response.payload), Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
return false;
|
||||
}
|
||||
return payloadValue == 0;
|
||||
|
||||
+11
-11
@@ -292,7 +292,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
uartTx(builder, data);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error in TX: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error in TX: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -343,7 +343,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
uartTx(builder, data);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error in TX: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error in TX: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -515,7 +515,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
uartTxJSON(builder, json);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error in "+taskName+": " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error in "+taskName+": " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
o.put("id", id);
|
||||
o.put("err", message);
|
||||
} catch (JSONException e) {
|
||||
GB.toast(getContext(), "uartTxJSONError: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "uartTxJSONError: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
uartTxJSON(taskName, o);
|
||||
}
|
||||
@@ -554,7 +554,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
LOG.warn("UART RX JSON parsed but doesn't contain 't' - ignoring");
|
||||
} catch (JSONException e) {
|
||||
LOG.error("UART RX JSON parse failure: "+ e.getLocalizedMessage());
|
||||
GB.toast(getContext(), "Malformed JSON from Bangle.js: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Malformed JSON from Bangle.js: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
} else if (line.startsWith("data:image/bmp;base64,")) {
|
||||
LOG.debug("Got screenshot bmp");
|
||||
@@ -995,7 +995,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
if (response!=null)
|
||||
o.put("resp", response);
|
||||
} catch (JSONException e) {
|
||||
GB.toast(getContext(), "HTTP: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "HTTP: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
uartTxJSON("http", o);
|
||||
}
|
||||
@@ -1169,7 +1169,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
} catch (final Exception e) {
|
||||
// The user sent an invalid flag
|
||||
LOG.info("Flag '"+flag+"' isn't implemented or doesn't exist and was therefore not set.");
|
||||
GB.toast(getContext(), "Flag '"+flag+"' isn't implemented or it doesn't exist and was therefore not set.", Toast.LENGTH_LONG, GB.INFO);
|
||||
GB.toast(getContext(), "Flag '"+flag+"' isn't implemented or it doesn't exist and was therefore not set.", Toast.LENGTH_LONG, GB.INFO, e);
|
||||
}
|
||||
return intent;
|
||||
}
|
||||
@@ -1290,7 +1290,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
LOG.debug("Requesting gps power status: {}", o);
|
||||
uartTxJSON(builder, o);
|
||||
} catch (JSONException e) {
|
||||
GB.toast(getContext(), "uartTxJSONError: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "uartTxJSONError: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1349,7 +1349,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
LOG.debug("Sending gps value: " + o.toString());
|
||||
uartTxJSON("gps", o);
|
||||
} catch (JSONException e) {
|
||||
GB.toast(getContext(), "uartTxJSONError: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "uartTxJSONError: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1553,7 +1553,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
forceCalendarSync();
|
||||
builder.queue();
|
||||
} catch (Exception e) {
|
||||
GB.toast(getContext(), "Error setting time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error setting time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1837,7 +1837,7 @@ public class BangleJSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
uartTx(builder, "\u0010g.dump()\n");
|
||||
builder.queue();
|
||||
} catch (final IOException e) {
|
||||
GB.toast(getContext(), "Failed to get screenshot: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Failed to get screenshot: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -194,7 +194,7 @@ public class CasioGBX100DeviceSupport extends Casio2C2DSupport implements Shared
|
||||
|
||||
} catch (Exception ex) {
|
||||
// Why is this a toast? The user doesn't care about the error.
|
||||
GB.toast(getContext(), "Error saving samples: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error saving samples: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
||||
|
||||
LOG.error(ex.getMessage());
|
||||
|
||||
+1
-1
@@ -524,7 +524,7 @@ public class FitProDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
}
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error sending configuration: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error sending configuration: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -548,7 +548,7 @@ public class HPlusSupport extends AbstractBTLESingleDeviceSupport {
|
||||
setFindMe(builder, start);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error toggling Find Me: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error toggling Find Me: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -567,7 +567,7 @@ public class HPlusSupport extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ctrlCharacteristic, msg);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error setting Vibration: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error setting Vibration: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -643,7 +643,7 @@ public class HPlusSupport extends AbstractBTLESingleDeviceSupport {
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error toggling Send Weather: " + e.getLocalizedMessage(), Toast.LENGTH_LONG,
|
||||
GB.ERROR);
|
||||
GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ public class HPlusSupport extends AbstractBTLESingleDeviceSupport {
|
||||
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error showing incoming call: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error showing incoming call: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -779,7 +779,7 @@ public class HPlusSupport extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ctrlCharacteristic, msg);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error showing device Notification: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error showing device Notification: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -703,7 +703,7 @@ public abstract class HuamiSupport extends AbstractBTLESingleDeviceSupport
|
||||
setHeartrateSleepSupport(builder);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error toggling heart rate sleep support: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error toggling heart rate sleep support: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,7 +717,7 @@ public abstract class HuamiSupport extends AbstractBTLESingleDeviceSupport
|
||||
setHeartrateMeasurementInterval(builder, minuteInterval);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error toggling heart rate sleep support: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error toggling heart rate sleep support: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ public class FetchActivityOperation extends AbstractID115Operation {
|
||||
ID115SampleProvider provider = new ID115SampleProvider(getDevice(), dbHandler.getDaoSession());
|
||||
provider.addGBActivitySamples(sampleArray);
|
||||
} catch (Exception ex) {
|
||||
GB.toast(getContext(), "Error saving activity data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error saving activity data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -537,7 +537,7 @@ public class MakibesHR3DeviceSupport extends AbstractBTLESingleDeviceSupport imp
|
||||
|
||||
} catch (Exception ex) {
|
||||
// Why is this a toast? The user doesn't care about the error.
|
||||
GB.toast(getContext(), "Error saving samples: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error saving samples: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
||||
|
||||
LOG.error(ex.getMessage());
|
||||
|
||||
+1
-1
@@ -439,7 +439,7 @@ public class MiBandSupport extends AbstractBTLESingleDeviceSupport {
|
||||
setHeartrateSleepSupport(builder);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error toggling heart rate sleep support: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error toggling heart rate sleep support: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -166,7 +166,7 @@ public class No1F1Support extends AbstractBTLESingleDeviceSupport {
|
||||
setTime(builder);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error setting time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error setting time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ public class No1F1Support extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ctrlCharacteristic, msg);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error starting heart rate measurement: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error starting heart rate measurement: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ public class No1F1Support extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ctrlCharacteristic, msg);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error showing icon: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error showing icon: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ public class No1F1Support extends AbstractBTLESingleDeviceSupport {
|
||||
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error showing notificaton: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error showing notificaton: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ public class No1F1Support extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ctrlCharacteristic, msg);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,7 +515,7 @@ public class No1F1Support extends AbstractBTLESingleDeviceSupport {
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
GB.toast(getContext(), "Error saving activity data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error saving activity data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||
GB.updateTransferNotification(null,"Data transfer failed", false, 0, getContext());
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ class AppMessageHandlerHealthify extends AppMessageHandler {
|
||||
KEY_TEMPERATURE = appKeys.getInt("TEMPERATURE");
|
||||
KEY_CONDITIONS = appKeys.getInt("CONDITIONS");
|
||||
} catch (JSONException e) {
|
||||
GB.toast("There was an error accessing the Helthify watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("There was an error accessing the Helthify watchface configuration.", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ class AppMessageHandlerM7S extends AppMessageHandler {
|
||||
KEY_WEATHER_ICON = appKeys.getInt("KEY_WEATHER_ICON");
|
||||
KEY_WEATHER_DATA_TIME = appKeys.getInt("KEY_WEATHER_DATA_TIME");
|
||||
} catch (JSONException e) {
|
||||
GB.toast("There was an error accessing the M7S watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("There was an error accessing the M7S watchface configuration.", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ class AppMessageHandlerMorpheuz extends AppMessageHandler {
|
||||
keySnoozes = appKeys.getInt("keySnoozes");
|
||||
keyFault = appKeys.getInt("keyFault");
|
||||
} catch (JSONException e) {
|
||||
GB.toast("There was an error accessing the morpheuz watchapp configuration.", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("There was an error accessing the morpheuz watchapp configuration.", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ class AppMessageHandlerObsidian extends AppMessageHandler {
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
GB.toast("There was an error accessing the timestyle watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("There was an error accessing the timestyle watchface configuration.", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ class AppMessageHandlerRealWeather extends AppMessageHandler {
|
||||
KEY_WEATHER_TEMP = appKeys.getInt("temperature");
|
||||
KEY_WEATHER_ICON = appKeys.getInt("icon");
|
||||
} catch (JSONException e) {
|
||||
GB.toast("There was an error accessing the RealWeather watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("There was an error accessing the RealWeather watchface configuration.", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ class AppMessageHandlerSimplyLight extends AppMessageHandler {
|
||||
KEY_CONDITION = appKeys.getInt("condition");
|
||||
KEY_ERR = appKeys.getInt("err");
|
||||
} catch (JSONException e) {
|
||||
GB.toast("There was an error accessing the Simply Light watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("There was an error accessing the Simply Light watchface configuration.", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ class AppMessageHandlerSquare extends AppMessageHandler {
|
||||
CfgKeyUseCelsius = appKeys.getInt("CfgKeyUseCelsius");
|
||||
CfgKeyWeatherLocation = appKeys.getInt("CfgKeyWeatherLocation");
|
||||
} catch (JSONException e) {
|
||||
GB.toast("There was an error accessing the Square watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("There was an error accessing the Square watchface configuration.", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ class AppMessageHandlerTimeStylePebble extends AppMessageHandler {
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
GB.toast("There was an error accessing the timestyle watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("There was an error accessing the timestyle watchface configuration.", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ class AppMessageHandlerTrekVolle extends AppMessageHandler {
|
||||
MESSAGE_KEY_WEATHER_TEMPERATURE_MAX = appKeys.getInt("WEATHER_TEMPERATURE_MAX");
|
||||
MESSAGE_KEY_WEATHER_LOCATION = appKeys.getInt("WEATHER_LOCATION");
|
||||
} catch (JSONException e) {
|
||||
GB.toast("There was an error accessing the TrekVolle watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("There was an error accessing the TrekVolle watchface configuration.", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ class AppMessageHandlerYWeather extends AppMessageHandler {
|
||||
KEY_WEATHER_D3_MAXTEMP = appKeys.getInt("high3");
|
||||
|
||||
} catch (JSONException e) {
|
||||
GB.toast("There was an error accessing the YWeather watchface configuration.", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("There was an error accessing the YWeather watchface configuration.", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1243,7 +1243,7 @@ public class PineTimeJFSupport extends AbstractBTLESingleDeviceSupport implement
|
||||
GB.signalActivityDataFinish(getDevice());
|
||||
|
||||
} catch (Exception ex) {
|
||||
GB.toast(getContext(), "Error saving samples: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error saving samples: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
||||
|
||||
LOG.error(ex.getMessage());
|
||||
|
||||
+1
-1
@@ -431,7 +431,7 @@ public class QHybridSupport extends QHybridBaseSupport {
|
||||
GB.toast(getContext().getString(R.string.info_menu_structure_set), Toast.LENGTH_SHORT, GB.INFO);
|
||||
} catch (JSONException e) {
|
||||
logger.error("Menu structure json empty");
|
||||
GB.toast(getContext().getString(R.string.error_invalid_menu_structure), Toast.LENGTH_SHORT, GB.ERROR);
|
||||
GB.toast(getContext().getString(R.string.error_invalid_menu_structure), Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -427,7 +427,7 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
||||
}catch (IllegalArgumentException e){
|
||||
serviceEnabled = false;
|
||||
respondToAlexa("voice service not found on phone", true);
|
||||
GB.toast("voice service not found", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast("voice service not found", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
|
||||
if(!serviceEnabled){
|
||||
|
||||
+1
-1
@@ -1074,7 +1074,7 @@ public class SonyWena3DeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
|
||||
builder.queueImmediately();
|
||||
} catch(Exception e) {
|
||||
GB.toast("Failed to send settings update", Toast.LENGTH_SHORT, GB.ERROR);
|
||||
GB.toast("Failed to send settings update", Toast.LENGTH_SHORT, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -125,7 +125,7 @@ public class SonySWR12DeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
setTime(builder);
|
||||
builder.queue();
|
||||
} catch (Exception e) {
|
||||
GB.toast(getContext(), "Error setting time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error setting time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public class SonySWR12DeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(alarmCharacteristic, new BandAlarms(bandAlarmList).toByteArray());
|
||||
builder.queue();
|
||||
} catch (Exception e) {
|
||||
GB.toast(getContext(), "Error setting alarms: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error setting alarms: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -187,7 +187,7 @@ public class TLW64Support extends AbstractBTLESingleDeviceSupport {
|
||||
setTime(builder);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error setting time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error setting time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ public class TLW64Support extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ctrlCharacteristic, msg);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error during factory reset: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error during factory reset: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -439,7 +439,7 @@ public class TLW64Support extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ctrlCharacteristic, msg);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error showing icon: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error showing icon: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ public class TLW64Support extends AbstractBTLESingleDeviceSupport {
|
||||
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error showing notificaton: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error showing notificaton: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ public class TLW64Support extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ctrlCharacteristic, msg);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ public class TLW64Support extends AbstractBTLESingleDeviceSupport {
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
GB.toast(getContext(), "Error saving activity data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error saving activity data: " + ex.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -114,7 +114,7 @@ public class WaspOSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
uartTx(builder, "\u0010GB("+json.toString()+")\n");
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error in "+taskName+": " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error in "+taskName+": " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class WaspOSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
JSONObject json = new JSONObject(line);
|
||||
handleUartRxJSON(json);
|
||||
} catch (JSONException e) {
|
||||
GB.toast(getContext(), "Malformed JSON from Bangle.js: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Malformed JSON from Bangle.js: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -274,7 +274,7 @@ public class WaspOSDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
setTime(builder);
|
||||
builder.queue();
|
||||
} catch (Exception e) {
|
||||
GB.toast(getContext(), "Error setting time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error setting time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -234,7 +234,7 @@ public class XWatchSupport extends AbstractBTLESingleDeviceSupport {
|
||||
requestSummarizedData(builder);
|
||||
builder.queueConnected();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ public class XWatchSupport extends AbstractBTLESingleDeviceSupport {
|
||||
requestDetailedData(builder);
|
||||
builder.queueConnected();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,7 +376,7 @@ public class XWatchSupport extends AbstractBTLESingleDeviceSupport {
|
||||
requestDetailedData(builder);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+24
-24
@@ -222,7 +222,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
}
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error sending configuration: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error sending configuration: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
sendMsgToWatch(builder, testSignaling);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error on function onFindDevice: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error on function onFindDevice: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
sendMsgToWatch(builder, heartrate);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error enable auto heart rate measurement: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error enable auto heart rate measurement: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
}
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error set alarms: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error set alarms: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
replyMsgToWatch(builder, music);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error setting music state and info: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error setting music state and info: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -442,7 +442,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
sendMsgToWatch(builder, notification);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error set call state: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error set call state: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,7 +455,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
requestActivityInfo(builder);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error on fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error on fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
replyMsgToWatch(builder, music);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error setting music state and info: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error setting music state and info: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -515,7 +515,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
sendMsgToWatch(builder, calendarEvent);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error sending calendar event: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error sending calendar event: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
synchronizeTime(builder);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error setting the time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error setting the time: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
sendMsgToWatch(builder, weather);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error sending weather: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error sending weather: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,7 +788,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
sendMsgToWatch(builder, notification);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error sending notification: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error sending notification: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1050,7 +1050,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ackCharacteristic, new byte[]{ZeTimeConstants.CMD_ACK_WRITE});
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error fetching activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1066,7 +1066,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
ZeTimeConstants.CMD_END});
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error deleting activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error deleting activity data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1083,7 +1083,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ackCharacteristic, new byte[]{ZeTimeConstants.CMD_ACK_WRITE});
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error fetching heart rate data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error fetching heart rate data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1117,7 +1117,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
builder.write(ackCharacteristic, new byte[]{ZeTimeConstants.CMD_ACK_WRITE});
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error fetching sleep data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error fetching sleep data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1133,7 +1133,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
ZeTimeConstants.CMD_END});
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error deleting sleep data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error deleting sleep data: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1157,7 +1157,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
ZeTimeSampleProvider provider = new ZeTimeSampleProvider(getDevice(), dbHandler.getDaoSession());
|
||||
provider.addGBActivitySample(sample);
|
||||
} 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, ex);
|
||||
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
||||
}
|
||||
|
||||
@@ -1206,7 +1206,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
ZeTimeSampleProvider provider = new ZeTimeSampleProvider(getDevice(), dbHandler.getDaoSession());
|
||||
provider.addGBActivitySample(sample);
|
||||
} 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, ex);
|
||||
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
||||
}
|
||||
|
||||
@@ -1242,7 +1242,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
ZeTimeSampleProvider provider = new ZeTimeSampleProvider(getDevice(), dbHandler.getDaoSession());
|
||||
provider.addGBActivitySample(sample);
|
||||
} 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, ex);
|
||||
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
||||
}
|
||||
|
||||
@@ -1263,7 +1263,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
ZeTimeSampleProvider provider = new ZeTimeSampleProvider(getDevice(), dbHandler.getDaoSession());
|
||||
provider.addGBActivitySample(sample);
|
||||
} 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, ex);
|
||||
GB.updateTransferNotification(null, "Data transfer failed", false, 0, getContext());
|
||||
}
|
||||
|
||||
@@ -1353,7 +1353,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
ZeTimeConstants.CMD_END});
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error reply the music volume: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error reply the music volume: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1366,7 +1366,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
replyMsgToWatch(builder, music);
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error reply the music state: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error reply the music state: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1960,7 +1960,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
|
||||
builder.queue();
|
||||
} catch (IOException e) {
|
||||
GB.toast(getContext(), "Error reading configuration: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(getContext(), "Error reading configuration: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ public class GB {
|
||||
try {
|
||||
NotificationManagerCompat.from(context).notify(id, notification);
|
||||
} catch (SecurityException e) {
|
||||
toast(context.getString(R.string.warning_missing_notification_permission), Toast.LENGTH_SHORT, WARN);
|
||||
toast(context.getString(R.string.warning_missing_notification_permission), Toast.LENGTH_SHORT, WARN, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ public class PermissionsUtils {
|
||||
intent.putExtra(":settings:show_fragment_args", bundle);
|
||||
activity.startActivity(intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
GB.toast(activity, "'Notification Listener Settings' activity not found", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(activity, "'Notification Listener Settings' activity not found", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
LOG.error("'Notification Listener Settings' activity not found");
|
||||
}
|
||||
}
|
||||
@@ -320,7 +320,7 @@ public class PermissionsUtils {
|
||||
try {
|
||||
activity.startActivity(new Intent(android.provider.Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS));
|
||||
} catch (ActivityNotFoundException e) {
|
||||
GB.toast(activity, "'Notification Policy' activity not found", Toast.LENGTH_LONG, GB.ERROR);
|
||||
GB.toast(activity, "'Notification Policy' activity not found", Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
LOG.error("'Notification Policy' activity not found");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user