2021-01-10 23:37:09 +01:00
|
|
|
/* Copyright (C) 2016-2021 Andreas Shimokawa, Carsten Pfeiffer, Daniele
|
|
|
|
Gobbetti, José Rebelo, Sebastian Kranz
|
2018-08-29 21:30:23 +02:00
|
|
|
|
|
|
|
This file is part of Gadgetbridge.
|
|
|
|
|
|
|
|
Gadgetbridge is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Gadgetbridge is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2018-02-08 07:21:12 +01:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.devices.zetime;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
import android.bluetooth.le.ScanFilter;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.net.Uri;
|
|
|
|
|
2019-01-26 15:52:40 +01:00
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import androidx.annotation.Nullable;
|
2019-10-05 22:35:30 +02:00
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
2022-07-10 22:01:20 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractBLEDeviceCoordinator;
|
2018-02-08 07:21:12 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
|
|
|
|
|
|
|
|
2022-07-10 22:01:20 +02:00
|
|
|
public class ZeTimeCoordinator extends AbstractBLEDeviceCoordinator {
|
2018-02-08 07:21:12 +01:00
|
|
|
@Override
|
|
|
|
public DeviceType getDeviceType() {
|
|
|
|
return DeviceType.ZETIME;
|
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
@Override
|
|
|
|
public Collection<? extends ScanFilter> createBLEScanFilters() {
|
|
|
|
return super.createBLEScanFilters();
|
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
@Override
|
|
|
|
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
|
|
|
|
String name = candidate.getDevice().getName();
|
|
|
|
if (name != null && name.startsWith("ZeTime")) {
|
|
|
|
return DeviceType.ZETIME;
|
|
|
|
}
|
|
|
|
return DeviceType.UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public Class<? extends Activity> getPairingActivity() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean supportsScreenshots() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-11-24 12:16:47 +01:00
|
|
|
public int getAlarmSlotCount() {
|
|
|
|
return 3; // FIXME - check the real value
|
2018-02-08 07:21:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean supportsWeather() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-07-26 21:57:12 +02:00
|
|
|
@Override
|
|
|
|
public boolean supportsFindDevice() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-02-08 07:21:12 +01:00
|
|
|
@Override
|
|
|
|
public InstallHandler findInstallHandler(Uri uri, Context context) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getManufacturer() {
|
|
|
|
return "MyKronoz";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean supportsActivityTracking() {
|
2018-05-29 12:57:08 +02:00
|
|
|
return true;
|
2018-02-08 07:21:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Class<? extends Activity> getAppsManagementActivity() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean supportsActivityDataFetching() {
|
2018-05-29 12:57:08 +02:00
|
|
|
return true;
|
2018-02-08 07:21:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean supportsAppsManagement() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean supportsCalendarEvents() {
|
2020-05-06 01:38:08 +02:00
|
|
|
return false;
|
2018-02-08 07:21:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
|
2018-06-27 09:01:26 +02:00
|
|
|
return new ZeTimeSampleProvider(device, session);
|
2018-02-08 07:21:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-10-05 22:35:30 +02:00
|
|
|
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) {
|
2018-02-08 07:21:12 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean supportsSmartWakeup(GBDevice device) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean supportsRealtimeData() {
|
2018-09-12 13:59:45 +02:00
|
|
|
return true;
|
2018-02-08 07:21:12 +01:00
|
|
|
}
|
2018-05-29 12:57:08 +02:00
|
|
|
|
2018-08-07 12:44:00 +02:00
|
|
|
@Override
|
|
|
|
public boolean supportsMusicInfo() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-05-29 12:57:08 +02:00
|
|
|
@Override
|
2019-10-12 19:44:45 +02:00
|
|
|
public int getBondingStyle() {
|
2018-05-29 12:57:08 +02:00
|
|
|
return BONDING_STYLE_NONE;
|
|
|
|
}
|
2019-09-13 11:45:48 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean supportsUnicodeEmojis() { return true; }
|
2019-10-05 22:35:30 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
|
|
|
|
return new int[]{
|
2020-05-05 00:34:59 +02:00
|
|
|
R.xml.devicesettings_zetime,
|
2019-10-05 22:35:30 +02:00
|
|
|
R.xml.devicesettings_timeformat,
|
|
|
|
R.xml.devicesettings_wearlocation,
|
2020-05-06 01:38:08 +02:00
|
|
|
R.xml.devicesettings_sync_calendar,
|
2021-11-03 17:13:22 +01:00
|
|
|
R.xml.devicesettings_transliteration
|
2019-10-05 22:35:30 +02:00
|
|
|
};
|
|
|
|
}
|
2018-02-08 07:21:12 +01:00
|
|
|
}
|