mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Fossil Hybrid: use GB.toast()
This commit is contained in:
parent
d14687388b
commit
f11977597b
@ -140,8 +140,7 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
||||
try {
|
||||
getSecretKey();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
toast(e.getMessage());
|
||||
GB.toast("erro getting key: " + e.getMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
new TransactionBuilder("init fail")
|
||||
.add(new SetDeviceStateAction(getDeviceSupport().getDevice(), GBDevice.State.AUTHENTICATION_REQUIRED, getContext()))
|
||||
.queue(getDeviceSupport().getQueue());
|
||||
@ -593,8 +592,7 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
|
||||
this
|
||||
));
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
toast(e.getMessage());
|
||||
GB.toast("error getting key: " + e.getMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
getDeviceSupport().getDevice().setState(GBDevice.State.AUTHENTICATION_REQUIRED);
|
||||
getDeviceSupport().getDevice().sendDeviceUpdateIntent(getContext());
|
||||
getDeviceSupport().getQueue().clear();
|
||||
|
@ -17,6 +17,7 @@
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil_hr.file;
|
||||
|
||||
import android.bluetooth.BluetoothGattCharacteristic;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
@ -38,6 +39,7 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.adapter.foss
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.file.FileHandle;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil.FossilRequest;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.CRC32C;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||
|
||||
public abstract class FileEncryptedGetRequest extends FossilRequest {
|
||||
private short handle;
|
||||
@ -75,7 +77,7 @@ public abstract class FileEncryptedGetRequest extends FossilRequest {
|
||||
try {
|
||||
keySpec = new SecretKeySpec(this.adapter.getSecretKey(), "AES");
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
GB.toast("error getting key: " + e.getMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class FileEncryptedPutRequest extends FossilRequest {
|
||||
try {
|
||||
keySpec = new SecretKeySpec(this.adapter.getSecretKey(), "AES");
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
GB.toast("error getting key: " + e.getMessage(), Toast.LENGTH_LONG, GB.ERROR, e);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user