From 790e4d5d80d3da7fe1f6c3784d0a6caed54e813a Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Tue, 29 Dec 2015 20:45:37 +0100 Subject: [PATCH 01/11] update LICENSE.artwork --- LICENSE.artwork | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/LICENSE.artwork b/LICENSE.artwork index 2d71011a..378dc89f 100644 --- a/LICENSE.artwork +++ b/LICENSE.artwork @@ -1,10 +1,18 @@ The following artwork is licensed under the following licenses Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0): - ic_device_pebble.png (by xphnx) - ic_device_miband.png (by xphnx) - ic_activitytracker.png (by xphnx) - ic_watchface.png (by xphnx) + ic_device_pebble.png + ic_device_miband.png + ic_activitytracker.png + ic_watchface.png + ic_languagepack.png + ic_firmware.png + ic_watchapp.png + ic_systemapp.png +(All of the above by xphnx) + +Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA): + ic_launcher.png (by Joseph Kim) Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0): "GET IT ON F-Droid" button by Laura Kalbag. Source: https://ind.ie/about/blog/f-droid-button/ From eb50040320bdef94843e487eccc1a7affe0db4f6 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Tue, 29 Dec 2015 20:56:30 +0100 Subject: [PATCH 02/11] update CHANGELOG.md --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f713b503..7cc55802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,13 @@ ####Next Version * Read upcoming events (up to 7 days in the future). Requires READ_CALENDAR permission +* Fix double SMS on Sony Android and Android 6.0 * Pebble: Support replying to SMS form the watch (canned replies) * Pebble: Allow installing apps compiled with SDK 2.x also on the basalt platform (Time, Time Steel) * Pebble: Fix decoding strings in appmessages from the pebble (fixes sending SMS from "Dialer for Pebble") -* Miband: reserve some alarm slots for alerting when upcoming events begin. NB: the band will vibrate at the start time of the event, android reminders are ignored +* Pebble: support incoming reconnections when device returns from "Airplane Mode" or "Stand-By Mode" +* Mi Band: reserve some alarm slots for alerting when upcoming events begin. NB: the band will vibrate at the start time of the event, android reminders are ignored +* Mi Band: Display unique devices Names, not just "MI" * Some new and updated icons ####Version 0.6.9 @@ -22,7 +25,7 @@ * Mi Band 1S: hopefully fixed connection errors (#178) Notifications probably do not work yet, though ####Version 0.6.8 -* Mi Band support for Firmware upgrade/downgrade on Mi Band 1A (white LEDs, no heartrate sensor) +* Mi Band: support for Firmware upgrade/downgrade on Mi Band 1A (white LEDs, no heartrate sensor) * Pebble: fix regression in 0.6.7 when installing pbw/pbz files from content providers (eg. download manager) * Pebble: fix installation of pbw files on firmware 3.x when using content providers (eg. download manager) * Pebble: fix crash on firmware 3.x when pebble requests a pbw that is not in Gadgetbridge's cache From ae269e51e78a711f3720be38f5792a99aaf81805 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 31 Dec 2015 00:40:22 +0100 Subject: [PATCH 03/11] update README.md, bump version --- README.md | 15 ++++----------- app/build.gradle | 4 ++-- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ea823732..0a4d1378 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ need to create an account and transmit any of your data to the vendor's servers. ## Features (Pebble) -* Incoming calls notification and display (caller, phone number) +* Incoming calls notification and display * Outgoing call display * Reject/hangup calls -* SMS notification (sender, body) -* K-9 Mail notification support (sender, subject, preview) +* SMS notification including experimental support for 16 predefined replies +* K-9 Mail notification support * Support for generic notifications (above filtered out) -* Dismiss individial notifications or open corresponding app on phone from the action menu (generic notifications) +* Dismiss individial notifications, mute or open corresponding app on phone from the action menu (generic notifications) * Dismiss all notifications from the action menu (non-generic notifications) * Music playback info (artist, album, track) * Music control: play/pause, next track, previous track, volume up, volume down @@ -37,13 +37,6 @@ need to create an account and transmit any of your data to the vendor's servers. ## Notes about Firmware 3.x (Pebble Time, updated OG) * Listing installed watchfaces will simply display previously installed watchapps, no matter if they are still installed or not. -* You should disable the "Stand-By-Mode" introduced in firmware 3.4. -According to pebble, this mode will disable bluetooth automatically when the -pebble does not sense motion for about 30 minutes, and then re-enable it if it -senses motion again. We do not support initiating connections from the pebble -yet, so this will leave you pebble disconnected until you connect it again -manually, and/or use even more energy by triggering a reconnect from -Gadgetbridge. ## How to use (Pebble) diff --git a/app/build.gradle b/app/build.gradle index 6fbefa72..fd226246 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,8 @@ android { targetSdkVersion 23 // note: always bump BOTH versionCode and versionName! - versionName "0.6.9" - versionCode 35 + versionName "0.7.0" + versionCode 36 } buildTypes { release { From ba446b7b17fe0cfc12f3adc4a28b538d4398da17 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 31 Dec 2015 00:41:22 +0100 Subject: [PATCH 04/11] update spanish translation from transifex (thanks) --- app/src/main/res/values-es/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index bf5d28be..74539775 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -199,4 +199,5 @@ Firmware incompatible Este firmware no es compatible con tu dispositivo Reserva de alarmas para próximos eventos + esperando reconexión From 3655c833a99ed764015a826150786bac3217a54a Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 31 Dec 2015 00:57:45 +0100 Subject: [PATCH 05/11] Add new languages from transifex (Polish and Vietnamese). Thanks!! --- app/src/main/res/values-pl/strings.xml | 203 +++++++++++++++++++++++++ app/src/main/res/values-vi/strings.xml | 132 ++++++++++++++++ 2 files changed, 335 insertions(+) create mode 100644 app/src/main/res/values-pl/strings.xml create mode 100644 app/src/main/res/values-vi/strings.xml diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml new file mode 100644 index 00000000..e909702f --- /dev/null +++ b/app/src/main/res/values-pl/strings.xml @@ -0,0 +1,203 @@ + + + Gadgetbridge + Gadgetbridge + Ustawienia + Usuń błąd + Zakończ + Synchronizuj + Monitor snu (ALPHA) + Odnajdź zagubione urządzenie + Zrób printscreen + Rozłącz + Usuń błąd + + Zarządzanie aplikacjami + Usuń + + Czarna lista powiadomień + + Instalator FW/Aplikacji + Masz zamiar zainstalować firmware %s zamiast aktualnie zainstalowanego na twoim Mi Band + Ten firmware został przetestowany i jest zgodny z Gadgetbridge. + Ten firmware nie jest przetestowany i może nie być zgodny z Gadgetbridge.\n\n Nie zalecamy wgrywania na twój Mi Band! + Jeśli nadal chcesz kontynuować i po instalacji wszystko działa prawidłowo, proszę powiadom programistów Gadgetbridge by dodali wersję firmware: %s do białej listy. + + Ustawienia + Ustawienia ogólne + Połącz z urządzeniem gdy Bluetooth jest włączone + Domyślny odtwarzacz muzyki + Domyślny + Data i godzina + Synchronizuj czas + Synchronizuj czas urządzenia podczas połączenia gdy czas lub strefa czasowa zmienia się na Androidzie + Powiadomienia + Powtórzenia + Połączenia + SMS + K9-Mail + Wiadomości Pebble + Obsługa aplikacji które wysyłają powiadomienia do Pebble przez Intent. Może być użyte do konwersacji + Obsługa ogólnych powiadomień + ... także gdy ekran jest włączony + zawsze + gdy ekran jest wyłączony + nigdy + Czarna lista aplikacji + Odrzucone odpowiedzi + Ustawienia programisty + Adres Mi Band + Ustawienia Pebble + Zezwól zewnętrznym aplikacjom Android na dostęp + Włącz eksperymentalną obsługę aplikacji android przez PebbleKit + Wymuś protokół komunikacji + Ta opcja wymusza użycie najnowszego protokołu powiadomień w zależności od wersji firmware. WŁĄCZ JEDYNIE JEŚLI WIESZ CO ROBISZ! + Włącz nietestowane funkcje + Włącz nie testowane funkcje. WŁĄCZ JEDYNIE JEŚLI WIESZ CO ROBISZ! + Próby ponownego połączenia + nie połączony + łącze + połączony + nieznany stan + Wersja hardware: %1$s FW: %2$s + Wersja firmware: %1$s + (nieznane) + Test + Test powiadomień + To jest testowe powiadomienie z Gadgetbridge + Bluetooth nie jest obsługiwane + Bluetooth jest wyłączone + Kliknij podłączone urządzenia dla zarządzania aplikacjami + kliknij urządzenie by połączyć + Nie można połączyć. Adres BT nieprawidłowy? + Gadgetbridge działa + Instalowanie binarki %1$d/%2$d + Instalacja nie powiodła się + Instalacja powiodła się + MASZ ZAMIAR ZAINSTALOWAĆ FIRMWARE, POSTĘPUJ NA WŁASNĄ ODPOWIEDZIALNOŚĆ \n\n\n Ten firmware jest dla wersji: %s hardware + Zamierzasz zainstalować poniższą aplikacje :\n\n\n%1$s wersja %2$s przez %3$s\n + Nie dostępne + rozpoczęty + %1$s przez %2$s + Wykrywanie urządzeń + Przerwij wyszukiwanie + Rozpocznij wyszukiwanie + Podłącz nowe urządzenie + %1$s (%2$s) + sparuj urządzenie + Użyj parowania bluetooth na androidzie by sparować urządzenie. + Sparuj swoje Mi Band + Parowanie z %s… + Żaden mac nie przeszedł, nie można sparować. + Ustawienia danego urządzenia + Ustawienia Mi Band + mężczyzna + kobieta + inne + lewa + prawa + Brak prawidłowych danych użytkownika, używam danych zastępczych na ten moment. + Gdy twój Mi Band wibruje i błyska, stuknij go kilka razy pod rząd. + instaluj + Uwidocznij swoje urządzenie. Aktualnie połączone urządzenia prawdopodobnie nie będą znalezione. + Uwaga + Obraz urządzenia + O tobie + Nazwisko/Pseudonim + Data urodzenia + Płeć + Wzrost w cm + Waga w kg + Liczba wibracji + Monitor snu + Zapisuj logi (wymaga restartu) + Uruchamianie + Pobieranie danych aktywności + Od %1$s do %2$s + Nosisz na prawej czy lewej? + Profil wibracji + Słabe + Krótkie + Średnie + Długie + Kropla wody + Dzwoń + Budzik + Wibracja + Powiadomienie SMS + Ustawienia wibracji + Ogólne powiadomienia + Powiadomienia Pebble + Powiadomienia K9 Mail + Powiadomienia o połaczeniach przychodzących + Odnajdź zagubione urządzenie + Anuluj by przerwać wibracje. + Twoja aktywność + Konfiguruj alarmy + Konfiguruj alarmy + Szczegóły alarmu + Niedź + Pon + Wto + Śro + Czw + Pią + Sob + Inteligentna pobudka + Błąd podczas ustawiania alarmu, proszę spróbuj ponownie! + Alarmy wysłane do urządzenia + Brak danych, Synchronizować urządzenie? + Zamierzam przesłać %1$s danych,rozpoczynając od %2$s + Cel kroków na każdy dzień + Błąd przetwarzania \'%1$s\' + Twoja aktywność (ALPHA) + Nie można połączyć: %1$s + Nie można znaleźć procedury by zainstalować ten plik. + Nie można zainstalować podanego pliku : %1$s + Nie możliwa instalacja firmware: nie odpowiada wersji hardware twojego Pebble. + Proszę czekać podczas określania statusu instalacji... + Bateria prawie wyładowana + %1$s pozostało baterii: %2$s%% + Ostatnio ładowano: %s \n + Liczba ładowań: %s + Czas spania + Liczba kroków tygodniowo + Twoja aktywność i sen + Aktualizacja Firmware... + Plik nie może być zainstalowany, urządzenie nie gotowe. + Firmware Mi Band %1$s + Zgodna wersja + Nietestowana wersja! + Połączenie z urządzeniem %1$s + Firmware Pebble %1$s + Prawidłowa wersja hardware + Niezgodność wersji hardware! + %1$s (%2$s) + Problem podczas przesyłania firmware. NIE RESTARTUJ swojego Mi Band! + Problem z transferem metadanych firmware + Instalacja firmware zakończona + Instalacja firmware zakończona, restart urządzenia + Instalacja firmware nie powiodła się + Kroki + Ostatnia aktywność + Kroków dziś, cel: %1$s + Gdy dane aktywności nie są przesłane na opaskę, wtedy nie będą usuwane. Przydatne gdy Gadgetbridge jest używany wraz z innymi aplikacjami + Dane aktywności będą zachowane na Mi Band nawet po synchronizacji. Przydatne gdy Gadgetbridge jest używany z innymi aplikacjami. + Nie wysyłaj danych aktywności + Historia kroków + Aktualnie kroków/min + Kroków łącznie + Historia kroków na minutę + Rozpocznij aktywność + Aktywność + Płytki sen + Głęboki sen + Niezałożona + Nie połączono + Wszystkie alarmy wyłączono + Zachowaj dane aktywności na urządzeniu + Niekompatybilny firmware + Ten firmware nie jest kompatybilny z urządzeniem + Alarmy zarezerwowane dla nadchodzących zdarzeń + oczekiwanie na ponowne połaczenie + diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml new file mode 100644 index 00000000..9a6a7738 --- /dev/null +++ b/app/src/main/res/values-vi/strings.xml @@ -0,0 +1,132 @@ + + + Gadgetbridge + Gadgetbridge + Cài đặt + Dò lỗi + Thoát + Đồng bộ + Giám sát giấc ngủ (ALPHA) + Tìm thiết bị thất lạc... + Chụp ảnh màn hình + Huỷ kết nối + Dò lỗi + + Trình quản lý ứng dụng + Xoá + + Danh sách đen thông báo + + Trình cài đặt FW/ứng dụng + Bạn sắp cài đặt phần cứng %s thay cho phiên bản hiện thời trên Mi Band của bạn. + + Cài đặt + Cài đặt tổng quát + Mặc định + Ngày giờ + Đồng bộ giờ + Đồng bộ giờ cho thiết bị khi kết nối và khi giờ hoặc múi giờ thay đổi trên Android. + Thông báo + Lặp lại + Các cuộc gọi + SMS + K9-Mail + Tin nhắn Pebble + luôn luôn + khi tắt màn hình + không bao giờ + Ứng dụng trong Danh sách đen + Tuỳ chọn cho Nhà phát triển + Địa chỉ Mi Band + Cài đặt Pebble + Cho phép ứng dụng Android bên thứ 3 quyền truy cập + chưa kết nối + đang kết nối + đã kết nối + không rõ tình trạng + HW: %1$s FW: %2$s + FW: %1$s + (không rõ) + Kiểm tra + Kiểm tra thông báo + Đây là một kiểm tra thông báo từ Gadgetbridge + Không hỗ trợ Bluetooth. + Đã tắt Bluetooth. + chạm vào thiết bị đã kết nối để chạy Trình quản lý ứng dụng + chạm vào một thiết bị để kết nối + Không thể kết nối. Địa chỉ BT không hợp lệ? + Gadgetbridge đang chạy + đang cài phần mềm chạy %1$d/%2$d + cài đặt thất bại! + cài đặt thành công + N/A + đã khởi chạy + %1$s bởi %2$s + Dò tìm thiết bị + Dừng quét + Bắt đầu dò tìm + Kết nối thiết bị mới + %1$s (%2$s) + Ghép đôi thiết bị + Ghép đôi Mi Band + Đang ghép đôi với %s… + không thể kiểm tra địa chỉ mac, không thể ghép đôi. + Cài đặt cụ thể cho thiết bị + Cài đặt Mi Band + nam + nữ + khác + trái + phải + Cài đặt + Ghi chú: + Ảnh thiết bị + Thông tin về bạn + Tên/Bí danh + Năm sinh + Giới tính + Chiều cao bằng cm + Trọng lượng bằng kg + Trình giám sát giấc ngủ + Ghi tập tin nhật ký (cần khởi động lại) + đang khởi chạy + Từ %1$s đến %2$s + Đeo bên trái hay phải? + Ngắn + Trung bình + Dài + Thông báo SMS + Cài đặt rung + Thông báo Pebble + Thông báo K9 Mail + Thông báo cuộc gọi đến + Tìm thiết bị thất lạc + Huỷ để ngừng rung. + Hoạt động của bạn + Cấu hình báo thức + Cấu hình báo thức + Chi tiết báo thức + CN + T2 + T3 + T4 + T5 + T6 + T7 + %1$s (%2$s) + Số bước + Lịch sử bước chân + Số bước/phút hiện thời + Tổng số bước + Lịch sử số bước trên phút + Bắt đầu hoạt động + Hoạt động + Giấc ngủ nông + Giấc ngủ sâu + Không đeo + Không kết nối. + Đã tắt hết báo thức + Giữ dữ liệu hoạt động trên thiết bị + Phần cứng không tương thích + Phần cứng này không tương thích với thiết bị + From 890016d6529e38b2898882af3655f6ec6b3e0fc7 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 31 Dec 2015 01:13:48 +0100 Subject: [PATCH 06/11] Pebble: Fix crash when turning off bluetooth when connected on Android 6.0 --- CHANGELOG.md | 3 ++- .../gadgetbridge/service/devices/pebble/PebbleIoThread.java | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cc55802..7407c364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ * Pebble: Support replying to SMS form the watch (canned replies) * Pebble: Allow installing apps compiled with SDK 2.x also on the basalt platform (Time, Time Steel) * Pebble: Fix decoding strings in appmessages from the pebble (fixes sending SMS from "Dialer for Pebble") -* Pebble: support incoming reconnections when device returns from "Airplane Mode" or "Stand-By Mode" +* Pebble: Support incoming reconnections when device returns from "Airplane Mode" or "Stand-By Mode" +* Pebble: Fix crash when turning off bluetooth when connected on Android 6.0 * Mi Band: reserve some alarm slots for alerting when upcoming events begin. NB: the band will vibrate at the start time of the event, android reminders are ignored * Mi Band: Display unique devices Names, not just "MI" * Some new and updated icons diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java index 3e4edbd5..6d24bad3 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java @@ -178,6 +178,9 @@ public class PebbleIoThread extends GBDeviceIoThread { mIsTCP = false; BluetoothDevice btDevice = mBtAdapter.getRemoteDevice(btDeviceAddress); ParcelUuid uuids[] = btDevice.getUuids(); + if (uuids == null) { + return false; + } for (ParcelUuid uuid : uuids) { LOG.info("found service UUID " + uuid); } From d358ed81d2295d0fa1c0dbe091242a9229e219ce Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 31 Dec 2015 01:43:00 +0100 Subject: [PATCH 07/11] Pebble: Display a failure if we cannot map a notification id back to a Phone number when replying to an SMS --- .../devices/pebble/PebbleProtocol.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java index 623e87b1..896be512 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java @@ -18,6 +18,7 @@ import java.util.Random; import java.util.SimpleTimeZone; import java.util.UUID; +import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventAppInfo; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventAppManagement; @@ -1579,6 +1580,7 @@ public class PebbleProtocol extends GBDeviceProtocol { icon_id = PebbleIconID.RESULT_MUTE; break; case 0x05: + boolean failed = true; byte attribute_count = buf.get(); if (attribute_count > 0) { byte attribute = buf.get(); @@ -1587,16 +1589,18 @@ public class PebbleProtocol extends GBDeviceProtocol { if (length > 64) length = 64; byte[] reply = new byte[length]; buf.get(reply); - devEvtNotificationControl.event = GBDeviceEventNotificationControl.Event.REPLY; - devEvtNotificationControl.reply = new String(reply); - caption = "SENT"; - icon_id = PebbleIconID.RESULT_SENT; - } else { - devEvtNotificationControl = null; // error - caption = "FAILED"; - icon_id = PebbleIconID.RESULT_FAILED; + // FIXME: this does not belong here, but we want at least check if there is no chance at all to send out the SMS later before we report success + String phoneNumber = GBApplication.getIDSenderLookup().lookup(id); + if (phoneNumber != null) { + devEvtNotificationControl.event = GBDeviceEventNotificationControl.Event.REPLY; + devEvtNotificationControl.reply = new String(reply); + caption = "SENT"; + icon_id = PebbleIconID.RESULT_SENT; + failed = false; + } } - } else { + } + if (failed) { caption = "FAILED"; icon_id = PebbleIconID.RESULT_FAILED; devEvtNotificationControl = null; // error From 50cd5b26294c38578077b6ad7e16b88b643711c1 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 2 Jan 2016 00:30:11 +0100 Subject: [PATCH 08/11] Pebble: Fix regression which freezes Gadgetbridge when disconnecting via long-press menu --- CHANGELOG.md | 3 +++ .../gadgetbridge/service/devices/pebble/PebbleIoThread.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7407c364..a8b847b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ###Changelog ####Next Version +*Pebble: Fix regression which freezes Gadgetbridge when disconnecting via long-press menu + +####Version 0.7.0 * Read upcoming events (up to 7 days in the future). Requires READ_CALENDAR permission * Fix double SMS on Sony Android and Android 6.0 * Pebble: Support replying to SMS form the watch (canned replies) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java index 6d24bad3..3d0597e0 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java @@ -367,7 +367,7 @@ public class PebbleIoThread extends GBDeviceIoThread { mIsConnected = connect(gbDevice.getAddress()); } } - if (!mIsConnected) { + if (!mIsConnected && !mQuit) { try { gbDevice.setState(GBDevice.State.WAITING_FOR_RECONNECT); gbDevice.sendDeviceUpdateIntent(getContext()); From d7f74851e213404cbfbf15c0a72e8ffd007109d4 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 2 Jan 2016 12:24:23 +0100 Subject: [PATCH 09/11] Pebble: allow reinstallation of apps in pbw-cache from App Manager (long press menu) See #93 Also bump version, update CHANGELOG.md --- CHANGELOG.md | 5 +++-- app/build.gradle | 4 ++-- .../activities/AppManagerActivity.java | 20 +++++++++++++++---- .../activities/ControlCenter.java | 3 --- .../gadgetbridge/impl/GBDeviceApp.java | 9 +++++++++ app/src/main/res/menu/appmanager_context.xml | 3 +++ app/src/main/res/values/strings.xml | 1 + 7 files changed, 34 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8b847b6..c48e4e23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ ###Changelog -####Next Version -*Pebble: Fix regression which freezes Gadgetbridge when disconnecting via long-press menu +####Version 0.7.1 +* Pebble: allow reinstallation of apps in pbw-cache from App Manager (long press menu) +* Pebble: Fix regression which freezes Gadgetbridge when disconnecting via long-press menu ####Version 0.7.0 * Read upcoming events (up to 7 days in the future). Requires READ_CALENDAR permission diff --git a/app/build.gradle b/app/build.gradle index fd226246..498f1b8a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,8 @@ android { targetSdkVersion 23 // note: always bump BOTH versionCode and versionName! - versionName "0.7.0" - versionCode 36 + versionName "0.7.1" + versionCode 37 } buildTypes { release { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java index 4071de6d..19d07b16 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppManagerActivity.java @@ -6,6 +6,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; +import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.app.NavUtils; @@ -150,10 +151,13 @@ public class AppManagerActivity extends Activity { @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); - getMenuInflater().inflate( - R.menu.appmanager_context, menu); + getMenuInflater().inflate(R.menu.appmanager_context, menu); AdapterView.AdapterContextMenuInfo acmi = (AdapterView.AdapterContextMenuInfo) menuInfo; selectedApp = appList.get(acmi.position); + + if (!selectedApp.isInCache()) { + menu.removeItem(R.id.appmanager_app_reinstall); + } menu.setHeaderTitle(selectedApp.getName()); } @@ -161,9 +165,17 @@ public class AppManagerActivity extends Activity { public boolean onContextItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.appmanager_app_delete: - if (selectedApp != null) { - GBApplication.deviceService().onAppDelete(selectedApp.getUUID()); + GBApplication.deviceService().onAppDelete(selectedApp.getUUID()); + return true; + case R.id.appmanager_app_reinstall: + File cachePath; + try { + cachePath = new File(FileUtils.getExternalFilesDir().getPath() + "/pbw-cache/" + selectedApp.getUUID() + ".pbw"); + } catch (IOException e) { + LOG.warn("could not get external dir while reading pbw cache."); + return true; } + GBApplication.deviceService().onInstallApp(Uri.fromFile(cachePath)); return true; default: return super.onContextItemSelected(item); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java index 87ccd58e..db241ed9 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java @@ -2,7 +2,6 @@ package nodomain.freeyourgadget.gadgetbridge.activities; import android.app.Activity; import android.app.ProgressDialog; -import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.Context; @@ -35,9 +34,7 @@ import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.activities.charts.ChartsActivity; import nodomain.freeyourgadget.gadgetbridge.adapter.GBDeviceAdapter; import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator; -import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; -import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper; import nodomain.freeyourgadget.gadgetbridge.util.GB; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceApp.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceApp.java index fda269a9..9743a083 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceApp.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceApp.java @@ -11,6 +11,7 @@ public class GBDeviceApp { private final String version; private final UUID uuid; private final Type type; + private final boolean inCache; public GBDeviceApp(UUID uuid, String name, String creator, String version, Type type) { this.uuid = uuid; @@ -18,6 +19,8 @@ public class GBDeviceApp { this.creator = creator; this.version = version; this.type = type; + //FIXME: do not assume + this.inCache = false; } public GBDeviceApp(JSONObject json) { @@ -42,6 +45,12 @@ public class GBDeviceApp { this.creator = creator; this.version = version; this.type = type; + //FIXME: do not assume + this.inCache = true; + } + + public boolean isInCache() { + return inCache; } public String getName() { diff --git a/app/src/main/res/menu/appmanager_context.xml b/app/src/main/res/menu/appmanager_context.xml index d2dd4f5d..60f1653d 100644 --- a/app/src/main/res/menu/appmanager_context.xml +++ b/app/src/main/res/menu/appmanager_context.xml @@ -1,5 +1,8 @@ + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f78058a7..a9e8ef3d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -216,4 +216,5 @@ This firmware is not compatible with the device Alarms to reserve for upcoming events waiting for reconnect + Reinstall From e41a9c208b809a9aba192ce17af1edbbd469c5ca Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 2 Jan 2016 12:26:15 +0100 Subject: [PATCH 10/11] update spanish translation from transifex (thanks!) --- app/src/main/res/values-es/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 74539775..2c5cd554 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -94,8 +94,8 @@ masculino femenino otro - zurdo - diestro + izquierda + derecha No se han proporcionado datos de usuario válidos, se usarán datos de usuario por defecto. Cuando tu MiBand vibre y parpadee, púlsala repetidas veces. Instalar @@ -114,7 +114,7 @@ iniciando Recuperando datos de actividad Desde %1$s a %2$s - ¿Zurdo o diestro? + ¿En derecha o en izquierda? Perfil de vibración Muy corto Corto From c425fd24ea04afb4bb24ac6450c7cb18403c28eb Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 2 Jan 2016 17:18:05 +0100 Subject: [PATCH 11/11] sort blacklist by package name #195 --- .../activities/AppBlacklistActivity.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppBlacklistActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppBlacklistActivity.java index c19f2349..630e9c04 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppBlacklistActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AppBlacklistActivity.java @@ -84,8 +84,17 @@ public class AppBlacklistActivity extends Activity { Collections.sort(packageList, new Comparator() { @Override public int compare(ApplicationInfo ai1, ApplicationInfo ai2) { - int retval = GBApplication.blacklist.contains(ai1.packageName) ? -1 : 0; - return GBApplication.blacklist.contains(ai2.packageName) ? retval+=1 : retval; + boolean blacklisted1 = GBApplication.blacklist.contains(ai1.packageName); + boolean blacklisted2 = GBApplication.blacklist.contains(ai2.packageName); + + if ((blacklisted1 && blacklisted2) || (!blacklisted1 && !blacklisted2)) { + // both blacklisted or both not blacklisted = sort by alphabet + return ai1.packageName.compareTo(ai2.packageName); + } else if (blacklisted1) { + return -1; + } else { + return 1; + } } }); return view;