mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Zepp OS: Remove unused time format and distance unit code
These are already handled by the config service.
This commit is contained in:
+1
@@ -375,6 +375,7 @@ public abstract class ZeppOsCoordinator extends HuamiCoordinator {
|
||||
// Time
|
||||
//
|
||||
final List<Integer> dateTime = deviceSpecificSettings.addRootScreen(DeviceSpecificSettingsScreen.DATE_TIME);
|
||||
// FIXME: This "works", but the band does not update when the setting changes, so it's disabled for now
|
||||
//dateTime.add(R.xml.devicesettings_timeformat);
|
||||
dateTime.add(R.xml.devicesettings_dateformat_2);
|
||||
if (getWorldClocksSlotCount() > 0) {
|
||||
|
||||
+2
-2
@@ -3267,7 +3267,7 @@ public abstract class HuamiSupport extends AbstractBTLEDeviceSupport implements
|
||||
return this;
|
||||
}
|
||||
|
||||
protected HuamiSupport setTimeFormat(TransactionBuilder builder) {
|
||||
private HuamiSupport setTimeFormat(TransactionBuilder builder) {
|
||||
String timeFormat = GBApplication.getDevicePrefs(gbDevice).getTimeFormat();
|
||||
|
||||
LOG.info("Setting time format to " + timeFormat);
|
||||
@@ -3786,7 +3786,7 @@ public abstract class HuamiSupport extends AbstractBTLEDeviceSupport implements
|
||||
return this;
|
||||
}
|
||||
|
||||
protected HuamiSupport setDistanceUnit(TransactionBuilder builder) {
|
||||
private HuamiSupport setDistanceUnit(TransactionBuilder builder) {
|
||||
MiBandConst.DistanceUnit unit = HuamiCoordinator.getDistanceUnit();
|
||||
LOG.info("Setting distance unit to " + unit);
|
||||
if (unit == MiBandConst.DistanceUnit.METRIC) {
|
||||
|
||||
-56
@@ -931,56 +931,6 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ZeppOsSupport setTimeFormat(final TransactionBuilder builder) {
|
||||
final String timeFormat = getDevicePrefs().getTimeFormat();
|
||||
|
||||
// FIXME: This "works", but the band does not update when the setting changes, so we don't do anything
|
||||
//noinspection ConstantValue
|
||||
if (true) {
|
||||
LOG.warn("setDateTime is disabled");
|
||||
return this;
|
||||
}
|
||||
|
||||
LOG.info("Setting time format to {}", timeFormat);
|
||||
|
||||
final byte timeFormatByte;
|
||||
if (timeFormat.equals("24h")) {
|
||||
timeFormatByte = 0x01;
|
||||
} else {
|
||||
timeFormatByte = 0x00;
|
||||
}
|
||||
|
||||
configService.newSetter()
|
||||
.setByte(TIME_FORMAT, timeFormatByte)
|
||||
.write(builder);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ZeppOsSupport setDistanceUnit(final TransactionBuilder builder) {
|
||||
final MiBandConst.DistanceUnit unit = HuamiCoordinator.getDistanceUnit();
|
||||
LOG.info("Setting distance unit to {}", unit);
|
||||
|
||||
final byte unitByte;
|
||||
switch (unit) {
|
||||
case IMPERIAL:
|
||||
unitByte = 0x01;
|
||||
break;
|
||||
case METRIC:
|
||||
default:
|
||||
unitByte = 0x00;
|
||||
break;
|
||||
}
|
||||
|
||||
configService.newSetter()
|
||||
.setByte(TEMPERATURE_UNIT, unitByte)
|
||||
.write(builder);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ZeppOsSupport setLanguage(final TransactionBuilder builder) {
|
||||
final String localeString = GBApplication.getDeviceSpecificSharedPrefs(gbDevice.getAddress())
|
||||
@@ -1227,12 +1177,6 @@ public class ZeppOsSupport extends HuamiSupport implements ZeppOsFileTransferSer
|
||||
|
||||
// TODO: Move these services to dedicated classes, so they get the encryption correctly
|
||||
switch (type) {
|
||||
case CHUNKED2021_ENDPOINT_AUTH:
|
||||
LOG.warn("Unexpected auth payload {}", GB.hexdump(payload));
|
||||
return;
|
||||
case CHUNKED2021_ENDPOINT_COMPAT:
|
||||
LOG.warn("Unexpected compat payload {}", GB.hexdump(payload));
|
||||
return;
|
||||
case CHUNKED2021_ENDPOINT_WORKOUT:
|
||||
handle2021Workout(payload);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user