- Refactor the code from a static global instance to a lifecycle-aware
service instantiated in the DeviceCommunicationService
- Fix number of devices reported in the notification
- Prevents leaks and properly stops when devices get disconnected
* this feature allows to pair HarmonyOS devices without factory reset to
GB and Huawei Health.
* huawei account has form of 17 digit string and could be retrived from
logcat filtering by huid=
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3721
Co-authored-by: Vitaliy Tomin <highwaystar.ru@gmail.com>
Co-committed-by: Vitaliy Tomin <highwaystar.ru@gmail.com>
Also use the named column indexes instead of numeric ids when retrieving the contents to make it more clear and more robust in case further fields are added later.
Reminders are set as absolute timestamp.
Implement support for Sleep As Android with an usable example for ZeppOs
devices
Sleep as Android documentation:
https://docs.sleep.urbandroid.org/devs/wearable_api.html
Signed-off-by: Marcel Alexandru Nitan <nitan.marcel@protonmail.com>
The DeviceCommunicationService calls `#setAutoReconnect` on new device
supports before it calls the connect method. Since this method did not
get relayed to the connection-specific support classes, Xiaomi devices
using a BLE connection did not automatically reconnect because the
`mAutoReconnect` field in `AbstractBTLEDeviceSupport` never got set.
Earlier Xiaomi devices would send either 0 or 100 for the requested
volume to indicate whether the app should increase or decrease the
phone's volume. Newer devices send the volume to change to, based on the
known current volume. We therefore need to check whether the device
increased or decreased the volume based on the current volume ourselves
in order to determine which event we want to fire.
The Xiaomi Smart Band 8 Pro shows widgets in a two by three grid.
Previously, opening the widget configuration for such a device from the
device-specific preferences would crash Gadgetbridge because the layouts
in such a grid was not supported.
This commit adds definitions for layouts in a 2x3 grid to the
WidgetLayout enum, adds a definition for a full screen widget to the
WidgetType enum, defines rendering definitions for the new layouts to
WidgetScreenDetailsActivity, and defines translations for the new
layouts and type to XiaomiWidgetManager.
The Redmi Watch 4 reports both an unsupported widget type and layout
style:
- The firmware supports a screen layout for a single full screens
widget, which is defined by layout ID 128;
- A full screen widget is a single 2x2 part, which is not supported.
This commit adds support for both the new layout and the new widget
type.
Furthermore, this commit refactors the XiaomiWidgetManager. Previously,
the supported layouts were determined by the types of parts supported by
the device. However, the supported layouts are reported by the device
through a bitfield in the widget capabilities message of which the purpose
was unknown, which is now used to determine the supported layouts.