From 092d527158c20e0cf90e671adb5e1c5dae8a6f73 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 4 Feb 2021 23:15:16 +0100 Subject: [PATCH] Move Amazfit GTR 2e code in the Amazfit GTR 2 package, they are too similar --- .../AmazfitGTR2eCoordinator.java | 2 +- .../AmazfitGTR2eFWHelper.java | 4 +-- .../AmazfitGTR2eFWInstallHandler.java | 2 +- .../service/DeviceSupportFactory.java | 2 +- .../AmazfitGTR2eFirmwareInfo.java | 2 +- .../AmazfitGTR2eSupport.java | 25 +++---------------- .../gadgetbridge/util/DeviceHelper.java | 2 +- 7 files changed, 10 insertions(+), 29 deletions(-) rename app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/{amazfitgtr2e => amazfitgtr2}/AmazfitGTR2eCoordinator.java (99%) rename app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/{amazfitgtr2e => amazfitgtr2}/AmazfitGTR2eFWHelper.java (96%) rename app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/{amazfitgtr2e => amazfitgtr2}/AmazfitGTR2eFWInstallHandler.java (99%) rename app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/{amazfitgtr2e => amazfitgtr2}/AmazfitGTR2eFirmwareInfo.java (99%) rename app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/{amazfitgtr2e => amazfitgtr2}/AmazfitGTR2eSupport.java (60%) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2e/AmazfitGTR2eCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2/AmazfitGTR2eCoordinator.java similarity index 99% rename from app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2e/AmazfitGTR2eCoordinator.java rename to app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2/AmazfitGTR2eCoordinator.java index 4295fafc6..1e6fa91bc 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2e/AmazfitGTR2eCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2/AmazfitGTR2eCoordinator.java @@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2e; +package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2; import android.bluetooth.BluetoothDevice; import android.content.Context; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2e/AmazfitGTR2eFWHelper.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2/AmazfitGTR2eFWHelper.java similarity index 96% rename from app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2e/AmazfitGTR2eFWHelper.java rename to app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2/AmazfitGTR2eFWHelper.java index 8b162995a..04a06b8fb 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2e/AmazfitGTR2eFWHelper.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2/AmazfitGTR2eFWHelper.java @@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2e; +package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2; import android.content.Context; import android.net.Uri; @@ -23,7 +23,7 @@ import android.net.Uri; import java.io.IOException; import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper; -import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr2e.AmazfitGTR2eFirmwareInfo; +import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr2.AmazfitGTR2eFirmwareInfo; public class AmazfitGTR2eFWHelper extends HuamiFWHelper { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2e/AmazfitGTR2eFWInstallHandler.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2/AmazfitGTR2eFWInstallHandler.java similarity index 99% rename from app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2e/AmazfitGTR2eFWInstallHandler.java rename to app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2/AmazfitGTR2eFWInstallHandler.java index 38fc1436e..45f438dfb 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2e/AmazfitGTR2eFWInstallHandler.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/amazfitgtr2/AmazfitGTR2eFWInstallHandler.java @@ -14,7 +14,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2e; +package nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2; import android.content.Context; import android.net.Uri; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java index 95cb6c3f5..1ca6fd7b5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java @@ -52,7 +52,7 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitcor2.Am import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr.AmazfitGTRLiteSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr.AmazfitGTRSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr2.AmazfitGTR2Support; -import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr2e.AmazfitGTR2eSupport; +import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr2.AmazfitGTR2eSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitvergel.AmazfitVergeLSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgts.AmazfitGTSSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgts2.AmazfitGTS2Support; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2e/AmazfitGTR2eFirmwareInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2/AmazfitGTR2eFirmwareInfo.java similarity index 99% rename from app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2e/AmazfitGTR2eFirmwareInfo.java rename to app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2/AmazfitGTR2eFirmwareInfo.java index 51e247672..861f7c9db 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2e/AmazfitGTR2eFirmwareInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2/AmazfitGTR2eFirmwareInfo.java @@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr2e; +package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr2; import java.util.HashMap; import java.util.Map; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2e/AmazfitGTR2eSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2/AmazfitGTR2eSupport.java similarity index 60% rename from app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2e/AmazfitGTR2eSupport.java rename to app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2/AmazfitGTR2eSupport.java index b1ababff8..2e40534cb 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2e/AmazfitGTR2eSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitgtr2/AmazfitGTR2eSupport.java @@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr2e; +package nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr2; import android.content.Context; import android.net.Uri; @@ -23,31 +23,12 @@ import android.net.Uri; import java.io.IOException; import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper; -import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2e.AmazfitGTR2eFWHelper; -import nodomain.freeyourgadget.gadgetbridge.model.CallSpec; -import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitgtr.AmazfitGTRSupport; -import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperation; -import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.operations.UpdateFirmwareOperation2020; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2.AmazfitGTR2eFWHelper; -public class AmazfitGTR2eSupport extends AmazfitGTRSupport { +public class AmazfitGTR2eSupport extends AmazfitGTR2Support { @Override public HuamiFWHelper createFWHelper(Uri uri, Context context) throws IOException { return new AmazfitGTR2eFWHelper(uri, context); } - - @Override - public void onSetCallState(CallSpec callSpec) { - onSetCallStateNew(callSpec); - } - - @Override - public UpdateFirmwareOperation createUpdateFirmwareOperation(Uri uri) { - return new UpdateFirmwareOperation2020(uri, this); - } - - @Override - public int getActivitySampleSize() { - return 8; - } } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java index 1662253bd..ca2e5a2bb 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java @@ -66,7 +66,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr.AmazfitGTRC import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr.AmazfitGTRLiteCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2.AmazfitGTR2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppe.ZeppECoordinator; -import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2e.AmazfitGTR2eCoordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgtr2.AmazfitGTR2eCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts.AmazfitGTSCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitgts2.AmazfitGTS2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitvergel.AmazfitVergeLCoordinator;