1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-24 17:45:50 +01:00

Fossil Hybrid: added factory reset option

This commit is contained in:
Daniel Dakhno 2020-10-26 03:55:32 +01:00
parent 89f9f69b0d
commit 7dd50fc31a
4 changed files with 24 additions and 0 deletions

View File

@ -524,6 +524,11 @@ public class QHybridSupport extends QHybridBaseSupport {
}
}
@Override
public void onReset(int flags) {
super.onReset(flags);
this.watchAdapter.factoryReset();
}
public double calculateNotificationProgress() {
HashMap<NotificationConfiguration, Boolean> configs = new HashMap<>(0);

View File

@ -147,4 +147,7 @@ public abstract class WatchAdapter {
public void uploadFile(FileHandle handle, String filePath, boolean fileIsEncrypted) {
}
public void factoryReset() {
}
}

View File

@ -97,6 +97,7 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fos
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil_hr.widget.Widget;
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil_hr.widget.WidgetsPutRequest;
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.misfit.AnimationRequest;
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.misfit.FactoryResetRequest;
import nodomain.freeyourgadget.gadgetbridge.util.FileUtils;
import nodomain.freeyourgadget.gadgetbridge.util.GB;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
@ -906,6 +907,11 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
}
}
@Override
public void factoryReset() {
queueWrite(new FactoryResetRequest());
}
@Override
public void onTestNewFunction() {
queueWrite(new TranslationsGetRequest(this){

View File

@ -0,0 +1,10 @@
package nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.misfit;
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.Request;
public class FactoryResetRequest extends Request {
@Override
public byte[] getStartSequence() {
return new byte[]{(byte) 0x02, (byte) 0xF1, (byte) 0x23, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
}
}