mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-28 03:25:49 +01:00
changed request handling
This commit is contained in:
parent
fc9016e98e
commit
1318b58ad2
@ -239,6 +239,7 @@ public class QHybridSupport extends QHybridBaseSupport {
|
||||
builder.notify(getCharacteristic(UUID.fromString("3dda000" + i + "-957f-7d4a-34a6-74696673696d")), true);
|
||||
|
||||
builder
|
||||
.read(getCharacteristic(UUID.fromString("00002a19-0000-1000-8000-00805f9b34fb")))
|
||||
.read(getCharacteristic(UUID.fromString("00002a26-0000-1000-8000-00805f9b34fb")))
|
||||
.read(getCharacteristic(UUID.fromString("00002a24-0000-1000-8000-00805f9b34fb")))
|
||||
;
|
||||
@ -448,7 +449,7 @@ public class QHybridSupport extends QHybridBaseSupport {
|
||||
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Exception Report");
|
||||
emailIntent.putExtra(Intent.EXTRA_TEXT, "Here's a crash from your stupid app: \n\n" + sStackTrace);
|
||||
|
||||
PendingIntent intent = PendingIntent.getActivity(getContext(), 0, emailIntent, 0);
|
||||
PendingIntent intent = PendingIntent.getActivity(getContext(), 0, emailIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
|
||||
notificationBuilder.addAction(new Notification.Action(0, "report", intent));
|
||||
|
@ -38,7 +38,7 @@ import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||
public class FossilWatchAdapter extends WatchAdapter {
|
||||
private ArrayList<Request> requestQueue = new ArrayList<>();
|
||||
|
||||
FossilRequest fossilRequest;
|
||||
private FossilRequest fossilRequest;
|
||||
|
||||
public FossilWatchAdapter(QHybridSupport deviceSupport) {
|
||||
super(deviceSupport);
|
||||
@ -167,7 +167,6 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
|
||||
getDeviceSupport().getDevice().setState(GBDevice.State.NOT_CONNECTED);
|
||||
getDeviceSupport().getDevice().sendDeviceUpdateIntent(getContext());
|
||||
throw new RuntimeException("Error uploading notification settings");
|
||||
}
|
||||
|
||||
getDeviceSupport().getDevice().setState(GBDevice.State.INITIALIZED);
|
||||
@ -263,8 +262,8 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
}
|
||||
}
|
||||
try {
|
||||
queueWrite(requestQueue.remove(requestQueue.size() - 1));
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
queueWrite(requestQueue.remove(0));
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
log("requestsQueue empty");
|
||||
}
|
||||
}
|
||||
@ -283,12 +282,12 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
public void queueWrite(Request request, boolean priorise) {
|
||||
if (request.isBasicRequest()) {
|
||||
try {
|
||||
queueWrite(requestQueue.remove(requestQueue.size() - 1));
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
queueWrite(requestQueue.remove(0));
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
}
|
||||
} else {
|
||||
if (fossilRequest != null) {
|
||||
Log.d("requestQueue", "queing request: " + request.getName());
|
||||
log( "queing request: " + request.getName());
|
||||
if(priorise){
|
||||
requestQueue.add(0, request);
|
||||
}else {
|
||||
@ -296,7 +295,7 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
}
|
||||
return;
|
||||
}
|
||||
Log.d("requestQueue", "executing request: " + request.getName());
|
||||
log("executing request: " + request.getName());
|
||||
|
||||
if (request instanceof FossilRequest) this.fossilRequest = (FossilRequest) request;
|
||||
}
|
||||
|
@ -161,6 +161,8 @@ public class FilePutRequest extends FossilRequest {
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
throw new RuntimeException("file put timeout");
|
||||
/*timeout = true;
|
||||
ByteBuffer buffer2 = ByteBuffer.allocate(3);
|
||||
buffer2.order(ByteOrder.LITTLE_ENDIAN);
|
||||
buffer2.put((byte) 4);
|
||||
@ -174,7 +176,7 @@ public class FilePutRequest extends FossilRequest {
|
||||
.queue(adapter.getDeviceSupport().getQueue());
|
||||
|
||||
this.state = UploadState.CLOSING;
|
||||
break;
|
||||
break;*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user