2020-01-09 10:44:32 +01:00
|
|
|
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniel
|
2019-12-06 22:49:44 +01:00
|
|
|
Dakhno, Daniele Gobbetti, Frank Slezak, ivanovlev, JohnnySun, José Rebelo,
|
2020-01-09 10:44:32 +01:00
|
|
|
Julien Pivotto, Kasha, Sebastian Kranz, Steffen Liebergeld, vanous
|
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-21 00:58:18 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.model;
|
|
|
|
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.EventHandler;
|
2015-12-13 00:43:07 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
2015-08-21 00:58:18 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public interface DeviceService extends EventHandler {
|
2015-11-23 22:46:12 +01:00
|
|
|
String PREFIX = "nodomain.freeyourgadget.gadgetbridge.devices";
|
2015-08-21 00:58:18 +02:00
|
|
|
|
2015-11-23 22:46:12 +01:00
|
|
|
String ACTION_START = PREFIX + ".action.start";
|
|
|
|
String ACTION_CONNECT = PREFIX + ".action.connect";
|
|
|
|
String ACTION_NOTIFICATION = PREFIX + ".action.notification";
|
2017-01-09 16:33:00 +01:00
|
|
|
String ACTION_DELETE_NOTIFICATION = PREFIX + ".action.delete_notification";
|
2015-11-23 22:46:12 +01:00
|
|
|
String ACTION_CALLSTATE = PREFIX + ".action.callstate";
|
2016-06-24 10:25:08 +02:00
|
|
|
String ACTION_SETCANNEDMESSAGES = PREFIX + ".action.setcannedmessages";
|
2015-11-23 22:46:12 +01:00
|
|
|
String ACTION_SETTIME = PREFIX + ".action.settime";
|
|
|
|
String ACTION_SETMUSICINFO = PREFIX + ".action.setmusicinfo";
|
2016-06-08 20:27:25 +02:00
|
|
|
String ACTION_SETMUSICSTATE = PREFIX + ".action.setmusicstate";
|
2022-05-05 15:14:15 +02:00
|
|
|
String ACTION_SET_PHONE_VOLUME = PREFIX + ".action.set_phone_volume";
|
2021-10-20 22:37:23 +02:00
|
|
|
String ACTION_SETNAVIGATIONINFO = PREFIX + ".action.setnavigationinfo";
|
2015-11-23 22:46:12 +01:00
|
|
|
String ACTION_REQUEST_DEVICEINFO = PREFIX + ".action.request_deviceinfo";
|
|
|
|
String ACTION_REQUEST_APPINFO = PREFIX + ".action.request_appinfo";
|
|
|
|
String ACTION_REQUEST_SCREENSHOT = PREFIX + ".action.request_screenshot";
|
|
|
|
String ACTION_STARTAPP = PREFIX + ".action.startapp";
|
2023-01-04 22:40:38 +01:00
|
|
|
String ACTION_DOWNLOADAPP = PREFIX + ".action.downloadapp";
|
2015-11-23 22:46:12 +01:00
|
|
|
String ACTION_DELETEAPP = PREFIX + ".action.deleteapp";
|
2016-03-03 14:23:17 +01:00
|
|
|
String ACTION_APP_CONFIGURE = PREFIX + ".action.app_configure";
|
2016-06-12 01:20:12 +02:00
|
|
|
String ACTION_APP_REORDER = PREFIX + ".action.app_reorder";
|
2015-11-23 22:46:12 +01:00
|
|
|
String ACTION_INSTALL = PREFIX + ".action.install";
|
2018-12-16 16:05:13 +01:00
|
|
|
String ACTION_RESET = PREFIX + ".action.reset";
|
2015-12-28 14:38:56 +01:00
|
|
|
String ACTION_HEARTRATE_TEST = PREFIX + ".action.heartrate_test";
|
2018-03-31 16:21:25 +02:00
|
|
|
String ACTION_FETCH_RECORDED_DATA = PREFIX + ".action.fetch_activity_data";
|
2015-11-23 22:46:12 +01:00
|
|
|
String ACTION_DISCONNECT = PREFIX + ".action.disconnect";
|
|
|
|
String ACTION_FIND_DEVICE = PREFIX + ".action.find_device";
|
2022-08-18 23:03:28 +02:00
|
|
|
String ACTION_PHONE_FOUND = PREFIX + ".action.phone_found";
|
2016-09-20 20:28:52 +02:00
|
|
|
String ACTION_SET_CONSTANT_VIBRATION = PREFIX + ".action.set_constant_vibration";
|
2015-11-23 22:46:12 +01:00
|
|
|
String ACTION_SET_ALARMS = PREFIX + ".action.set_alarms";
|
2019-12-29 11:07:42 +01:00
|
|
|
String ACTION_SAVE_ALARMS = PREFIX + ".action.save_alarms";
|
2023-10-08 20:17:58 +02:00
|
|
|
String ACTION_SAVE_REMINDERS = PREFIX + ".action.save_reminders";
|
2021-12-04 16:55:09 +01:00
|
|
|
String ACTION_SET_REMINDERS = PREFIX + ".action.set_reminders";
|
2023-07-04 00:19:19 +02:00
|
|
|
String ACTION_SET_LOYALTY_CARDS = PREFIX + ".action.set_loyalty_cards";
|
2022-05-09 20:47:08 +02:00
|
|
|
String ACTION_SET_WORLD_CLOCKS = PREFIX + ".action.set_world_clocks";
|
2023-05-18 00:43:29 +02:00
|
|
|
String ACTION_SET_CONTACTS = PREFIX + ".action.set_contacts";
|
2015-11-23 22:46:12 +01:00
|
|
|
String ACTION_ENABLE_REALTIME_STEPS = PREFIX + ".action.enable_realtime_steps";
|
2016-09-04 00:02:58 +02:00
|
|
|
String ACTION_REALTIME_SAMPLES = PREFIX + ".action.realtime_samples";
|
2016-04-12 23:12:15 +02:00
|
|
|
String ACTION_ENABLE_REALTIME_HEARTRATE_MEASUREMENT = PREFIX + ".action.realtime_hr_measurement";
|
2016-04-03 22:38:06 +02:00
|
|
|
String ACTION_ENABLE_HEARTRATE_SLEEP_SUPPORT = PREFIX + ".action.enable_heartrate_sleep_support";
|
2017-11-11 00:04:51 +01:00
|
|
|
String ACTION_SET_HEARTRATE_MEASUREMENT_INTERVAL = PREFIX + ".action.set_heartrate_measurement_intervarl";
|
2016-05-16 17:30:11 +02:00
|
|
|
String ACTION_ADD_CALENDAREVENT = PREFIX + ".action.add_calendarevent";
|
2016-05-16 23:37:40 +02:00
|
|
|
String ACTION_DELETE_CALENDAREVENT = PREFIX + ".action.delete_calendarevent";
|
2016-11-13 20:47:24 +01:00
|
|
|
String ACTION_SEND_CONFIGURATION = PREFIX + ".action.send_configuration";
|
2019-02-20 14:09:21 +01:00
|
|
|
String ACTION_READ_CONFIGURATION = PREFIX + ".action.read_configuration";
|
2016-12-31 15:56:05 +01:00
|
|
|
String ACTION_SEND_WEATHER = PREFIX + ".action.send_weather";
|
2016-10-11 23:06:59 +02:00
|
|
|
String ACTION_TEST_NEW_FUNCTION = PREFIX + ".action.test_new_function";
|
2018-07-28 17:23:58 +02:00
|
|
|
String ACTION_SET_FM_FREQUENCY = PREFIX + ".action.set_fm_frequency";
|
2022-06-04 22:20:28 +02:00
|
|
|
String ACTION_SET_GPS_LOCATION = PREFIX + ".action.set_gps_location";
|
2018-07-28 17:23:58 +02:00
|
|
|
String ACTION_SET_LED_COLOR = PREFIX + ".action.set_led_color";
|
2021-12-24 15:20:57 +01:00
|
|
|
String ACTION_POWER_OFF = PREFIX + ".action.power_off";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_NOTIFICATION_BODY = "notification_body";
|
2016-01-09 17:54:17 +01:00
|
|
|
String EXTRA_NOTIFICATION_FLAGS = "notification_flags";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_NOTIFICATION_ID = "notification_id";
|
2023-12-08 13:12:35 +01:00
|
|
|
String EXTRA_NOTIFICATION_KEY = "notification_key";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_NOTIFICATION_PHONENUMBER = "notification_phonenumber";
|
|
|
|
String EXTRA_NOTIFICATION_SENDER = "notification_sender";
|
|
|
|
String EXTRA_NOTIFICATION_SOURCENAME = "notification_sourcename";
|
2018-07-23 02:24:38 +02:00
|
|
|
String EXTRA_NOTIFICATION_SOURCEAPPID = "notification_sourceappid";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_NOTIFICATION_SUBJECT = "notification_subject";
|
|
|
|
String EXTRA_NOTIFICATION_TITLE = "notification_title";
|
|
|
|
String EXTRA_NOTIFICATION_TYPE = "notification_type";
|
2018-10-31 21:47:12 +01:00
|
|
|
String EXTRA_NOTIFICATION_ACTIONS = "notification_actions";
|
2017-09-19 13:24:31 +02:00
|
|
|
String EXTRA_NOTIFICATION_PEBBLE_COLOR = "notification_pebble_color";
|
2021-04-20 09:55:27 +02:00
|
|
|
String EXTRA_NOTIFICATION_ICONID = "notification_iconid";
|
2021-11-19 15:09:27 +01:00
|
|
|
String EXTRA_NOTIFICATION_DNDSUPPRESSED = "notification_dndsuppressed";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_FIND_START = "find_start";
|
2016-09-20 20:28:52 +02:00
|
|
|
String EXTRA_VIBRATION_INTENSITY = "vibration_intensity";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_CALL_COMMAND = "call_command";
|
|
|
|
String EXTRA_CALL_PHONENUMBER = "call_phonenumber";
|
2017-01-27 21:16:19 +01:00
|
|
|
String EXTRA_CALL_DISPLAYNAME = "call_displayname";
|
2023-10-08 20:40:17 +02:00
|
|
|
String EXTRA_CALL_SOURCENAME = "call_sourcename";
|
|
|
|
String EXTRA_CALL_SOURCEAPPID = "call_sourceappid";
|
2022-05-15 16:51:41 +02:00
|
|
|
String EXTRA_CALL_DNDSUPPRESSED = "call_dndsuppressed";
|
2016-06-24 10:25:08 +02:00
|
|
|
String EXTRA_CANNEDMESSAGES = "cannedmessages";
|
|
|
|
String EXTRA_CANNEDMESSAGES_TYPE = "cannedmessages_type";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_MUSIC_ARTIST = "music_artist";
|
|
|
|
String EXTRA_MUSIC_ALBUM = "music_album";
|
|
|
|
String EXTRA_MUSIC_TRACK = "music_track";
|
2016-03-27 17:44:20 +02:00
|
|
|
String EXTRA_MUSIC_DURATION = "music_duration";
|
|
|
|
String EXTRA_MUSIC_TRACKNR = "music_tracknr";
|
|
|
|
String EXTRA_MUSIC_TRACKCOUNT = "music_trackcount";
|
2016-06-08 20:27:25 +02:00
|
|
|
String EXTRA_MUSIC_STATE = "music_state";
|
|
|
|
String EXTRA_MUSIC_SHUFFLE = "music_shuffle";
|
|
|
|
String EXTRA_MUSIC_REPEAT = "music_repeat";
|
|
|
|
String EXTRA_MUSIC_POSITION = "music_position";
|
|
|
|
String EXTRA_MUSIC_RATE = "music_rate";
|
2022-05-05 15:14:15 +02:00
|
|
|
String EXTRA_PHONE_VOLUME = "phone_volume";
|
2021-10-20 22:37:23 +02:00
|
|
|
String EXTRA_NAVIGATION_INSTRUCTION = "navigation_instruction";
|
|
|
|
String EXTRA_NAVIGATION_DISTANCE_TO_TURN = "navigation_distance_to_turn";
|
|
|
|
String EXTRA_NAVIGATION_NEXT_ACTION = "navigation_next_action";
|
2023-06-09 09:47:10 +02:00
|
|
|
String EXTRA_NAVIGATION_ETA = "navigation_eta";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_APP_UUID = "app_uuid";
|
|
|
|
String EXTRA_APP_START = "app_start";
|
2016-03-03 16:04:17 +01:00
|
|
|
String EXTRA_APP_CONFIG = "app_config";
|
2017-08-01 00:03:28 +02:00
|
|
|
String EXTRA_APP_CONFIG_ID = "app_config_id";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_URI = "uri";
|
2016-11-13 20:47:24 +01:00
|
|
|
String EXTRA_CONFIG = "config";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_ALARMS = "alarms";
|
2021-12-04 16:55:09 +01:00
|
|
|
String EXTRA_REMINDERS = "reminders";
|
2023-07-04 00:19:19 +02:00
|
|
|
String EXTRA_LOYALTY_CARDS = "loyalty_cards";
|
2022-05-09 20:47:08 +02:00
|
|
|
String EXTRA_WORLD_CLOCKS = "world_clocks";
|
2023-05-18 00:43:29 +02:00
|
|
|
String EXTRA_CONTACTS = "contacts";
|
2017-04-12 21:33:19 +02:00
|
|
|
String EXTRA_CONNECT_FIRST_TIME = "connect_first_time";
|
2016-04-03 22:38:06 +02:00
|
|
|
String EXTRA_BOOLEAN_ENABLE = "enable_realtime_steps";
|
2017-11-11 00:04:51 +01:00
|
|
|
String EXTRA_INTERVAL_SECONDS = "interval_seconds";
|
2017-11-29 23:57:36 +01:00
|
|
|
String EXTRA_WEATHER = "weather";
|
2018-03-31 16:21:25 +02:00
|
|
|
String EXTRA_RECORDED_DATA_TYPES = "data_types";
|
2018-07-28 17:23:58 +02:00
|
|
|
String EXTRA_FM_FREQUENCY = "fm_frequency";
|
|
|
|
String EXTRA_LED_COLOR = "led_color";
|
2022-06-04 22:20:28 +02:00
|
|
|
String EXTRA_GPS_LOCATION = "gps_location";
|
2018-12-16 16:05:13 +01:00
|
|
|
String EXTRA_RESET_FLAGS = "reset_flags";
|
2016-12-31 15:56:05 +01:00
|
|
|
|
2016-09-04 00:02:58 +02:00
|
|
|
/**
|
|
|
|
* Use EXTRA_REALTIME_SAMPLE instead
|
|
|
|
*/
|
|
|
|
@Deprecated
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_REALTIME_STEPS = "realtime_steps";
|
2016-09-04 00:02:58 +02:00
|
|
|
String EXTRA_REALTIME_SAMPLE = "realtime_sample";
|
2015-11-23 22:46:12 +01:00
|
|
|
String EXTRA_TIMESTAMP = "timestamp";
|
2016-09-04 00:02:58 +02:00
|
|
|
/**
|
|
|
|
* Use EXTRA_REALTIME_SAMPLE instead
|
|
|
|
*/
|
|
|
|
@Deprecated
|
2016-04-12 23:12:15 +02:00
|
|
|
String EXTRA_HEART_RATE_VALUE = "hr_value";
|
2016-05-16 17:30:11 +02:00
|
|
|
String EXTRA_CALENDAREVENT_ID = "calendarevent_id";
|
|
|
|
String EXTRA_CALENDAREVENT_TYPE = "calendarevent_type";
|
|
|
|
String EXTRA_CALENDAREVENT_TIMESTAMP = "calendarevent_timestamp";
|
|
|
|
String EXTRA_CALENDAREVENT_DURATION = "calendarevent_duration";
|
2022-08-21 15:58:12 +02:00
|
|
|
String EXTRA_CALENDAREVENT_ALLDAY = "calendarevent_allday";
|
2016-05-16 17:30:11 +02:00
|
|
|
String EXTRA_CALENDAREVENT_TITLE = "calendarevent_title";
|
|
|
|
String EXTRA_CALENDAREVENT_DESCRIPTION = "calendarevent_description";
|
2017-04-21 10:50:10 +02:00
|
|
|
String EXTRA_CALENDAREVENT_LOCATION = "calendarevent_location";
|
2022-08-23 17:05:38 +02:00
|
|
|
String EXTRA_CALENDAREVENT_CALNAME = "calendarevent_calname";
|
|
|
|
String EXTRA_CALENDAREVENT_COLOR = "calendarevent_color";
|
2015-08-21 00:58:18 +02:00
|
|
|
|
|
|
|
void start();
|
|
|
|
|
|
|
|
void connect();
|
2015-09-24 14:45:21 +02:00
|
|
|
|
2022-08-01 23:04:41 +02:00
|
|
|
void connect(boolean firstTime);
|
2022-06-14 18:05:41 +02:00
|
|
|
|
2015-08-21 00:58:18 +02:00
|
|
|
void disconnect();
|
|
|
|
|
|
|
|
void quit();
|
2015-09-24 14:45:21 +02:00
|
|
|
|
2022-08-01 23:04:41 +02:00
|
|
|
DeviceService forDevice(GBDevice device);
|
|
|
|
|
2015-08-21 00:58:18 +02:00
|
|
|
/**
|
|
|
|
* Requests information from the {@link DeviceCommunicationService} about the connection state,
|
|
|
|
* firmware info, etc.
|
|
|
|
* <p/>
|
|
|
|
* Note that this will not need a connection to the device -- only the cached information
|
|
|
|
* from the service will be reported.
|
|
|
|
*/
|
|
|
|
void requestDeviceInfo();
|
|
|
|
}
|