1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 10:35:50 +01:00

Merge remote-tracking branch 'upstream/master' into firmware_update

This commit is contained in:
Daniele Gobbetti 2015-07-25 21:36:46 +02:00
commit 47cbf68c37
10 changed files with 133 additions and 11 deletions

View File

@ -1,10 +1,14 @@
###Changelog
####Version 0.4.4
* Set GadgetBridge notification visibility to public, to show the connection status on the lockscreen
* Support for backup up and restoring of the activity database (via Debug activity)
* Support for graceful upgrades and downgrades, keeping your activity database intact
* Enhancement to activity graphs: new graphs for sleep data (only last night) accessible swiping right from the main graph
* Enhancement to graphs activity: it is now possible to fetch the activity data directly from this activity
* Pebble: experimental support for dismissing (all) notifications via actionable notifications (disabled by default)
* Pebble: make FW 3.x notifications available by default
* Mi Band: Set the graphs activity as the default action available with a single tap on the connected device
####Version 0.4.3
* Mi Band: Support for setting alarms

View File

@ -49,6 +49,7 @@ public class GB {
notificationIntent, 0);
return new NotificationCompat.Builder(context)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setContentTitle(context.getString(R.string.app_name))
.setTicker(text)
.setContentText(text)

View File

@ -23,13 +23,15 @@ public class GBApplication extends Application {
public GBApplication() {
context = this;
mActivityDatabaseHandler = new ActivityDatabaseHandler(context);
// don't do anything here, add it to onCreate instead
}
@Override
public void onCreate() {
super.onCreate();
// don't do anything here before we set up logging, otherwise
// slf4j may be implicitly initialized before we properly configured it.
setupLogging();
// For debugging problems with the logback configuration
// LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
@ -37,6 +39,7 @@ public class GBApplication extends Application {
// StatusPrinter.print(lc);
// Logger logger = LoggerFactory.getLogger(GBApplication.class);
mActivityDatabaseHandler = new ActivityDatabaseHandler(context);
// for testing DB stuff
// SQLiteDatabase db = mActivityDatabaseHandler.getWritableDatabase();
// db.close();

View File

@ -686,7 +686,6 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
if (activityStruct.activityDataRemainingBytes == 0) {
sendAckDataTransfer(activityStruct.activityDataTimestampToAck, activityStruct.activityDataUntilNextHeader);
flushActivityDataHolder();
}
}
@ -726,6 +725,11 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
}
private void flushActivityDataHolder() {
if (activityStruct == null) {
LOG.debug("nothing to flush, struct is already null");
return;
}
LOG.debug("flushing activity data holder");
byte category, intensity, steps;
ActivityDatabaseHandler dbHandler = GBApplication.getActivityDatabaseHandler();
@ -784,6 +788,10 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
TransactionBuilder builder = performInitialized("send acknowledge");
builder.write(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT), ack);
builder.queue(getQueue());
// flush to the DB after sending the ACK
flushActivityDataHolder();
//The last data chunk sent by the miband has always length 0.
//When we ack this chunk, the transfer is done.
if(getDevice().isBusy() && bytesTransferred==0) {
@ -795,6 +803,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
}
private void handleActivityFetchFinish() {
LOG.info("Fetching activity data has finished.");
activityStruct = null;
unsetBusy();
}

View File

@ -404,7 +404,6 @@ public class PebbleProtocol extends GBDeviceProtocol {
// pin - 46 bytes
buf.put(uuid_buf); // random UUID
Arrays.fill(uuid_buf, (byte) 0);
buf.put(uuid_buf); // parent UUID
buf.putInt(timestamp); // 32-bit timestamp
buf.putShort((short) 0); // duration
@ -520,8 +519,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
return buf.array();
}
@Override
public byte[] encodePhoneVersion(byte os) {
private byte[] encodePhoneVersion2x(byte os) {
ByteBuffer buf = ByteBuffer.allocate(LENGTH_PREFIX + LENGTH_PHONEVERSION);
buf.order(ByteOrder.BIG_ENDIAN);
buf.putShort(LENGTH_PHONEVERSION);
@ -544,6 +542,35 @@ public class PebbleProtocol extends GBDeviceProtocol {
return buf.array();
}
private byte[] encodePhoneVersion3x(byte os) {
ByteBuffer buf = ByteBuffer.allocate(LENGTH_PREFIX + 25);
buf.order(ByteOrder.BIG_ENDIAN);
buf.putShort((short) 25);
buf.putShort(ENDPOINT_PHONEVERSION);
buf.put((byte) 0x01);
buf.putInt(-1); //0xffffffff
buf.putInt(0);
buf.putInt(os);
buf.put(PHONEVERSION_APPVERSION_MAGIC);
buf.put((byte) 3); // major?
buf.put((byte) 0); // minor?
buf.put((byte) 1); // patch?
buf.put((byte) 3); // ???
buf.put((byte) 0); // ???
buf.put((byte) 0); // ???
buf.put((byte) 0); // ???
buf.putInt(0); // ???
return buf.array();
}
@Override
public byte[] encodePhoneVersion(byte os) {
return encodePhoneVersion3x(os);
}
@Override
public byte[] encodeReboot() {
return encodeSimpleMessage(ENDPOINT_RESET, RESET_REBOOT);

View File

@ -5,7 +5,6 @@
<string name="action_settings">Einstellungen</string>
<string name="action_debug">Debug</string>
<string name="action_quit">Beenden</string>
<string name="controlcenter_fetch_activity_data">Aktivitätsdaten holen</string>
<string name="controlcenter_start_sleepmonitor">Schlafmonitor (ALPHA)</string>
<string name="controlcenter_find_device">Gerätesuche</string>
<string name="controlcenter_take_screenshot">Bildschirmfoto</string>

View File

@ -5,7 +5,6 @@
<string name="action_settings">Ajustes</string>
<string name="action_debug">Depuración</string>
<string name="action_quit">Salir</string>
<string name="controlcenter_fetch_activity_data">Extraer datos de actividad</string>
<string name="controlcenter_start_sleepmonitor">Monitor de sueño (ALPHA)</string>
<string name="controlcenter_find_device">Encontrar dispositivo...</string>
<string name="controlcenter_take_screenshot">Capturar pantall</string>
@ -121,7 +120,6 @@
<string name="pref_screen_notification_profile_incoming_call">Notificación de llamada entrante</string>
<string name="control_center_find_lost_device">Encuentra un dispositivo perdido</string>
<string name="control_center_cancel_to_stop_vibration">Cancelar para detener la vibración.</string>
<string name="title_activity_charts">Gráficos</string>
<string name="title_activity_set_alarm">Configurar alarmas</string>
<string name="controlcenter_start_configure_alarms">Configurar alarmas</string>
<string name="title_activity_alarm_details">Detalles de alarma</string>
@ -135,4 +133,5 @@
<string name="alarm_smart_wakeup">despertador inteligente</string>
<string name="user_feedback_miband_set_alarms_failed">Hubo un error al configurar las alarmas, ¡por favor inténtalo de nuevo!</string>
<string name="user_feedback_miband_set_alarms_ok">¡Alarmas enviadas al dispositivo!</string>
<string name="chart_no_data_synchronize">Sin datos. ¿Sincronizar dispositivo?</string>
</resources>

View File

@ -5,7 +5,6 @@
<string name="action_settings">Impostazioni</string>
<string name="action_debug">Debug</string>
<string name="action_quit">Esci</string>
<string name="controlcenter_fetch_activity_data">Recupera dati attività</string>
<string name="controlcenter_start_sleepmonitor">Monitoraggio del sonno (ALPHA)</string>
<string name="controlcenter_find_device">Trova dispositivo...</string>
<string name="controlcenter_take_screenshot">Salva uno screenshot</string>
@ -121,7 +120,6 @@
<string name="pref_screen_notification_profile_incoming_call">Notiche chiamata in arrivo</string>
<string name="control_center_find_lost_device">Trova dispositivo smarrito</string>
<string name="control_center_cancel_to_stop_vibration">Annulla per fermare la vibrazion</string>
<string name="title_activity_charts">Grafici</string>
<string name="title_activity_set_alarm">Configurazione sveglia</string>
<string name="controlcenter_start_configure_alarms">Configurazione sveglia</string>
<string name="title_activity_alarm_details">Sveglia</string>

View File

@ -5,6 +5,10 @@
<string name="action_settings">설정</string>
<string name="action_debug">디버그</string>
<string name="action_quit">종료</string>
<string name="controlcenter_start_sleepmonitor">수면 측정계 (초기 버전)</string>
<string name="controlcenter_find_device">기기 찾기</string>
<string name="controlcenter_take_screenshot">스크린샷 찍기</string>
<string name="controlcenter_disconnect">연결 해제</string>
<string name="title_activity_debug">디버그</string>
<!--Strings related to AppManager-->
<string name="title_activity_appmanager">앱 관리자</string>
@ -19,7 +23,9 @@
<string name="pref_title_datetime_syctimeonconnect">시간 동기화</string>
<string name="pref_summary_datetime_syctimeonconnect">시간이 바뀌거나, 시간대가 바뀌거나, 접속을 할 때 기기와 시간을 동기화</string>
<string name="pref_header_notifications">알림</string>
<string name="pref_title_notifications_repetitions">반복</string>
<string name="pref_title_notifications_sms">SMS</string>
<string name="pref_title_notifications_incoming_call">걸려오는 전화</string>
<string name="pref_title_notifications_k9mail">K-9 메일</string>
<string name="pref_title_notifications_pebblemsg">Pebble 메세지</string>
<string name="pref_summary_notifications_pebblemsg">인텐트를 통해 Pebble에 알림을 전송할 수 있는 앱 지원. Conversations 앱 등에 사용할 수 있습니다.</string>
@ -30,6 +36,9 @@
<string name="never">하지 않음</string>
<string name="pref_header_development">개발자 옵션</string>
<string name="pref_title_development_miaddr">Mi Band 주소</string>
<string name="pref_title_pebble_settings">Pebble 설정</string>
<string name="pref_title_pebble_forceprotocol">강제 알림 프로토콜</string>
<string name="pref_summary_pebble_forceprotocol">이 옵션은 펌웨어 버전에 따라 최신 알림 프로토콜을 강제로 사용하도록 합니다. 자세한 내용을 알 경우에만 이 옵션을 사용하세요.</string>
<string name="not_connected">연결되지 않음</string>
<string name="connecting">연결 중</string>
<string name="connected">연결됨</string>
@ -73,6 +82,8 @@
<string name="male">남성</string>
<string name="female">여성</string>
<string name="other">기타</string>
<string name="left">왼쪽</string>
<string name="right">오른쪽</string>
<string name="miband_pairing_using_dummy_userdata">올바르지 않은 사용자 정보입니다. 일단 임시 사용자 정보를 사용합니다.</string>
<string name="miband_pairing_tap_hint">Mi Band가 진동하고 깜빡일 때, 연달아 몇 번 두드리세요.</string>
<string name="appinstaller_install">설치</string>
@ -88,4 +99,38 @@
<string name="pref_header_vibration_count">진동 횟수</string>
<string name="title_activity_sleepmonitor">수면 측정계</string>
<string name="pref_write_logfiles">기록 파일 작성 (재시작 필요)</string>
<string name="initializing">초기화 중</string>
<string name="busy_task_fetch_activity_data">활동 데이터 가져오는 중</string>
<string name="sleep_activity_date_range">%1$s에서 %2$s(으)로</string>
<string name="miband_prefs_wearside">왼쪽과 오른쪽 중 어느 방향으로 착용합니까?</string>
<string name="pref_screen_vibration_profile">진동 프로파일</string>
<string name="vibration_profile_staccato">스타카토</string>
<string name="vibration_profile_short">짧게</string>
<string name="vibration_profile_medium">보통</string>
<string name="vibration_profile_long">길게</string>
<string name="vibration_profile_waterdrop">물방울</string>
<string name="vibration_profile_ring">벨소리</string>
<string name="vibration_profile_alarm_clock">알람 시계</string>
<string name="miband_prefs_vibration">진동</string>
<string name="pref_screen_notification_profile_sms">SMS 알림</string>
<string name="pref_header_vibration_settings">진동 설정</string>
<string name="pref_screen_notification_profile_generic">일반 알림</string>
<string name="pref_screen_notification_profile_pebblemsg">Pebble 알림</string>
<string name="pref_screen_notification_profile_k9mail">K-9 Mail 알림</string>
<string name="pref_screen_notification_profile_incoming_call">걸려오는 전화 알림</string>
<string name="control_center_find_lost_device">잃어버린 기기 찾기</string>
<string name="control_center_cancel_to_stop_vibration">진동을 멈추려면 취소를 선택하세요.</string>
<string name="title_activity_set_alarm">알람 설정</string>
<string name="controlcenter_start_configure_alarms">알람 설정</string>
<string name="title_activity_alarm_details">알람 상세 정보</string>
<string name="alarm_sun_short">일요일</string>
<string name="alarm_mon_short">월요일</string>
<string name="alarm_tue_short">화요일</string>
<string name="alarm_wed_short">수요일</string>
<string name="alarm_thu_short">목요일</string>
<string name="alarm_fri_short">금요일</string>
<string name="alarm_sat_short">토요일</string>
<string name="alarm_smart_wakeup">스마트 깨우기</string>
<string name="user_feedback_miband_set_alarms_failed">알람 설정 오류가 발생했습니다. 다시 시도하세요!</string>
<string name="user_feedback_miband_set_alarms_ok">알람을 기기로 보냈습니다!</string>
</resources>

View File

@ -5,8 +5,9 @@
<string name="action_settings">Настройки</string>
<string name="action_debug">Отладка</string>
<string name="action_quit">Выход</string>
<string name="controlcenter_fetch_activity_data">Получить данные активности</string>
<string name="controlcenter_start_sleepmonitor">Анализ сна (АЛЬФА)</string>
<string name="controlcenter_find_device">Найти устройство...</string>
<string name="controlcenter_take_screenshot">Сделать снимок экрана</string>
<string name="controlcenter_disconnect">Отключиться</string>
<string name="title_activity_debug">Отладка</string>
<!--Strings related to AppManager-->
@ -22,7 +23,9 @@
<string name="pref_title_datetime_syctimeonconnect">Синхронизировать время при подключении</string>
<string name="pref_summary_datetime_syctimeonconnect">Синхронизировать время при подключении к устройству, а также при изменении времени или временной зоны в системе</string>
<string name="pref_header_notifications">Уведомления</string>
<string name="pref_title_notifications_repetitions">Повторы</string>
<string name="pref_title_notifications_sms">СМС-сообщения</string>
<string name="pref_title_notifications_incoming_call">Входящие звонки</string>
<string name="pref_title_notifications_k9mail">K9-Mail</string>
<string name="pref_title_notifications_pebblemsg">Сообщения Pebble</string>
<string name="pref_summary_notifications_pebblemsg">Поддержка приложений, посылающих уведомления на Pebble с помощью Intent. Может использоваться для Conversations.</string>
@ -79,6 +82,8 @@
<string name="male">мужской</string>
<string name="female">женский</string>
<string name="other">другой</string>
<string name="left">слева</string>
<string name="right">справа</string>
<string name="miband_pairing_using_dummy_userdata">Не предоставлено действительных данных пользователя. Используются данные по-умолчанию.</string>
<string name="miband_pairing_tap_hint">Когда ваш Mi Band вибрирует и мигает, постучите по нему несколько раз.</string>
<string name="appinstaller_install">Установить</string>
@ -97,4 +102,36 @@
<string name="initializing">Инициализация</string>
<string name="busy_task_fetch_activity_data">Получение данных активности</string>
<string name="sleep_activity_date_range">От %1$s до %2$s</string>
<string name="miband_prefs_wearside">Носите на левой или правой руке?</string>
<string name="pref_screen_vibration_profile">Профиль вибро</string>
<string name="vibration_profile_staccato">Стаккато</string>
<string name="vibration_profile_short">Короткий</string>
<string name="vibration_profile_medium">Средний</string>
<string name="vibration_profile_long">Длинный</string>
<string name="vibration_profile_waterdrop">Капля воды</string>
<string name="vibration_profile_ring">Звонок</string>
<string name="vibration_profile_alarm_clock">Будильник</string>
<string name="miband_prefs_vibration">Вибро</string>
<string name="pref_screen_notification_profile_sms">SMS-уведомление</string>
<string name="pref_header_vibration_settings">Настройки вибро</string>
<string name="pref_screen_notification_profile_generic">Общие уведомления</string>
<string name="pref_screen_notification_profile_pebblemsg">Уведомления Pebble</string>
<string name="pref_screen_notification_profile_k9mail">Уведомления почты K9</string>
<string name="pref_screen_notification_profile_incoming_call">Уведомления о входящем звонке</string>
<string name="control_center_find_lost_device">Найти потерянное устройство</string>
<string name="control_center_cancel_to_stop_vibration">Отмените, чтобы остановить вибро</string>
<string name="title_activity_set_alarm">Завести Будильник</string>
<string name="controlcenter_start_configure_alarms">Завести будильник</string>
<string name="title_activity_alarm_details">Свойства будильника</string>
<string name="alarm_sun_short">Вс</string>
<string name="alarm_mon_short">Пн</string>
<string name="alarm_tue_short">Вт</string>
<string name="alarm_wed_short">Ср</string>
<string name="alarm_thu_short">Чт</string>
<string name="alarm_fri_short">Пт</string>
<string name="alarm_sat_short">Сб</string>
<string name="alarm_smart_wakeup">умное пробуждение</string>
<string name="user_feedback_miband_set_alarms_failed">Произошла ошибка при настройке будильника, попробуйте ещё!</string>
<string name="user_feedback_miband_set_alarms_ok">Будильник был послан на устройство!</string>
<string name="chart_no_data_synchronize">Нет данных. Синхронизировать устройство?</string>
</resources>