diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/amazfitbip/AmazfitBipService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/amazfitbip/AmazfitBipService.java index 4140c9798..3d543f69d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/amazfitbip/AmazfitBipService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/amazfitbip/AmazfitBipService.java @@ -21,4 +21,7 @@ import java.util.UUID; public class AmazfitBipService { public static final UUID UUID_CHARACTERISTIC_WEATHER = UUID.fromString("0000000e-0000-3512-2118-0009af100700"); + + // goes to UUID_CHARACTERISTIC_3_CONFIGURATION, TODO: validate this for Mi Band 2, it maybe triggers more than only GPS version... + public static final byte[] COMMAND_REQUEST_GPS_VERSION = new byte[]{0x0e}; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/AppNotificationType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/AppNotificationType.java index 770cab7e6..349fac0c0 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/AppNotificationType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/AppNotificationType.java @@ -47,6 +47,12 @@ public class AppNotificationType extends HashMap { // Generic Calendar put("com.android.calendar", NotificationType.GENERIC_CALENDAR); + // Google + put("com.google.android.gm", NotificationType.GMAIL); + put("com.google.android.apps.inbox", NotificationType.GOOGLE_INBOX); + put("com.google.android.calendar", NotificationType.GENERIC_CALENDAR); + put("com.google.android.apps.messaging", NotificationType.GOOGLE_MESSENGER); + // Conversations put("eu.siacs.conversations", NotificationType.CONVERSATIONS); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java index d5de714ee..837dec1a9 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java @@ -30,6 +30,9 @@ public enum NotificationType { GENERIC_NAVIGATION(PebbleIconID.LOCATION, PebbleColor.Orange), GENERIC_SMS(PebbleIconID.GENERIC_SMS, PebbleColor.VividViolet), GENERIC_CALENDAR(PebbleIconID.TIMELINE_CALENDAR, PebbleColor.Blue), + GMAIL(PebbleIconID.NOTIFICATION_GMAIL, PebbleColor.Red), + GOOGLE_INBOX(PebbleIconID.NOTIFICATION_GOOGLE_INBOX, PebbleColor.Blue), + GOOGLE_MESSENGER(PebbleIconID.NOTIFICATION_GOOGLE_MESSENGER, PebbleColor.Blue), FACEBOOK(PebbleIconID.NOTIFICATION_FACEBOOK, PebbleColor.Liberty), FACEBOOK_MESSENGER(PebbleIconID.NOTIFICATION_FACEBOOK_MESSENGER, PebbleColor.VeryLightBlue), RIOT(PebbleIconID.NOTIFICATION_HIPCHAT, PebbleColor.LavenderIndigo), @@ -73,7 +76,11 @@ public enum NotificationType { case SIGNAL: case TELEGRAM: case WHATSAPP: + case GOOGLE_MESSENGER: return "generic_chat"; + case GMAIL: + case GOOGLE_INBOX: + return "generic_email"; case UNKNOWN: default: return "generic"; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipFirmwareInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipFirmwareInfo.java index 0a126309e..c9dc6fa4d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipFirmwareInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipFirmwareInfo.java @@ -50,7 +50,7 @@ public class AmazfitBipFirmwareInfo extends Mi2FirmwareInfo { crcToVersion.put(12586, "RES 0.0.8.74"); // gps - crcToVersion.put(61520, "GPS 0.0.8.xx"); + crcToVersion.put(61520, "GPS 9367,8f79a91,0,0,"); } public AmazfitBipFirmwareInfo(byte[] bytes) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java index eb8157fcc..fe23fa7c2 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java @@ -16,6 +16,8 @@ along with this program. If not, see . */ package nodomain.freeyourgadget.gadgetbridge.service.devices.amazfitbip; +import android.bluetooth.BluetoothGatt; +import android.bluetooth.BluetoothGattCharacteristic; import android.net.Uri; import android.widget.Toast; @@ -26,11 +28,13 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.SimpleTimeZone; +import java.util.UUID; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventCallControl; import nodomain.freeyourgadget.gadgetbridge.devices.amazfitbip.AmazfitBipIcon; import nodomain.freeyourgadget.gadgetbridge.devices.amazfitbip.AmazfitBipService; import nodomain.freeyourgadget.gadgetbridge.devices.amazfitbip.AmazfitBipWeatherConditions; +import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBand2Service; import nodomain.freeyourgadget.gadgetbridge.model.CallSpec; import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec; import nodomain.freeyourgadget.gadgetbridge.model.NotificationType; @@ -181,4 +185,44 @@ public class AmazfitBipSupport extends MiBand2Support { } catch (IOException ignore) { } } -} \ No newline at end of file + + @Override + public boolean onCharacteristicChanged(BluetoothGatt gatt, + BluetoothGattCharacteristic characteristic) { + boolean handled = super.onCharacteristicChanged(gatt, characteristic); + if (!handled) { + UUID characteristicUUID = characteristic.getUuid(); + if (MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION.equals(characteristicUUID)) { + return handleConfigurationInfo(characteristic.getValue()); + } + } + return false; + } + + private boolean handleConfigurationInfo(byte[] value) { + if (value == null || value.length < 4) { + return false; + } + if (value[0] == 0x10 && value[1] == 0x0e && value[2] == 0x01) { + String gpsVersion = new String(value, 3, value.length - 3); + LOG.info("got gps version = " + gpsVersion); + gbDevice.setFirmwareVersion2(gpsVersion); + return true; + } + return false; + } + + // this probably does more than only getting the GPS version... + private AmazfitBipSupport requestGPSVersion(TransactionBuilder builder) { + LOG.info("Requesting GPS version"); + builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), AmazfitBipService.COMMAND_REQUEST_GPS_VERSION); + return this; + } + + @Override + public void phase2Initialize(TransactionBuilder builder) { + super.phase2Initialize(builder); + LOG.info("phase2Initialize..."); + requestGPSVersion(builder); + } +} diff --git a/app/src/main/res/drawable-hdpi/ic_information_outline_grey600_24dp.png b/app/src/main/res/drawable-hdpi/ic_information_outline_grey600_24dp.png deleted file mode 100644 index c9bdc6316..000000000 Binary files a/app/src/main/res/drawable-hdpi/ic_information_outline_grey600_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_information_outline_grey600_24dp.png b/app/src/main/res/drawable-mdpi/ic_information_outline_grey600_24dp.png deleted file mode 100644 index 1812a0ef4..000000000 Binary files a/app/src/main/res/drawable-mdpi/ic_information_outline_grey600_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_information_outline_grey600_24dp.png b/app/src/main/res/drawable-xhdpi/ic_information_outline_grey600_24dp.png deleted file mode 100644 index 86fc7a3aa..000000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_information_outline_grey600_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_information_outline_grey600_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_information_outline_grey600_24dp.png deleted file mode 100644 index 585deae0a..000000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_information_outline_grey600_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable/information_outline.xml b/app/src/main/res/drawable/information_outline.xml deleted file mode 100644 index 897c21e2d..000000000 --- a/app/src/main/res/drawable/information_outline.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_dummy.xml b/app/src/main/res/layout/fragment_dummy.xml deleted file mode 100644 index 485a44c83..000000000 --- a/app/src/main/res/layout/fragment_dummy.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/app/src/main/res/menu/menu_alarm_details.xml b/app/src/main/res/menu/menu_alarm_details.xml deleted file mode 100644 index 14e9fe768..000000000 --- a/app/src/main/res/menu/menu_alarm_details.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/app/src/main/res/menu/menu_set_alarm.xml b/app/src/main/res/menu/menu_set_alarm.xml deleted file mode 100644 index 835ed8d52..000000000 --- a/app/src/main/res/menu/menu_set_alarm.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index c53cecc34..fc3d61ed1 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -142,8 +142,6 @@ Připojování Připojeno Neznámý stav - HW: %1$s FW: %2$s - Verze FW: %1$s (neznámé) Test Test notifikací diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index e4eafd3b6..085d1f599 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -149,8 +149,6 @@ Verbinde Verbunden Unbekannter Zustand - HW: %1$s FW: %2$s - Firmware-Version %1$s (unbekannt) Test Test Benachrichtigung diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index df686a1e2..1b61547aa 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -149,8 +149,6 @@ conectando conectado estado desconocido - HW: %1$s FW: %2$s - FW: %1$s (desconocido) Probar Probar notificación diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index b9ba7ce74..373690b62 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -149,8 +149,6 @@ connexion en cours connecté état inconnu - HW: %1$s FW: %2$s - FW: %1$s (inconnu) Test Notification de test diff --git a/app/src/main/res/values-he/strings.xml b/app/src/main/res/values-he/strings.xml index 4955bfa9a..3745f7140 100644 --- a/app/src/main/res/values-he/strings.xml +++ b/app/src/main/res/values-he/strings.xml @@ -135,8 +135,6 @@ מחובר מתחבר מצב לא ידוע - חומרה: %1$s קושחה: %2$s - קושחה: %1$s (לא ידוע) בדיקה דיווח לבדיקה diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index e2b2df407..5190270c4 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -145,8 +145,6 @@ csatlakozás csatlakoztatva ismeretlen állapot - HW: %1$s FW: %2$s - FW: %1$s (ismeretlen) Teszt Teszt értesítés diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 8642b87b7..c51412f7f 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -144,8 +144,6 @@ in collegamento connesso stato sconosciuto - HW: %1$s FW: %2$s - FW: %1$s (sconosciuto) Test Notifica di prova diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 858a5c078..39f384787 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -149,8 +149,6 @@ 接続中 接続 不明な状態 - HW: %1$s FW: %2$s - FW: %1$s (不明) テスト 通知のテスト diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index da53ea2d7..5256737b7 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -67,8 +67,6 @@ 연결 중 연결됨 알 수 없는 상태 - HW: %1$s FW: %2$s - FW: %1$s (알 수 없음) 테스트 알림 테스트 diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 1b52a2f5c..494808723 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -98,8 +98,6 @@ łącze połączony nieznany stan - Wersja hardware: %1$s FW: %2$s - Wersja firmware: %1$s (nieznane) Test Test powiadomień diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 78c0e3650..185ce8d71 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -136,8 +136,6 @@ conectando conectado estado desconhecido - HW: %1$s FW: %2$s - FW: %1$s (desconhecido) Teste Teste de notificação diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index fa52294b3..106b386b9 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -142,8 +142,6 @@ a ligar ligado estado desconhecido - HW: %1$s FW: %2$s - Versão FW: %1$s (desconhecido) Teste Teste de notificação diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 256706cbb..283c294fa 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -145,8 +145,6 @@ соединение соединено неизвестное состояние - Версия устройства: %1$s Версия ПО: %2$s - ПО: %1$s (неизвестно) Тест Тест уведомлений diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index d67627cb2..350da6f6b 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -47,8 +47,6 @@ bağlanıyor bağlandı bilinmeyen durum - HW: %1$s FW: %2$s - FW: %1$s (bilinmeyen) Test Test bilgilendirmesi diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 254e7ad16..7a459b02c 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -90,8 +90,6 @@ з\'єднання… з\'єднано невідомий стан - Пристрій: %1$s. Версія ПЗ: %2$s - ПЗ: %1$s (невідомо) Тест Тест сповіщень diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 5c7f9cb19..20c874385 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -44,8 +44,6 @@ đ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 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e7b076793..a06d707a0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -184,8 +184,6 @@ Connecting Connected Unknown state - HW: %1$s FW: %2$s - Firmware version: %1$s (unknown) Test Test notification