2021-01-10 23:37:09 +01:00
|
|
|
/* Copyright (C) 2015-2021 Andreas Shimokawa, Carsten Pfeiffer, Daniel
|
2019-12-06 22:49:44 +01:00
|
|
|
Dakhno, Daniele Gobbetti, José Rebelo, Julien Pivotto, Kasha, Sebastian
|
|
|
|
Kranz, Steffen Liebergeld
|
2017-03-10 14:53:19 +01: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/>. */
|
2015-08-03 23:09:49 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.service;
|
2015-06-06 23:54:34 +02:00
|
|
|
|
|
|
|
import android.bluetooth.BluetoothAdapter;
|
|
|
|
import android.content.Context;
|
2022-06-04 22:20:28 +02:00
|
|
|
import android.location.Location;
|
2015-06-06 23:54:34 +02:00
|
|
|
import android.net.Uri;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
2015-06-25 14:34:21 +02:00
|
|
|
import java.util.ArrayList;
|
2022-06-14 18:05:41 +02:00
|
|
|
import java.util.Arrays;
|
2015-08-17 21:30:37 +02:00
|
|
|
import java.util.EnumSet;
|
2015-06-06 23:54:34 +02:00
|
|
|
import java.util.UUID;
|
|
|
|
|
2023-07-04 00:19:19 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.capabilities.loyaltycards.LoyaltyCard;
|
2015-08-03 23:09:49 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
|
2016-05-16 17:30:11 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
|
2016-04-04 20:08:34 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
2016-06-24 10:25:08 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
|
2023-05-18 00:43:29 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.Contact;
|
2016-04-04 20:08:34 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
|
2016-06-08 20:27:25 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
|
2021-10-20 22:37:23 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.NavigationInfoSpec;
|
2015-09-24 14:45:21 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
2021-12-04 16:55:09 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
|
2016-12-31 15:56:05 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
|
2022-05-09 20:47:08 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
|
2015-08-03 23:09:49 +02:00
|
|
|
|
2015-06-06 23:54:34 +02:00
|
|
|
/**
|
|
|
|
* Wraps another device support instance and supports busy-checking and throttling of events.
|
|
|
|
*/
|
|
|
|
public class ServiceDeviceSupport implements DeviceSupport {
|
2023-08-20 04:14:06 +02:00
|
|
|
public static enum Flags {
|
2015-08-17 21:30:37 +02:00
|
|
|
THROTTLING,
|
|
|
|
BUSY_CHECKING,
|
|
|
|
}
|
2015-09-24 14:45:21 +02:00
|
|
|
|
2015-06-06 23:54:34 +02:00
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(ServiceDeviceSupport.class);
|
|
|
|
|
2015-08-17 21:30:37 +02:00
|
|
|
private static final long THROTTLING_THRESHOLD = 1000; // throttle multiple events in between one second
|
2015-06-06 23:54:34 +02:00
|
|
|
private final DeviceSupport delegate;
|
2015-08-17 21:30:37 +02:00
|
|
|
|
|
|
|
private long lastNotificationTime = 0;
|
2015-06-06 23:59:53 +02:00
|
|
|
private String lastNotificationKind;
|
2015-08-17 21:30:37 +02:00
|
|
|
private final EnumSet<Flags> flags;
|
2015-06-06 23:54:34 +02:00
|
|
|
|
2023-08-20 04:14:06 +02:00
|
|
|
public ServiceDeviceSupport(DeviceSupport delegate, EnumSet<Flags> flags) {
|
2015-06-06 23:54:34 +02:00
|
|
|
this.delegate = delegate;
|
2023-08-20 04:14:06 +02:00
|
|
|
this.flags = flags;
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-08-02 00:12:21 +02:00
|
|
|
public void setContext(GBDevice gbDevice, BluetoothAdapter btAdapter, Context context) {
|
|
|
|
delegate.setContext(gbDevice, btAdapter, context);
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isConnected() {
|
|
|
|
return delegate.isConnected();
|
|
|
|
}
|
|
|
|
|
2017-04-12 21:33:19 +02:00
|
|
|
@Override
|
|
|
|
public boolean connectFirstTime() {
|
|
|
|
return delegate.connectFirstTime();
|
|
|
|
}
|
|
|
|
|
2015-06-06 23:54:34 +02:00
|
|
|
@Override
|
|
|
|
public boolean connect() {
|
|
|
|
return delegate.connect();
|
|
|
|
}
|
|
|
|
|
2016-04-28 23:17:13 +02:00
|
|
|
@Override
|
|
|
|
public void setAutoReconnect(boolean enable) {
|
|
|
|
delegate.setAutoReconnect(enable);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean getAutoReconnect() {
|
|
|
|
return delegate.getAutoReconnect();
|
|
|
|
}
|
|
|
|
|
2022-10-22 23:00:01 +02:00
|
|
|
@Override
|
|
|
|
public boolean getImplicitCallbackModify() {
|
|
|
|
return delegate.getImplicitCallbackModify();
|
|
|
|
}
|
|
|
|
|
2015-06-06 23:54:34 +02:00
|
|
|
@Override
|
|
|
|
public void dispose() {
|
|
|
|
delegate.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public GBDevice getDevice() {
|
|
|
|
return delegate.getDevice();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public BluetoothAdapter getBluetoothAdapter() {
|
|
|
|
return delegate.getBluetoothAdapter();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Context getContext() {
|
|
|
|
return delegate.getContext();
|
|
|
|
}
|
|
|
|
|
2019-09-14 00:05:39 +02:00
|
|
|
@Override
|
|
|
|
public String customStringFilter(String inputString) {
|
|
|
|
return delegate.customStringFilter(inputString);
|
|
|
|
}
|
|
|
|
|
2015-06-06 23:54:34 +02:00
|
|
|
@Override
|
|
|
|
public boolean useAutoConnect() {
|
|
|
|
return delegate.useAutoConnect();
|
|
|
|
}
|
|
|
|
|
|
|
|
private boolean checkBusy(String notificationKind) {
|
2015-08-17 21:30:37 +02:00
|
|
|
if (!flags.contains(Flags.BUSY_CHECKING)) {
|
|
|
|
return false;
|
|
|
|
}
|
2015-06-06 23:54:34 +02:00
|
|
|
if (getDevice().isBusy()) {
|
|
|
|
LOG.info("Ignoring " + notificationKind + " because we're busy with " + getDevice().getBusyTask());
|
2015-08-17 21:30:37 +02:00
|
|
|
return true;
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
private boolean checkThrottle(String notificationKind) {
|
2015-08-17 21:30:37 +02:00
|
|
|
if (!flags.contains(Flags.THROTTLING)) {
|
|
|
|
return false;
|
|
|
|
}
|
2015-06-06 23:54:34 +02:00
|
|
|
long currentTime = System.currentTimeMillis();
|
2015-08-17 21:30:37 +02:00
|
|
|
if ((currentTime - lastNotificationTime) < THROTTLING_THRESHOLD) {
|
2015-06-06 23:59:53 +02:00
|
|
|
if (notificationKind != null && notificationKind.equals(lastNotificationKind)) {
|
2015-06-06 23:54:34 +02:00
|
|
|
LOG.info("Ignoring " + notificationKind + " because of throttling threshold reached");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2015-08-17 21:30:37 +02:00
|
|
|
lastNotificationTime = currentTime;
|
2015-06-06 23:59:53 +02:00
|
|
|
lastNotificationKind = notificationKind;
|
2015-06-06 23:54:34 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-24 14:45:21 +02:00
|
|
|
public void onNotification(NotificationSpec notificationSpec) {
|
2015-06-06 23:54:34 +02:00
|
|
|
if (checkBusy("generic notification") || checkThrottle("generic notification")) {
|
|
|
|
return;
|
|
|
|
}
|
2015-09-24 14:45:21 +02:00
|
|
|
delegate.onNotification(notificationSpec);
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|
|
|
|
|
2017-01-09 16:33:00 +01:00
|
|
|
@Override
|
|
|
|
public void onDeleteNotification(int id) {
|
|
|
|
delegate.onDeleteNotification(id);
|
|
|
|
}
|
|
|
|
|
2015-06-06 23:54:34 +02:00
|
|
|
@Override
|
2015-08-21 00:58:18 +02:00
|
|
|
public void onSetTime() {
|
2015-06-06 23:54:34 +02:00
|
|
|
if (checkBusy("set time") || checkThrottle("set time")) {
|
|
|
|
return;
|
|
|
|
}
|
2015-08-21 00:58:18 +02:00
|
|
|
delegate.onSetTime();
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// No throttling for the other events
|
|
|
|
|
|
|
|
@Override
|
2016-04-04 20:08:34 +02:00
|
|
|
public void onSetCallState(CallSpec callSpec) {
|
2015-06-06 23:54:34 +02:00
|
|
|
if (checkBusy("set call state")) {
|
|
|
|
return;
|
|
|
|
}
|
2016-04-04 20:08:34 +02:00
|
|
|
delegate.onSetCallState(callSpec);
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|
|
|
|
|
2016-06-24 10:25:08 +02:00
|
|
|
@Override
|
|
|
|
public void onSetCannedMessages(CannedMessagesSpec cannedMessagesSpec) {
|
|
|
|
if (checkBusy("set canned messages")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetCannedMessages(cannedMessagesSpec);
|
|
|
|
}
|
|
|
|
|
2016-06-08 20:27:25 +02:00
|
|
|
@Override
|
|
|
|
public void onSetMusicState(MusicStateSpec stateSpec) {
|
|
|
|
if (checkBusy("set music state")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetMusicState(stateSpec);
|
|
|
|
}
|
|
|
|
|
2015-06-06 23:54:34 +02:00
|
|
|
@Override
|
2016-04-04 20:08:34 +02:00
|
|
|
public void onSetMusicInfo(MusicSpec musicSpec) {
|
2015-06-06 23:54:34 +02:00
|
|
|
if (checkBusy("set music info")) {
|
|
|
|
return;
|
|
|
|
}
|
2016-04-04 20:08:34 +02:00
|
|
|
delegate.onSetMusicInfo(musicSpec);
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|
|
|
|
|
2022-05-05 15:14:15 +02:00
|
|
|
@Override
|
|
|
|
public void onSetPhoneVolume(float volume) {
|
|
|
|
if (checkBusy("set phone volume")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetPhoneVolume(volume);
|
|
|
|
}
|
|
|
|
|
2023-12-11 11:50:31 +01:00
|
|
|
@Override
|
|
|
|
public void onChangePhoneSilentMode(final int ringerMode) {
|
|
|
|
if (checkBusy("change phone silent mode")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onChangePhoneSilentMode(ringerMode);
|
|
|
|
}
|
|
|
|
|
2021-10-20 22:37:23 +02:00
|
|
|
@Override
|
|
|
|
public void onSetNavigationInfo(NavigationInfoSpec navigationInfoSpec) {
|
|
|
|
if (checkBusy("set navigation info")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetNavigationInfo(navigationInfoSpec);
|
|
|
|
}
|
|
|
|
|
2015-06-06 23:54:34 +02:00
|
|
|
@Override
|
|
|
|
public void onInstallApp(Uri uri) {
|
|
|
|
if (checkBusy("install app")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onInstallApp(uri);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onAppInfoReq() {
|
|
|
|
if (checkBusy("app info request")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onAppInfoReq();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-09-13 21:44:26 +02:00
|
|
|
public void onAppStart(UUID uuid, boolean start) {
|
2015-06-06 23:54:34 +02:00
|
|
|
if (checkBusy("app start")) {
|
|
|
|
return;
|
|
|
|
}
|
2015-09-13 21:44:26 +02:00
|
|
|
delegate.onAppStart(uuid, start);
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|
|
|
|
|
2023-01-04 22:40:38 +01:00
|
|
|
@Override
|
|
|
|
public void onAppDownload(UUID uuid) {
|
|
|
|
if (checkBusy("app download")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onAppDownload(uuid);
|
|
|
|
}
|
|
|
|
|
2015-06-06 23:54:34 +02:00
|
|
|
@Override
|
|
|
|
public void onAppDelete(UUID uuid) {
|
|
|
|
if (checkBusy("app delete")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onAppDelete(uuid);
|
|
|
|
}
|
|
|
|
|
2016-03-03 14:23:17 +01:00
|
|
|
@Override
|
2017-08-01 00:03:28 +02:00
|
|
|
public void onAppConfiguration(UUID uuid, String config, Integer id) {
|
2016-03-03 14:23:17 +01:00
|
|
|
if (checkBusy("app configuration")) {
|
|
|
|
return;
|
|
|
|
}
|
2017-08-01 00:03:28 +02:00
|
|
|
delegate.onAppConfiguration(uuid, config, id);
|
2016-03-03 14:23:17 +01:00
|
|
|
}
|
|
|
|
|
2016-06-12 01:20:12 +02:00
|
|
|
@Override
|
|
|
|
public void onAppReorder(UUID[] uuids) {
|
|
|
|
if (checkBusy("app reorder")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onAppReorder(uuids);
|
|
|
|
}
|
|
|
|
|
2015-06-06 23:54:34 +02:00
|
|
|
@Override
|
2018-03-31 16:21:25 +02:00
|
|
|
public void onFetchRecordedData(int dataTypes) {
|
2015-06-06 23:54:34 +02:00
|
|
|
if (checkBusy("fetch activity data")) {
|
|
|
|
return;
|
|
|
|
}
|
2018-03-31 16:21:25 +02:00
|
|
|
delegate.onFetchRecordedData(dataTypes);
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-12-16 16:05:13 +01:00
|
|
|
public void onReset(int flags) {
|
|
|
|
if (checkBusy("reset")) {
|
2015-06-06 23:54:34 +02:00
|
|
|
return;
|
|
|
|
}
|
2018-12-16 16:05:13 +01:00
|
|
|
delegate.onReset(flags);
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|
2015-06-21 00:34:05 +02:00
|
|
|
|
2015-12-28 14:38:56 +01:00
|
|
|
@Override
|
2016-02-29 22:05:29 +01:00
|
|
|
public void onHeartRateTest() {
|
2015-12-28 14:38:56 +01:00
|
|
|
if (checkBusy("heartrate")) {
|
|
|
|
return;
|
|
|
|
}
|
2016-02-29 22:05:29 +01:00
|
|
|
delegate.onHeartRateTest();
|
2015-12-28 14:38:56 +01:00
|
|
|
}
|
|
|
|
|
2015-06-21 00:34:05 +02:00
|
|
|
@Override
|
|
|
|
public void onFindDevice(boolean start) {
|
|
|
|
if (checkBusy("find device")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onFindDevice(start);
|
|
|
|
}
|
2015-06-24 00:23:38 +02:00
|
|
|
|
2022-08-18 23:03:28 +02:00
|
|
|
@Override
|
2022-10-22 21:53:45 +02:00
|
|
|
public void onFindPhone(final boolean start) {
|
2022-08-18 23:03:28 +02:00
|
|
|
if (checkBusy("phone found")) {
|
|
|
|
return;
|
|
|
|
}
|
2022-10-22 21:53:45 +02:00
|
|
|
delegate.onFindPhone(start);
|
2022-08-18 23:03:28 +02:00
|
|
|
}
|
|
|
|
|
2016-09-20 20:28:52 +02:00
|
|
|
@Override
|
|
|
|
public void onSetConstantVibration(int intensity) {
|
|
|
|
if (checkBusy("set constant vibration")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetConstantVibration(intensity);
|
|
|
|
}
|
|
|
|
|
2015-06-24 00:23:38 +02:00
|
|
|
@Override
|
|
|
|
public void onScreenshotReq() {
|
|
|
|
if (checkBusy("request screenshot")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onScreenshotReq();
|
|
|
|
}
|
2015-06-24 20:14:08 +02:00
|
|
|
|
|
|
|
@Override
|
2015-08-21 00:58:18 +02:00
|
|
|
public void onSetAlarms(ArrayList<? extends Alarm> alarms) {
|
2015-06-24 20:14:08 +02:00
|
|
|
if (checkBusy("set alarms")) {
|
|
|
|
return;
|
|
|
|
}
|
2015-06-25 14:34:21 +02:00
|
|
|
delegate.onSetAlarms(alarms);
|
2015-06-24 20:14:08 +02:00
|
|
|
}
|
2015-09-02 08:00:26 +02:00
|
|
|
|
2021-12-04 16:55:09 +01:00
|
|
|
@Override
|
|
|
|
public void onSetReminders(ArrayList<? extends Reminder> reminders) {
|
|
|
|
if (checkBusy("set reminders")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetReminders(reminders);
|
|
|
|
}
|
|
|
|
|
2023-05-18 00:43:29 +02:00
|
|
|
@Override
|
|
|
|
public void onSetContacts(ArrayList<? extends Contact> contacts) {
|
|
|
|
if (checkBusy("set contacts")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetContacts(contacts);
|
|
|
|
}
|
|
|
|
|
2023-07-04 00:19:19 +02:00
|
|
|
public void onSetLoyaltyCards(final ArrayList<LoyaltyCard> cards) {
|
|
|
|
if (checkBusy("set loyalty cards")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetLoyaltyCards(cards);
|
|
|
|
}
|
|
|
|
|
2022-05-09 20:47:08 +02:00
|
|
|
@Override
|
|
|
|
public void onSetWorldClocks(ArrayList<? extends WorldClock> clocks) {
|
|
|
|
if (checkBusy("set world clocks")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetWorldClocks(clocks);
|
|
|
|
}
|
|
|
|
|
2015-09-02 08:00:26 +02:00
|
|
|
@Override
|
|
|
|
public void onEnableRealtimeSteps(boolean enable) {
|
|
|
|
if (checkBusy("enable realtime steps: " + enable)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onEnableRealtimeSteps(enable);
|
|
|
|
}
|
2016-04-03 22:38:06 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onEnableHeartRateSleepSupport(boolean enable) {
|
2017-11-11 00:04:51 +01:00
|
|
|
if (checkBusy("enable heart rate sleep support: " + enable)) {
|
2016-04-03 22:38:06 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onEnableHeartRateSleepSupport(enable);
|
|
|
|
}
|
2016-04-12 23:12:15 +02:00
|
|
|
|
2017-11-11 00:04:51 +01:00
|
|
|
@Override
|
|
|
|
public void onSetHeartRateMeasurementInterval(int seconds) {
|
|
|
|
if (checkBusy("set heart rate measurement interval: " + seconds + "s")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetHeartRateMeasurementInterval(seconds);
|
|
|
|
}
|
|
|
|
|
2016-04-12 23:12:15 +02:00
|
|
|
@Override
|
|
|
|
public void onEnableRealtimeHeartRateMeasurement(boolean enable) {
|
|
|
|
if (checkBusy("enable realtime heart rate measurement: " + enable)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onEnableRealtimeHeartRateMeasurement(enable);
|
|
|
|
}
|
2016-05-16 17:30:11 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onAddCalendarEvent(CalendarEventSpec calendarEventSpec) {
|
|
|
|
if (checkBusy("add calendar event")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onAddCalendarEvent(calendarEventSpec);
|
|
|
|
}
|
2016-05-16 23:37:40 +02:00
|
|
|
|
|
|
|
@Override
|
2016-05-24 13:11:57 +02:00
|
|
|
public void onDeleteCalendarEvent(byte type, long id) {
|
2016-05-16 23:37:40 +02:00
|
|
|
if (checkBusy("delete calendar event")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onDeleteCalendarEvent(type, id);
|
|
|
|
}
|
2016-10-11 23:06:59 +02:00
|
|
|
|
2016-11-13 20:47:24 +01:00
|
|
|
@Override
|
|
|
|
public void onSendConfiguration(String config) {
|
|
|
|
if (checkBusy("send configuration: " + config)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSendConfiguration(config);
|
|
|
|
}
|
|
|
|
|
2019-02-20 14:09:21 +01:00
|
|
|
@Override
|
|
|
|
public void onReadConfiguration(String config) {
|
|
|
|
if (checkBusy("read configuration: " + config)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onReadConfiguration(config);
|
|
|
|
}
|
|
|
|
|
2016-10-11 23:06:59 +02:00
|
|
|
@Override
|
|
|
|
public void onTestNewFunction() {
|
|
|
|
if (checkBusy("test new function event")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onTestNewFunction();
|
|
|
|
}
|
2016-12-31 15:56:05 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSendWeather(WeatherSpec weatherSpec) {
|
|
|
|
if (checkBusy("send weather event")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSendWeather(weatherSpec);
|
|
|
|
}
|
2018-07-28 17:23:58 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSetFmFrequency(float frequency) {
|
|
|
|
if (checkBusy("set frequency event")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetFmFrequency(frequency);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSetLedColor(int color) {
|
|
|
|
if (checkBusy("set led color event")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetLedColor(color);
|
|
|
|
}
|
2021-12-24 15:20:57 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onPowerOff() {
|
|
|
|
if (checkBusy("power off event")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onPowerOff();
|
|
|
|
}
|
2022-06-04 22:20:28 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSetGpsLocation(Location location) {
|
|
|
|
if (checkBusy("set gps location")) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
delegate.onSetGpsLocation(location);
|
|
|
|
}
|
2015-06-06 23:54:34 +02:00
|
|
|
}
|