2015-08-03 23:09:49 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.devices.miband;
|
2015-05-07 01:30:40 +02:00
|
|
|
|
2015-05-17 22:57:37 +02:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
2016-04-25 23:39:03 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
|
|
|
|
|
2015-05-17 22:57:37 +02:00
|
|
|
public final class MiBandConst {
|
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(MiBandConst.class);
|
|
|
|
|
|
|
|
public static final String PREF_USER_ALIAS = "mi_user_alias";
|
2015-06-20 23:22:22 +02:00
|
|
|
public static final String PREF_MIBAND_WEARSIDE = "mi_wearside";
|
2015-05-17 22:57:37 +02:00
|
|
|
public static final String PREF_MIBAND_ADDRESS = "development_miaddr"; // FIXME: should be prefixed mi_
|
2015-06-26 17:22:42 +02:00
|
|
|
public static final String PREF_MIBAND_ALARMS = "mi_alarms";
|
2015-07-29 18:49:16 +02:00
|
|
|
public static final String PREF_MIBAND_FITNESS_GOAL = "mi_fitness_goal";
|
2015-09-07 12:06:56 +02:00
|
|
|
public static final String PREF_MIBAND_DONT_ACK_TRANSFER = "mi_dont_ack_transfer";
|
2015-12-17 16:11:35 +01:00
|
|
|
public static final String PREF_MIBAND_RESERVE_ALARM_FOR_CALENDAR = "mi_reserve_alarm_calendar";
|
2016-04-02 16:09:30 +02:00
|
|
|
public static final String PREF_MIBAND_USE_HR_FOR_SLEEP_DETECTION = "mi_hr_sleep_detection";
|
2016-06-03 04:43:12 +02:00
|
|
|
public static final String PREF_MIBAND_DEVICE_TIME_OFFSET_HOURS = "mi_device_time_offset_hours";
|
2016-11-13 20:47:24 +01:00
|
|
|
public static final String PREF_MI2_DATEFORMAT = "mi2_dateformat";
|
2016-11-13 21:33:43 +01:00
|
|
|
public static final String PREF_MI2_ACTIVATE_DISPLAY_ON_LIFT = "mi2_activate_display_on_lift_wrist";
|
2017-01-25 22:59:32 +01:00
|
|
|
public static final String PREF_MIBAND_SETUP_BT_PAIRING = "mi_setup_bt_pairing";
|
2016-10-09 00:10:53 +02:00
|
|
|
|
2015-09-07 12:06:56 +02:00
|
|
|
|
2015-06-20 23:22:22 +02:00
|
|
|
public static final String ORIGIN_INCOMING_CALL = "incoming_call";
|
2016-06-28 00:35:50 +02:00
|
|
|
public static final String MI_GENERAL_NAME_PREFIX = "MI";
|
2016-08-17 00:53:16 +02:00
|
|
|
public static final String MI_BAND2_NAME = "MI Band 2";
|
2015-12-07 01:11:07 +01:00
|
|
|
public static final String MI_1 = "1";
|
|
|
|
public static final String MI_1A = "1A";
|
|
|
|
public static final String MI_1S = "1S";
|
2016-05-15 00:15:31 +02:00
|
|
|
public static final String MI_AMAZFIT = "Amazfit";
|
2016-06-05 22:27:02 +02:00
|
|
|
public static final String MI_PRO = "2";
|
2015-05-17 22:57:37 +02:00
|
|
|
|
2016-04-25 23:39:03 +02:00
|
|
|
public static int getNotificationPrefIntValue(String pref, String origin, Prefs prefs, int defaultValue) {
|
2015-05-17 22:57:37 +02:00
|
|
|
String key = getNotificationPrefKey(pref, origin);
|
2016-04-25 23:39:03 +02:00
|
|
|
return prefs.getInt(key, defaultValue);
|
2015-05-17 22:57:37 +02:00
|
|
|
}
|
|
|
|
|
2016-04-25 23:39:03 +02:00
|
|
|
public static String getNotificationPrefStringValue(String pref, String origin, Prefs prefs, String defaultValue) {
|
2015-06-20 23:22:22 +02:00
|
|
|
String key = getNotificationPrefKey(pref, origin);
|
|
|
|
return prefs.getString(key, defaultValue);
|
|
|
|
}
|
|
|
|
|
2015-10-21 23:29:37 +02:00
|
|
|
public static String getNotificationPrefKey(String pref, String origin) {
|
|
|
|
return pref + '_' + origin;
|
2015-05-17 22:57:37 +02:00
|
|
|
}
|
|
|
|
|
2015-06-20 23:22:22 +02:00
|
|
|
public static final String VIBRATION_PROFILE = "mi_vibration_profile";
|
2015-05-17 22:57:37 +02:00
|
|
|
public static final String VIBRATION_COUNT = "mi_vibration_count";
|
|
|
|
public static final String VIBRATION_DURATION = "mi_vibration_duration";
|
|
|
|
public static final String VIBRATION_PAUSE = "mi_vibration_pause";
|
|
|
|
public static final String FLASH_COUNT = "mi_flash_count";
|
|
|
|
public static final String FLASH_DURATION = "mi_flash_duration";
|
|
|
|
public static final String FLASH_PAUSE = "mi_flash_pause";
|
|
|
|
public static final String FLASH_COLOUR = "mi_flash_colour";
|
|
|
|
public static final String FLASH_ORIGINAL_COLOUR = "mi_flash_original_colour";
|
|
|
|
|
2015-06-20 23:22:22 +02:00
|
|
|
public static final String DEFAULT_VALUE_VIBRATION_PROFILE = "short";
|
|
|
|
public static final int DEFAULT_VALUE_VIBRATION_COUNT = 3;
|
2015-05-17 22:57:37 +02:00
|
|
|
public static final int DEFAULT_VALUE_VIBRATION_DURATION = 500; // ms
|
|
|
|
public static final int DEFAULT_VALUE_VIBRATION_PAUSE = 500; // ms
|
|
|
|
public static final int DEFAULT_VALUE_FLASH_COUNT = 10; // ms
|
|
|
|
public static final int DEFAULT_VALUE_FLASH_DURATION = 500; // ms
|
|
|
|
public static final int DEFAULT_VALUE_FLASH_PAUSE = 500; // ms
|
|
|
|
public static final int DEFAULT_VALUE_FLASH_COLOUR = 1; // TODO: colour!
|
|
|
|
public static final int DEFAULT_VALUE_FLASH_ORIGINAL_COLOUR = 1; // TODO: colour!
|
2015-05-07 01:30:40 +02:00
|
|
|
}
|