Commit Graph
100 Commits
Author SHA1 Message Date
Thomas Kuehne ba70067aad Garmin: update FILETYPE comments and names
SLP_DISR is present on various devices (folder SlpDisr) and seems to stand for sleep disruptions.
2025-09-19 19:18:55 +02:00
Thomas KuehneandJosé Rebelo b1323b6fd1 Garmin: extend FIT file parsing 2 2025-09-18 21:13:36 +02:00
Thomas KuehneandJosé Rebelo 24fbbe854c Garmin: more targeted log for unknown message type
old log output:
n.f.g.s.d.g.m.GFDIMessage - Unknown message type 5023, message [12, 0, -97, 19, 50, -7, -1, -1, -1, -1, 50, 64]
n.f.g.s.d.g.m.GFDIMessage - Leftover bytes when parsing message type 5023. Bytes: 32F9FFFFFFFF, complete message: 0C009F1332F9FFFFFFFF3240

new log output:
n.f.g.s.d.g.m.GFDIMessage - Unknown message type 5023. Bytes: 32F9FFFFFFFF
2025-09-16 21:06:02 +02:00
Thomas Kuehne 47e7ef7e33 Garmin: update our ConfigurationMessage payload 2025-09-16 20:59:07 +02:00
Thomas KuehneandJosé Rebelo 62d458255b Garmin: add the "Unit ID" (device serial number) to the device details 2025-09-16 20:44:20 +02:00
Thomas KuehneandJosé Rebelo b12fd1027f Garmin: add FILETYPE 8/255 (device XML) 2025-09-16 20:44:09 +02:00
Thomas KuehneandJosé Rebelo 80aeaead1a garmin: extend FIT file parsing (#5339)
This updates the parser to interpret more FIT information and display it in the FIT file viewer.
Actually using the available information isn't part of this PR.
2025-09-16 20:12:52 +02:00
Thomas Kuehne 1becb9f6b3 btle+btbr: remove deprecated methods
DeviceSupports in master already use the modern methods.
DeviceSupports outside of the master branch either already use the modern methods or have know fix-ups (#5318).
2025-09-14 18:04:06 +02:00
Thomas Kuehne 1507553247 Garmin: HRM-Pro Plus - native support (#5353) 2025-09-14 16:49:15 +02:00
Thomas KuehneandJosé Rebelo 71116173f8 strings: Bluetooth is a proper name 2025-09-14 14:00:31 +02:00
Thomas KuehneandJosé Rebelo d414ae17b1 fix: NullPointerException in DeviceSpecificSettingsFragment.setChangeListener
Add a "CMF Watch Pro 2" test device manually and then open device specific settings results in following exception because supportedLanguages is null:

Uncaught exception in mainjava.lang.NullPointerException: Attempt to get length of null array
at nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsFragment.setChangeListener(DeviceSpecificSettingsFragment.java:419)
at nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsFragment.onCreatePreferences(DeviceSpecificSettingsFragment.java:244)
at androidx.preference.PreferenceFragmentCompat.onCreate(PreferenceFragmentCompat.java:161)
at nodomain.freeyourgadget.gadgetbridge.activities.AbstractPreferenceFragment.onCreate(AbstractPreferenceFragment.java:81)
2025-09-11 20:16:35 +02:00
Thomas Kuehne fc03ac11aa Garmin: fix NullPointerException in getActivityKind 2025-09-07 17:54:00 +02:00
Thomas KuehneandJosé Rebelo f5eb4a5feb garmin: add experimental support for In Reach Mini 2 2025-09-07 14:53:42 +02:00
Thomas Kuehne 06925b2384 garmin: add missing DAOs to getAllDeviceDao 2025-09-07 10:58:12 +02:00
Thomas Kuehne eba83f93ad change daily sleep goal from hours to minutes (#1312) 2025-08-31 10:27:24 +02:00
Thomas KuehneandJosé Rebelo e112a51c1e garmin: add FitDebug to improve logging of unsupported global field numbers 2025-08-27 19:44:46 +02:00
Thomas Kuehne 0500a6ee41 zip backup: add zip archive comment to ease human identification
example comment:
data export from Android application nodomain.freeyourgadget.gadgetbridge version 0.86.1 from 2025-08-26T23:59:45Z
2025-08-26 22:47:13 +02:00
Thomas KuehneandJosé Rebelo 0f54f2c6e0 zip backup: sort the external files by name to improve comparability 2025-08-26 22:02:07 +02:00
Thomas KuehneandJosé Rebelo 42033aad18 ultrahuman: redesign device support 2025-08-26 21:38:51 +02:00
Thomas KuehneandJosé Rebelo f5e015ff57 ui: optionally disable fetching new data from connected devices when swiping down
1) add new preference Settings / User interface / refresh on swipe
2) adjusted ControlCenterv2, AbstractChartsActivity and WorkoutListActivity
2025-08-26 21:17:04 +02:00
Thomas KuehneandJosé Rebelo 805bc35299 ui: use app:useSimpleSummaryProvider="true" instead of android:summary="%s"
fixes ListPreference's logcat warning:
`Setting a summary with a String formatting marker is no longer supported. You should use a SummaryProvider instead.`

https://developer.android.com/develop/ui/views/components/settings/customize-your-settings#summaries
2025-08-25 22:03:45 +02:00
Thomas KuehneandJosé Rebelo deef1c9d12 device settings: use icons / use more specific icons 2025-08-18 11:31:30 +02:00
Thomas KuehneandJosé Rebelo 5b1a4b237b WeightScale: add btle profile and generic device coordinator / device support (#5225)
Adds support for receiving weights from standard Bluetooth Weight scales:
0000181d-0000-1000-8000-00805f9b34fb - org.bluetooth.service.weight_scale
00002a9d-0000-1000-8000-00805f9b34fb - org.bluetooth.characteristic.weight_measurement
https://www.bluetooth.com/specifications/specs/weight-scale-service-1-0-1/
2025-08-18 11:23:52 +02:00
Thomas Kuehne be12a9d794 ble: add new Bluetooth standard mapping to BleNamesResolver 2025-08-17 19:21:45 +02:00
Thomas KuehneandJosé Rebelo 78b78de8e6 delete export files when deleting a device (#5216) 2025-08-14 23:08:14 +02:00
Thomas Kuehne 3b5ea9bf7f weather: try to reduce risk of TransactionTooLargeException 2025-08-14 09:49:32 +02:00
Thomas Kuehne 21a272cd74 weather: add compressed WeatherGz support to ACTION_GENERIC_WEATHER (#5239)
When receiving the broad cast action `nodomain.freeyourgadget.gadgetbridge.ACTION_GENERIC_WEATHER`

Try to decode bundle extra `WeatherGz` (ByteArray containing GZiped UTF-8 encoded JSON array of weather specifications) first.
If not present fall back to bundle extras `WeatherJson`  (String containing one JSON weather specification) and optional `WeatherSecondaryJson` (String containing JSON array of weather specifications).
2025-08-14 08:35:03 +02:00
Thomas Kuehne 32204ce606 debug: enable sharing an existing log file even if file logging is currently disabled (#4659) 2025-08-12 21:12:36 +02:00
Thomas Kuehne 00d3e9b23d implement getAllDeviceDao to enable device specific database exports (#5230) 2025-08-12 11:43:07 +02:00
Thomas KuehneandJosé Rebelo 111b705963 add missing @Override annotations 2025-08-11 21:41:25 +02:00
Thomas Kuehne bb710bae92 fix: BatteryInfoProfile complaining about unexpected characteristics 2025-08-10 18:16:58 +02:00
Thomas Kuehne 6966f80f3d ble: use UUID version of TransactionBuilder.read/write/notify (#5222)
Using the UUID version instead of BluetoothGattCharacteristic version ensures that, if a characteristic is missing on the gadget GB actually logs what characteristic is missing.
2025-08-09 18:05:22 +02:00
Thomas Kuehne 5fa2372fce DeviceCoordinator: add missing device argument and @NonNull annotation for all supports[...] methods (#5214) 2025-08-09 11:17:10 +02:00
Thomas Kuehne 696a7c73a5 ble: improve error logging in TransactionBuilder.notify(UUID, boolean) 2025-08-06 05:10:50 +02:00
Thomas Kuehne 3ba16cb38e icons: refresh further icons from the "Material Symbols" set 2025-08-05 22:21:19 +02:00
Thomas KuehneandJosé Rebelo 5d9d547250 icons: add icons for Settings / Automations 2025-08-05 21:44:29 +02:00
Thomas KuehneandJosé Rebelo 6634302353 implement getAllDeviceDao to delete device specific data when deleting the device 2025-08-05 21:40:21 +02:00
Thomas KuehneandJosé Rebelo 9ef4a5881a icons: use distinctive icons for weather and package names 2025-08-03 23:40:07 +02:00
Thomas KuehneandJosé Rebelo cff19b3959 icons: use a distinctive icon for track color 2025-08-03 23:39:55 +02:00
Thomas KuehneandJosé Rebelo 9d110b99eb icons: use a material icon for "donation" 2025-08-03 23:39:44 +02:00
Thomas KuehneandJosé Rebelo a38d9056d4 strings: use standardized straight quotes " and en dash – (#5112)
also cleanup left-over quotes " from string.xml creation
2025-08-03 23:37:07 +02:00
Thomas KuehneandJosé Rebelo d5d2d3d3be icons: refresh icons from the "Material Symbols" set 2025-07-30 23:54:32 +02:00
Thomas KuehneandJosé Rebelo a28603be87 icons: add icons to Settings / User interface 2025-07-29 20:59:20 +02:00
Thomas KuehneandJosé Rebelo bba747cb6c ui: optionally prevent screen shots and insecure displays (#5166)
Introduce new Settings / User interface / Screenshots to optionally prevent screenshots and viewing on non-secure displays.
Toggling this setting requires a GB restart to become fully effective.
2025-07-29 20:57:27 +02:00
Thomas Kuehne 28e39edea1 settings: fix a potential resource leak 2025-07-29 08:24:50 +02:00
Thomas KuehneandJosé Rebelo b2e9a468bf log: add severity DEBUG to GB.log 2025-07-28 21:15:19 +02:00
Thomas KuehneandJosé Rebelo ff29112eac ble: improve logging WriteAction failures when using SDK < 33 2025-07-28 10:53:05 +02:00
Thomas KuehneandJosé Rebelo 8905fb9eb3 ble: use calcMaxWriteChunk instead of MTU-3 (#5156)
Starting with version 14 Android tries to negotiate MTU 517 when GB requests any MTU > 23.
If the negotiated MTU is larger than 515 the DeviceSupports may try to write 513 or 514 (MTU-3) bytes at once.
Writing more than 512 bytes into a characteristic with one BLE write action is always going to fail (Bluetooth specification).
2025-07-27 22:08:53 +02:00
Thomas KuehneandJosé Rebelo 7a30829bb6 ble+bt: use common time format for logging actions 2025-07-27 22:00:50 +02:00
Thomas KuehneandJosé Rebelo 7bee3aa8c7 ble: reduce exposure to BtLEAction subclasses 2025-07-27 11:54:17 +02:00
Thomas KuehneandJosé Rebelo 9de76bafef garmin: fix getDeviceNameResource value for Fenix 3 2025-07-26 20:23:42 +02:00
Thomas KuehneandJosé Rebelo 8794e11720 ble: MTU handling in TransactionBuilder including MTUs > 515 (#5146)
This is especially relevant for Android 14
https://developer.android.com/about/versions/14/behavior-changes-all#mtu-set-to-517

AbstractBTLEDeviceSupport.calcMaxWriteChunk:
new function to properly calculate chunk size

TransactionBuilder.writeChunkedData:
if required automatically resize the chunk size

TransactionBuilder.write and TransactionBuilder.writeLegacy:
for now log an error but still attempt to write the data
2025-07-26 10:23:22 +02:00
Thomas KuehneandJosé Rebelo 11e25b68aa log: use specific log instead of generic GB.log to streamline debugging 2025-07-25 01:25:46 +02:00
Thomas KuehneandJosé Rebelo 741aad0674 log: improve start/finish logging of essential device support threads 2025-07-24 22:40:54 +02:00
Thomas KuehneandJosé Rebelo 556a89b9a8 ble: throw an exception in BtLEQueue.connect if this queue is so broken that it can no longer be re-used 2025-07-22 21:28:43 +02:00
Thomas KuehneandJosé Rebelo a370b00a91 settings: use central GBPrefs.syncTime() instead of custom "datetime_synconconnect" checks 2025-07-22 21:23:42 +02:00
Thomas Kuehne b2d65cce0d garmin: honour the datetime_synconconnect preference instead of hardcoding a time sync for each connection 2025-07-22 20:18:20 +02:00
Thomas KuehneandJosé Rebelo 0b761558bd log: exception handling toast should, if not already logged, log the exception stack trace (#5115) 2025-07-19 16:29:49 +02:00
Thomas Kuehne 23a06dc3fd Ultrahuman: UltrahumanDeviceCoordinator housekeeping update 2025-07-19 01:09:56 +02:00
Thomas Kuehne 35276c5cfd btle+br: switch performConnected/performImmediately to queueConnected/queueImmediately (#5107)
1) replace DeviceSupport's performConnected and performImmediately with TransactionBuilder's queueConnected and queueImmediately - perform* couldn't prevent repeatedly queueing the same transaction
2) improve JavaDoc for btle+br TransactionBuilders
3) improve error handling for btle's TransactionBuilder
2025-07-18 22:27:29 +02:00
Thomas KuehneandJosé Rebelo 9f168fa350 use actual MTU instead of fixed size for TransactionBuilder.writeChunkedData 2025-07-18 19:56:30 +02:00
Thomas Kuehne ae1d5b1f01 btle: fix BtLEQueue.insert concurrency (#5103) 2025-07-18 15:57:30 +02:00
Thomas KuehneandJosé Rebelo 69874ad535 btle+br: use modernized TransactionBuilder methods (#5101) 2025-07-18 00:07:09 +02:00
Thomas Kuehne afd529fbf3 btle+br: remove the queue argument from TransactionBuilder.queue (#5099) 2025-07-15 16:07:17 +02:00
Thomas Kuehne 8daa0178ce ble+btbr: add TransactionBuilder.setProgress (#5098) 2025-07-14 19:04:38 +02:00
Thomas KuehneandJosé Rebelo 7dac462f7d FunctionAction: enhance Transaction.run to streamline one-off actions (#5081) 2025-07-14 00:12:16 +02:00
Thomas Kuehne 78578cc86d btle+br: use DeviceSupport.createTransactionBuilder instead of TransactionBuilder's constructor to prepare for queue isolation 2025-07-13 21:06:04 +02:00
Thomas Kuehne a67613072c asteroidos: fix concurrency issue between initializeDevice and onSetTime 2025-07-13 19:00:33 +02:00
Thomas Kuehne d8a4773c15 ble: use thread safe parameter in onCharacteristic instead of characteristic.getValue 2025-07-12 09:51:50 +02:00
Thomas KuehneandJosé Rebelo fdb1367434 toasts: use Throwable.getLocalizedMessage instead of getMessage 2025-07-11 22:07:04 +02:00
Thomas KuehneandJosé Rebelo 956adf72d9 TransactionBuilder: simplify the writing of single byte values 2025-07-11 22:05:17 +02:00
Thomas Kuehne 0b42950ac9 log when Service.onTimeout gets called for foreground services
GB sometimes gets killed without any obvious cause in gadgetbridge.log. This a companion of PR #5036 to figure out potential causes.
2025-07-10 23:54:05 +02:00
Thomas KuehneandJosé Rebelo 57b39f4e09 ble: use old writeCharacteristic API for writeLegacy
Some vendors customized timing aspects so that the old and new writeCharacteristic calls behave differently.
On vanilla Android there is no difference.
2025-07-10 23:27:33 +02:00
Thomas KuehneandJosé Rebelo de5a1afed1 logging: handle null buffers in GB.hexdump
Enable dumping null buffers like Logging.formatBytes already supports.
2025-07-10 23:26:54 +02:00
Thomas Kuehne a810fa8a36 log: improve logging of Bluetooth adapter changes 2025-07-06 15:05:00 +02:00
Thomas Kuehne 46d3f461e9 Timers: use fixed delay instead of fixed rate
from lint:
Use of scheduleAtFixedRate is strongly discouraged because it can lead to unexpected behaviour when Android processes become cached (tasks may unexpectedly execute hundreds or thousands of times in quick succession when a process changes from cached to uncached).
2025-07-06 09:43:30 +02:00
Thomas KuehneandJosé Rebelo 32e1b8a538 setBusyTask - ensure that busy task names are translated (#5043) 2025-07-05 20:21:45 +02:00
Thomas KuehneandJosé Rebelo 5d140e167d replace three dots (...) with ellipses (…) 2025-07-05 19:12:22 +02:00
Thomas Kuehne 42d19dbaed dispose DeviceSupports if connect() throws an exception (#5045) 2025-07-05 18:04:45 +02:00
Thomas KuehneandJosé Rebelo 443594db8c add CompanionDeviceService initiated re-connection (#5023) 2025-07-04 22:17:19 +02:00
Thomas KuehneandJosé Rebelo b30ede77c7 ble: improve exception handling and streamline logged information 2025-07-04 22:03:15 +02:00
Thomas KuehneandJosé Rebelo 2709446597 casio: introduce BLE legacy writes to fake not-yet-written characteristic values (#5008) 2025-07-04 19:55:10 +02:00
Thomas KuehneandJosé Rebelo 83db1c98ff logging: use Runtime.addShutdownHook to flush the log
This should have a better chance to write the last log lines than doing it in UncaughtExceptionHandler.
2025-07-04 10:49:40 +02:00
Thomas KuehneandJosé Rebelo 8820f64d69 concurrency: AtomicBoolean and volatile boolean
when multiple threads may be involved
AtomicBoolean: at least once code location tests and then sets the value
volatile boolean: test and set are in different code path
2025-07-03 10:17:33 +02:00
Thomas KuehneandJosé Rebelo 9976d396ec ble: BtLEQueue optimizations for CompanionDevice auto connect (#5019) 2025-07-01 23:30:29 +02:00
Thomas KuehneandJosé Rebelo d98e51190d ble: always use the TransactionBuilder provided to createTransactionBuilder
The use of initializeDevice's TransactionBuilder was inconsistent:
onServicesDiscovered used the input argument
performInitialized used the return
2025-07-01 23:04:03 +02:00
Thomas Kuehne 0d4e64ca85 fix: AbstractMethodError CompanionDeviceService.onDeviceDisappeared (#5028)
In older Android versions this is method is abstract.
2025-07-01 19:27:28 +02:00
Thomas KuehneandJosé Rebelo 071c7529ba use Build.VERSION_CODES instead of magic numbers
The available codes only depend on compileSdk.
minSdk and targetSdk are not relevant.
2025-06-29 16:32:27 +02:00
Thomas KuehneandJosé Rebelo 6728e87393 DeviceCommunicationService - stress test connect/dispose (#5020)
only effective in debug builds:
Test if a DeviceSupport is ready for multiple connect triggers (manual, AutoConnectIntervalReceiver, BluetoothConnectReceiver, GBCompanionDeviceService)

Device specific debugging preferences:
1) optionally call DeviceSupport.dispose() twice
2) optionally call DeviceSupport.connect() multiple times in series or in parallel
2025-06-29 16:31:53 +02:00
Thomas KuehneandJosé Rebelo 4723115356 enable StrictMode with penalty log for debug builds (#5022) 2025-06-29 14:26:32 +02:00
Thomas KuehneandJosé Rebelo f732ff582a ble: add ReadPhyAction, SetPreferredPhyAction, onServiceChanged and onReliableWriteCompleted 2025-06-28 19:34:22 +02:00
Thomas KuehneandJosé Rebelo e40608dcf6 ble: enable BtLEQueue to log to-be-written values 2025-06-28 19:28:22 +02:00
Thomas KuehneandJosé Rebelo 95d163e8c3 casio gbx100: distinct transaction names for better debugging (#5008) 2025-06-28 16:40:02 +02:00
Thomas KuehneandJosé Rebelo 868bc0bd7e BtBR+BtLE: adjust DeviceSupport's isConnected to check the queue's status
DeviceSupport asks BtBRQueue/BtLEQueue for the connectivity status as the queue knows best.
This enables the queue implementation to sidestep multi-threading issues.
2025-06-26 20:42:49 +02:00
Thomas KuehneandJosé Rebelo 3d2ac05390 ble: fix BtLEQueue reconnection logic
Ensure that handleDisconnected uses a robust reconnection logic.
2025-06-24 14:12:28 +02:00
Thomas KuehneandJosé Rebelo ac56df52ac ble: fix DeviceCommunicationService disposes DeviceSupport
When a device goes out of range and then comes back into range DeviceCommunicationService disposes DeviceSupport while trying to re-establish a connection.
This causes race conditions as there are multiple for path for reconnections that can be executed in parallel.
The DeviceService.ACTION_CONNECT path kills everything abruptly potential leaving the gadget with a broken connection.

partial backport from PR #4916
2025-06-24 09:53:50 +02:00
Thomas KuehneandJosé Rebelo 7fcc879280 ble: fix BondingAction.getCurrentTarget 2025-06-24 00:09:30 +02:00
Thomas KuehneandJosé Rebelo 4c94bc5568 G1DeviceSupport: fix setUpdateState 2025-06-22 19:19:14 +02:00
Thomas KuehneandJosé Rebelo 8bf39e62d5 Huawei: fix setUpdateState 2025-06-22 19:19:00 +02:00
Thomas Kuehne 168fec3253 log: set distinct thread names to enhance logging of race conditions 2025-06-22 17:21:32 +02:00