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 Kuehne and José Rebelo
0f54f2c6e0
zip backup: sort the external files by name to improve comparability
2025-08-26 22:02:07 +02:00
Thomas Kuehne and José Rebelo
42033aad18
ultrahuman: redesign device support
2025-08-26 21:38:51 +02:00
Thomas Kuehne and José 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 Kuehne and José 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 Kuehne and José Rebelo
deef1c9d12
device settings: use icons / use more specific icons
2025-08-18 11:31:30 +02:00
Thomas Kuehne and José 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 Kuehne and José 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 Kuehne and José 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 Kuehne and José Rebelo
5d9d547250
icons: add icons for Settings / Automations
2025-08-05 21:44:29 +02:00
Thomas Kuehne and José Rebelo
6634302353
implement getAllDeviceDao to delete device specific data when deleting the device
2025-08-05 21:40:21 +02:00
Thomas Kuehne and José Rebelo
9ef4a5881a
icons: use distinctive icons for weather and package names
2025-08-03 23:40:07 +02:00
Thomas Kuehne and José Rebelo
cff19b3959
icons: use a distinctive icon for track color
2025-08-03 23:39:55 +02:00
Thomas Kuehne and José Rebelo
9d110b99eb
icons: use a material icon for "donation"
2025-08-03 23:39:44 +02:00
Thomas Kuehne and José 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 Kuehne and José Rebelo
d5d2d3d3be
icons: refresh icons from the "Material Symbols" set
2025-07-30 23:54:32 +02:00
Thomas Kuehne and José Rebelo
a28603be87
icons: add icons to Settings / User interface
2025-07-29 20:59:20 +02:00
Thomas Kuehne and José 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 Kuehne and José Rebelo
b2e9a468bf
log: add severity DEBUG to GB.log
2025-07-28 21:15:19 +02:00
Thomas Kuehne and José Rebelo
ff29112eac
ble: improve logging WriteAction failures when using SDK < 33
2025-07-28 10:53:05 +02:00
Thomas Kuehne and José 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 Kuehne and José Rebelo
7a30829bb6
ble+bt: use common time format for logging actions
2025-07-27 22:00:50 +02:00
Thomas Kuehne and José Rebelo
7bee3aa8c7
ble: reduce exposure to BtLEAction subclasses
2025-07-27 11:54:17 +02:00
Thomas Kuehne and José Rebelo
9de76bafef
garmin: fix getDeviceNameResource value for Fenix 3
2025-07-26 20:23:42 +02:00
Thomas Kuehne and José 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 Kuehne and José Rebelo
11e25b68aa
log: use specific log instead of generic GB.log to streamline debugging
2025-07-25 01:25:46 +02:00
Thomas Kuehne and José Rebelo
741aad0674
log: improve start/finish logging of essential device support threads
2025-07-24 22:40:54 +02:00
Thomas Kuehne and José 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 Kuehne and José 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 Kuehne and José 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 Kuehne and José 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 Kuehne and José 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 Kuehne and José 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 Kuehne and José Rebelo
fdb1367434
toasts: use Throwable.getLocalizedMessage instead of getMessage
2025-07-11 22:07:04 +02:00
Thomas Kuehne and José 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 Kuehne and José 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 Kuehne and José 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 Kuehne and José Rebelo
32e1b8a538
setBusyTask - ensure that busy task names are translated ( #5043 )
2025-07-05 20:21:45 +02:00
Thomas Kuehne and José 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 Kuehne and José Rebelo
443594db8c
add CompanionDeviceService initiated re-connection ( #5023 )
2025-07-04 22:17:19 +02:00
Thomas Kuehne and José Rebelo
b30ede77c7
ble: improve exception handling and streamline logged information
2025-07-04 22:03:15 +02:00
Thomas Kuehne and José Rebelo
2709446597
casio: introduce BLE legacy writes to fake not-yet-written characteristic values ( #5008 )
2025-07-04 19:55:10 +02:00
Thomas Kuehne and José 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 Kuehne and José 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 Kuehne and José Rebelo
9976d396ec
ble: BtLEQueue optimizations for CompanionDevice auto connect ( #5019 )
2025-07-01 23:30:29 +02:00
Thomas Kuehne and José 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 Kuehne and José 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 Kuehne and José 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 Kuehne and José Rebelo
4723115356
enable StrictMode with penalty log for debug builds ( #5022 )
2025-06-29 14:26:32 +02:00
Thomas Kuehne and José Rebelo
f732ff582a
ble: add ReadPhyAction, SetPreferredPhyAction, onServiceChanged and onReliableWriteCompleted
2025-06-28 19:34:22 +02:00
Thomas Kuehne and José Rebelo
e40608dcf6
ble: enable BtLEQueue to log to-be-written values
2025-06-28 19:28:22 +02:00
Thomas Kuehne and José Rebelo
95d163e8c3
casio gbx100: distinct transaction names for better debugging ( #5008 )
2025-06-28 16:40:02 +02:00
Thomas Kuehne and José 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 Kuehne and José Rebelo
3d2ac05390
ble: fix BtLEQueue reconnection logic
...
Ensure that handleDisconnected uses a robust reconnection logic.
2025-06-24 14:12:28 +02:00
Thomas Kuehne and José 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 Kuehne and José Rebelo
7fcc879280
ble: fix BondingAction.getCurrentTarget
2025-06-24 00:09:30 +02:00
Thomas Kuehne and José Rebelo
4c94bc5568
G1DeviceSupport: fix setUpdateState
2025-06-22 19:19:14 +02:00
Thomas Kuehne and José 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
Thomas Kuehne and José Rebelo
2e8c38d255
miband: fix setUpdateState
2025-06-22 14:54:48 +02:00
Thomas Kuehne and José Rebelo
161c89cfcf
makibeshr3: fix setUpdateState
2025-06-22 14:50:32 +02:00
Thomas Kuehne and José Rebelo
bd48d299f7
qhybrid: fix setUpdateState
2025-06-22 14:50:10 +02:00
Thomas Kuehne and José Rebelo
cc41bcac2a
jyou: fix setUpdateState
2025-06-22 14:49:27 +02:00
Thomas Kuehne and José Rebelo
d48bea3003
test: fix setUpdateState
2025-06-22 14:48:50 +02:00
Thomas Kuehne and José Rebelo
906764ae2a
no1f1: fix setUpdateState
2025-06-22 14:48:30 +02:00
Thomas Kuehne and José Rebelo
c700a4c71c
waspos: fix setUpdateState
2025-06-22 14:47:51 +02:00
Thomas Kuehne and José Rebelo
280f4fc61d
BangleJSDeviceSupport: fix setUpdateState
2025-06-22 14:46:50 +02:00
Thomas Kuehne and José Rebelo
c9a9ae8ad0
ble: introduce getServiceDiscoveryDelay and apply BtLEQueue settings (2/2)
...
1/2:
- rename AbstractBTLEDeviceSupport to AbstractBTLESingleDeviceSupport
- apply all BtLEQueue settings before processing starts
- introduce getServiceDiscoveryDelay to support device specific delay between STATE_CONNECTED and getServices/discoverServices
2/2:
- add a new AbstractBTLEDeviceSupport as a common super class of AbstractBTLEMultiDeviceSupport and AbstractBTLESingleDeviceSupport
2025-06-22 13:47:33 +02:00
Thomas Kuehne and José Rebelo
94ec64095a
ble: introduce getServiceDiscoveryDelay and apply BtLEQueue settings (1/2)
...
1/2:
- rename AbstractBTLEDeviceSupport to AbstractBTLESingleDeviceSupport
- apply all BtLEQueue settings before processing starts
- introduce getServiceDiscoveryDelay to support device specific delay between STATE_CONNECTED and getServices/discoverServices
2/2:
- add a new AbstractBTLEDeviceSupport as a common super class of AbstractBTLEMultiDeviceSupport and AbstractBTLESingleDeviceSupport
2025-06-22 13:47:33 +02:00
Thomas Kuehne and José Rebelo
fcd4ac30be
ble: introduce CompanionDeviceService to elevate process priority
2025-06-22 12:48:01 +02:00
Thomas Kuehne
485df6a021
ble+bt: replace setState with setUpdateState
...
code de-duplication: GBDevice.setState + sendDeviceUpdateIntent + DEVICE_STATE
1) add nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder.setUpdateState
2) add nodomain.freeyourgadget.gadgetbridge.service.btbr.TransactionBuilder.setUpdateState
3) add nodomain.freeyourgadget.gadgetbridge.impl.GBDevice.setUpdateState
4) use the new setUpdateState
The status logic in following classes require a deeper analysis. They were thus not updated:
- AbstractBTBRDeviceSupport
- BFH16DeviceSupport
- BangleJSDeviceSupport
- DeviceCommunicationService
- FossilWatchAdapter
- G1DeviceSupport
- GenericHeadphonesSupport
- HuaweiSupportProvider
- JYouSupport
- MakibesHR3DeviceSupport
- MiBandSupport
- MisfitWatchAdapter
- No1F1Support
- TestDeviceSupport
- WaspOSDeviceSupport
2025-06-22 11:12:19 +02:00
Thomas Kuehne
79a6ee2c92
use StandardCharsets.UTF_8 instead of name based charset lookups
...
eliminates the need to handle UnsupportedEncodingException and improves performance
2025-06-21 20:51:22 +02:00
Thomas Kuehne and José Rebelo
5c439be493
add @Override annotations to device specific code
...
@Override is helpful to ensure that factoring can't cause "orphaned" methods
2025-06-21 18:35:48 +02:00
Thomas Kuehne and José Rebelo
e00261cac6
fix and annotate null handling in some core classes
2025-06-21 09:36:05 +02:00
Thomas Kuehne and José Rebelo
52d3b20430
ble: log detailed companion bonding error
2025-06-19 21:54:17 +02:00