From 77c76a7bd3be738a25996d0a63492f3e17d1fdeb Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Wed, 1 May 2019 21:56:36 +0200 Subject: [PATCH] Mi Band 3: enable per-device pairing keys --- .../devices/huami/miband3/MiBand3Coordinator.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/miband3/MiBand3Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/miband3/MiBand3Coordinator.java index 6e49bdce5..acff60b7b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/miband3/MiBand3Coordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huami/miband3/MiBand3Coordinator.java @@ -21,13 +21,16 @@ import android.bluetooth.BluetoothDevice; import android.content.Context; import android.net.Uri; +import androidx.annotation.NonNull; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Date; -import androidx.annotation.NonNull; import nodomain.freeyourgadget.gadgetbridge.GBApplication; +import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsFragment; +import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.HuamiSettingsFragment; import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler; import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst; import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiCoordinator; @@ -82,6 +85,16 @@ public class MiBand3Coordinator extends HuamiCoordinator { return true; } + @Override + public boolean supportsDeviceSpecificSettings(GBDevice device) { + return true; + } + + @Override + public DeviceSpecificSettingsFragment getDeviceSpecificSettingsFragment(GBDevice device) { + return HuamiSettingsFragment.newInstance(device.getAddress()); + } + public static boolean getBandScreenUnlock() { Prefs prefs = GBApplication.getPrefs(); return prefs.getBoolean(MiBandConst.PREF_MI3_BAND_SCREEN_UNLOCK, false);