1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-09 07:01:33 +02:00
Commit Graph

476 Commits

Author SHA1 Message Date
Daniele Gobbetti
67a1191a3c Use UTC timezone in GPX points
Fixes #1152
2018-07-22 16:14:36 +02:00
Vadim Kaushan
c43a564a47 Merge remote-tracking branch 'origin/master' 2018-07-15 00:53:47 +03:00
Vadim Kaushan
26a1f97e43 ID115: coordinator 2018-07-12 15:47:08 +03:00
Sebastian Kranz
59095dc29b Clean-up the merge. 2018-06-29 11:18:36 +02:00
Sebastian Kranz
1b152c86ea Merge branch 'master' into zetime 2018-06-29 10:43:11 +02:00
License Bot
225a600aed Update license headers 2018-06-25 18:35:46 +02:00
Daniele Gobbetti
f99895da0c Remove activity transfer toast, add title to the transfer notification
Also create a separate channel that allows "muting" transfer notifications
on android oreo and above.
2018-06-19 22:03:49 +02:00
Daniele Gobbetti
4d0020ae1d Add the option the blacklist applications also for Pebble Messages
Fixes #996
2018-06-18 20:38:37 +02:00
Daniele Gobbetti
45ecdaa213 Pebble: Webview: do not use the contextWrapper if it's null.
It should never happen but I had a crash on API 19, possibly a race condition
somewhere.
2018-06-18 20:23:23 +02:00
Andreas Shimokawa
99dec159f7 Mi Band 3: add untested and incomplete support
This also improves firmware/RES probing to distinguish Mi Band 2/3 firmware files and Mi Band 3/Bip RES files.

Notes:
- Firmware flashing should might but is untested
- This basicall runs off the Amazfit Bip code which will probably incorrect (Mi Band 3 is proabably something between the Bip and the Mi Band 2)
2018-06-14 18:16:49 +02:00
tiparega
3852f925da Added support for Q8 devices 2018-05-20 19:52:08 +02:00
Daniele Gobbetti
d512585fae More timezone fixes for android < 24
This change should turn travis green again.
Older version of android should get a proper 24h formatted timestamp.
Perhaps our export will be more compatible with external services as well
( #1076 )
2018-04-24 21:00:22 +02:00
Daniele Gobbetti
c71eba9483 Hotfix for connection issues on API < 24
Fix #1055 properly, as the previous change was not solving the issues
on API < 24. This affected the connection to some devices and caused a
crash on graph access.
2018-04-16 18:26:23 +02:00
AndrewH
1b9b5f821e GPX export fixes (#1060) 2018-04-13 00:50:47 +02:00
Daniele Gobbetti
e7c10f3f01 Use a different DateTimeFormat on legacy android versions (<24)
Fixes #1055
2018-04-12 21:48:02 +02:00
cpfeiffer
b12286c892 Handle possible null return
Fixes #1052
2018-04-06 23:45:58 +02:00
TaaviE
08feaf30e1 Fixed a bunch of misspells. 2018-03-31 17:31:48 +02:00
Andreas Shimokawa
29a05f1d8f refactor onFetchActivityData() into onFetchRecordedData(dataTypes) to make it more generic
This removes misuse of testNewFunctionality() and support fetching GPS data and debug logs
Fetching debug logs (Amazfit Bip/Cor) is now accessible in the debug activity
Fetching GPS data can be done by swiping in the list activity.
TODO: actually refresh list when fetching data is done :P

Also fix some android studio warnings on the go...
2018-03-31 16:21:25 +02:00
Andreas Shimokawa
66bb0bd81b Merge branch 'master' into bip-wip 2018-03-27 11:09:59 +02:00
TaaviE
6be7ee4a96 Fixed a few misspells and extended my name. 2018-03-23 07:26:25 +01:00
cpfeiffer
d2c952ffa5 Improvements to the singleton pattern, better encapsulate fields 2018-03-18 12:59:32 +01:00
Daniele Gobbetti
ec1f4505bd Pebble: prevent crashing when the ExternalPebbleJS Activity was not running
when receiving configuration data from the external browser.

Parse the passed data to load the correct watchface javascript, and ensure
the currently connected device is a Pebble (and try to reconnect if there
is no device connected, as a bonus)
2018-03-17 18:50:53 +01:00
Daniele Gobbetti
8e67f31309 Pebble Webview: check the availability of Internet Helper packages before
binding the service to it.

Could help with #643, but it's a blind attempt.
2018-03-17 16:57:02 +01:00
Daniele Gobbetti
d286f497f0 Pebble: Iterate over knownKeys only if they are present.
Fixes #1027
2018-03-17 16:12:40 +01:00
Andreas Shimokawa
3d3cc1f40c Merge branch 'master' into bip-wip 2018-03-13 17:27:18 +01:00
Daniele Gobbetti
d88badaf4d Pebble JS: add transactionId metadata to the appmessage.
Removes the errors in Pebble-Casio-WV58DE as reported in #482
2018-02-28 21:56:46 +01:00
Ted Stein
1e0d7550d9 Add ta marbutah to Arabic transliteration.
Add ة, a normally-silent form of the letter ت that was missed when this
functionality was originally added.
2018-02-27 17:37:12 +01:00
License Bot
238bacde9f Update license headers 2018-02-26 14:27:33 +01:00
ladbsoft
d5978d9b30 Xwatch Basic Support (#972)
Initial XWatch support

* Activity syncing
* Multimedia control using the watch's button
2018-02-25 12:05:36 +01:00
Daniele Gobbetti
4f246b3ed9 Add Antox to the chat applications.
Notifications coming from the chat.tox.antox package are treated as chat
messages. This closes #910
2018-02-17 17:39:15 +01:00
Daniele Gobbetti
48b89f1bd2 Add Kontalk to the chat applications.
Notifications coming from the org.kontalk package are treated as chat
messages. This closes #994
2018-02-17 17:33:34 +01:00
Andreas Shimokawa
e48885df7d Merge branch 'master' into bip-wip 2018-02-15 23:38:06 +01:00
Daniele Gobbetti
e28333fe6e Fixes to make the application run on Oreo
- tested on Oreo 8.1

this commit includes changes cherry picked from 3b6da66643
2018-02-14 21:35:22 +01:00
cpfeiffer
78b50e82fa Fix crash in settings activity with export location
The way this works will never be a fully working solution, because uris are
*not supposed* to be resolved to a filesystem path. So while this may work
right now, it will most probably fail in the future, with other content providers.

See e.g. https://github.com/iPaulPro/aFileChooser/issues where this code originally came from
(via Stackoverflow).

We won't crash anymore, but we won't support certain content providers. In the long run, we
should search for the proper solution.

Closes #982
2018-02-11 14:32:21 +01:00
Daniele Gobbetti
81d4ca84a8 Add Polish 'Ł' and 'ł' to transliteration map
closes #987
2018-02-10 16:53:35 +01:00
Kranz
bd673fb4af Initial device support for MyKronoz ZeTime, following the wiki page add new device support. 2018-02-08 07:21:12 +01:00
Andreas Shimokawa
1349a1c7da Merge branch 'master' into bip-wip 2018-01-22 08:57:01 +01:00
TaaviE
32dcdc24ba Fixed two strings incorrectly being merged together. 2018-01-21 22:43:10 +01:00
cpfeiffer
da5d1e3685 Trying to simplify ExternalPebbleJSActivity#onCreate() a bit
(by splitting into separate methods)
2018-01-14 00:20:13 +01:00
cpfeiffer
9ee1aa87e8 Move some methods to clarify responsibilities and simplify some things 2018-01-13 21:58:40 +01:00
cpfeiffer
e159a5dde3 Cleanup, deduplication, null-handling fixes 2018-01-13 21:08:51 +01:00
Ted Stein
39e151f51d Add transliteration for Arabic and Farsi. 2018-01-12 22:05:33 +01:00
Felix Konstantin Maurer
a0ee35fa4c Move getFilePath to appropriate location 2018-01-09 22:41:27 +01:00
Felix Konstantin Maurer
1477235fa2 Clean preferences code 2018-01-09 22:41:27 +01:00
Felix Konstantin Maurer
58e504e299 Improve code, add notification 2018-01-09 22:41:27 +01:00
Felix Konstantin Maurer
254afafa3e First try at periodic db export 2018-01-09 22:41:27 +01:00
Andreas Shimokawa
6f68c8adde Merge branch 'master' into bip-wip 2018-01-04 12:09:57 +01:00
Lukas Veneziano
6b339a3013 Added notification type for threema app 2017-12-31 00:10:39 +01:00
Andreas Shimokawa
bfceaf9cc9 Merge branch 'master' into bip-wip 2017-12-11 19:30:54 +01:00
Daniele Gobbetti
797ad096dc Don't add the fetch activity action button on KK
Fixes #886

Add accent color also on first notification creation #759
2017-11-19 16:39:44 +01:00
cpfeiffer
f5318287c4 WIP: Bip GPS fetching, parsing, exporting
Also adjust Mi2 date/time sending wrt DST offsets
2017-10-31 23:16:39 +01:00
Daniele Gobbetti
5417c5b5f6 Change notification, and fix the connection logic:
- fix bug that caused the wrong device to be connected sometimes
- add accent color
- add battery status
- remove duplicated title
- allow to connect also before first connection (the last connected device will be used)
2017-10-30 21:37:31 +01:00
License Bot
3ea2ac6dd2 Update license headers 2017-10-25 09:29:36 +02:00
Daniele Gobbetti
e028b4d223 Pebble: add method to stop the background JS engine without disposing the webview 2017-10-23 20:47:30 +02:00
Andreas Shimokawa
83038a47ca use abstract HuamiCoordinator as base for MiBand2/HRX/Bip/Cor and separate from Mi1 Coordinator 2017-10-23 14:46:08 +02:00
Andreas Shimokawa
0f46ea2a59 Try to blindly add support for Amazfit Cor 2017-10-23 11:28:51 +02:00
Andreas Shimokawa
69619c21f6 Mi Band 2: try to add support for Mi Band HRX
Also refactors some stuff, basically moving stuff around
2017-10-23 10:28:54 +02:00
McSym28
48c338adb8 Adding support for ukrainian characters
- 'ґ' (Cyrillic Small Letter Ghe with Upturn U+0491) / 'Ґ' (Cyrillic Capital Letter Ghe with Upturn U+0490);
- 'є' (Cyrillic Small Letter Ukrainian Ie U+0454) / 'Є' (Cyrillic Capital Letter Ukrainian Ie U+0404);
- 'і' (Cyrillic Small Letter Byelorussian-Ukrainian I U+0456) / 'І' (Cyrillic Capital Letter Byelorussian-Ukrainian I U+0406);
- 'ї' (Cyrillic Small Letter Yi U+0457) / 'Ї' (Cyrillic Capital Letter Yi U+0407)
2017-10-22 19:25:45 +02:00
Andreas Shimokawa
f07b77f903 Mi Band 2: support app icons and textual notifications for more apps 2017-10-22 00:02:36 +02:00
Daniele Gobbetti
5262c6e3d7 Add quick actions buttons to Gadgetbridge notification #759
- Disconnect button if connected
- Fetch activity if connected and supported by device
- (re)connect the last connected device if disconnected

Known bug: In the last case, if multiple devices were connected, the wrong device gets re-connected
2017-10-20 22:49:53 +02:00
Andreas Shimokawa
6603b3fa05 Merge branch 'background-javascript' 2017-10-16 23:06:36 +02:00
License Bot
8f06e36c00 Update license headers 2017-10-16 09:38:02 +02:00
Daniele Gobbetti
c4f36d1202 Pebble: background webview, address (most of) review comments 2017-10-13 21:57:22 +02:00
cpfeiffer
0fd6064ab6 Just a single method rename, to make it more clear 2017-09-25 23:00:39 +02:00
Daniele Gobbetti
e8ae47de79 Pebble: Make background JS support toggle-able
- Add preference to enable background JS (default disabled)
- Remove the dummy activity used to create the webview, use ExternalPebbleJSActivity instead
- Add layout for legacy configuration, used if background JS is not enabled
- Create the view upon connecting, not when launching the application
- Remove the generic helpers used to find out if any device would need the background webview
- Drastic refactoring of WebviewSingleton moving internal classes in a new package "webview" in service/devices/pebble
2017-09-25 17:12:35 +02:00
Daniele Gobbetti
af6271a428 Merge branch 'master' into background-javascript 2017-09-25 11:21:11 +02:00
Frank Slezak
6ec1555178 Add support for dynamic Pebble background colors (#819)
Pebble: Add support for dynamic Pebble background colors
- Add a couple additional icon types
  - Add Lighthouse (currently unused)
  - Add Transit (public transportation app)
- Tweak the colors on existing icon types
- Implement logic to grab primary (vibrant) color from app logo
  - The color will be used when displaying a notification for an app
    that does not have any configs bound to it.
- Alter NotificationType to support a color (named pebbleColor)
- Alter the Pebble notification poster to listen to the color from
  the notification
- Alter the DeviceCommunicationService to allow for color passthrough.
- Add logic to convert HEX or Integer representations of RGB888 colors
  to Pebble RGB222 format.
- make the package name retrieved lowercase.

Fixes: #815
2017-09-19 13:24:31 +02:00
Andreas Shimokawa
99d873a178 Merge branch 'master' into background-javascript 2017-09-13 21:51:55 +02:00
License Bot
a10fc8ad4e Update license headers 2017-09-12 12:39:15 +02:00
Michal Novotny
05d0625b68 Mi Band 2: Implement multiple button actions
This enables option for multiple button actions according to the "Delay after button action". This broadcast is being sent to the intent
along with button_id extra identifying how many times have the pass been done.

By pass defined number of button presses is meant.
2017-09-10 23:02:13 +02:00
Quallenauge
851e47f550 Add support for EXRIZU K8 smartband.
The device is compatible to HPLUS protocol.
2017-09-10 22:57:32 +02:00
Andreas Shimokawa
5cd00ccbb5 Fix language switching for good
Maybe
:D

Fixes #802
2017-09-07 23:26:53 +02:00
Andreas Shimokawa
a911ba5423 Merge branch 'master' into background-javascript 2017-09-04 21:08:36 +02:00
Sami Alaoui
f6ce0c1a0e Add initial support for Teclast H30
Scan and connection, battery level, firmware version, date and time sync
(along with some other currently hardcoded settings), notification
support, alarm support, and some more.
2017-09-04 20:59:09 +02:00
Daniele Gobbetti
df2a313168 Webview: make the webview more robust to disconnections 2017-09-03 17:55:00 +02:00
Daniele Gobbetti
bb962001a5 Merge branch 'master' into background-javascript
# Conflicts:
#	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java
2017-09-03 16:49:27 +02:00
cpfeiffer
962720145e Fix custom language being lost for newly created activities
So we do need to set the language both on change and onCreate()

For some reason, the title bar of the SettingsActivity is not updated on recreate().

Closes #787
2017-09-03 01:04:34 +02:00
protomors
f5b8fada75 Initial NO.1 F1 support.
Works: connecting, writing user data, reading firmware version and battery charge, finding device.
2017-09-01 22:19:33 +02:00
Andreas Shimokawa
74652397dd Merge branch 'master' into background-javascript 2017-08-28 00:35:28 +02:00
Andreas Shimokawa
6d28b8232b Amazift Bip: fix weather on FW 0.0.8.74, support condition text 2017-08-25 23:36:14 +02:00
License Bot
15f4ce2869 Update license headers 2017-08-25 11:25:01 +02:00
Daniele Gobbetti
d00b5a5d5d Merge branch 'master' into background-javascript 2017-08-18 12:15:01 +02:00
Daniele Gobbetti
8cce2d1362 Pebble: allow to blacklist certain calendars
As requested in #736, this adds an entry in the settings menu that allows to blacklist certain calendars.
To avoid confusion, all the former blacklist methods and fields have been renamed to apps_blacklist. The new entries are called calendars_blacklist.
Importing the settings has not been tested with the current changes.
Closes #736

Future improvements TODO: The new setting lives in the Pebble section, i believe in the future the blackslist functionality should be centralized and put in the sidebar.
2017-08-18 10:34:42 +02:00
Andreas Shimokawa
a6059a5ce2 Add transliteration for German
Closes #766
2017-08-16 21:41:51 +02:00
cpfeiffer
6b1ba4d161 Don't duplicate colors, use the theme #757 2017-08-14 21:59:49 +02:00
Andreas Shimokawa
80dce95372 Inital Amazfit Bip support
Support is almost on Mi Band 2 level.

What does not work yet:
- flashing firmware files
- taking or rejecting phone calls
- syncing GPS tracks
- sending weather
- notification only include title, not a body
- unknown notification's text is not forwarded to the watch at all (same on Mi Band 2 #754)
2017-08-13 16:31:11 +02:00
Andreas Shimokawa
65835db5cc Pebble: more debug output for webview singleton, whitelist tagesschau.de for tests 2017-08-10 00:33:54 +02:00
Daniele Gobbetti
7475d170a7 Pebble: add support for the (unreleased) internet helper addon
This will use the internet helper application if it's available on the android device or fall back to existing methods if it doesn't.
2017-08-05 16:04:48 +02:00
Andreas Shimokawa
6916beabed Pebble: fix wrong uuid being passed from protocol to js 2017-08-02 23:09:43 +02:00
Daniele Gobbetti
aa28625d9f Pebble: JS basic implementation of transaction acknowledgment
JAVA side:
- first trivial handling of ACK/NACK message,
- fake the location age until an update mechanism is implemented,
- make the appmessage parsing more robust,
- comment the forecast mimicked reply as it was wrong and confusing for some watchfaces

JS side: first trivial handling of ACK/NACK message
2017-08-02 22:08:29 +02:00
Andreas Shimokawa
5939c244fb Merge branch 'master' into background-javascript 2017-08-01 11:19:17 +02:00
cpfeiffer
95ce3d333e Ugly workaround for blacklist not properly persisting
Fixes #696
2017-08-01 00:10:10 +02:00
Andreas Shimokawa
ceec76b4f6 Pebble: preparations for js appmessage ack/nack callbacks 2017-08-01 00:03:28 +02:00
cpfeiffer
c1925a4e64 Properly handle and distribute language change #733
Also centralize QUIT handling in GBActivity
2017-07-31 22:49:05 +02:00
Andreas Shimokawa
3b35bde42c Pebble: Pass booleans from Javascript Appmessage as such
(missing parts from c2af2dd15c in master)
2017-07-30 23:27:49 +02:00
Andreas Shimokawa
30d6b96432 Merge branch 'master' into background-javascript 2017-07-30 23:26:05 +02:00
Daniele Gobbetti
25e6af81a4 Pebble: some more fixes to the webview
- add back support for clay that was mistakenly removed
- timestamps are in milliseconds in JS as well
- intercept the whole URL path instead of the last part
2017-07-28 18:30:27 +02:00
lazarosfs
7f5aeb6ab1 greek transliteration map 2017-07-27 23:59:06 +02:00
Daniele Gobbetti
868593cfd3 Pebble: further improvements to the background webview
- the webview is not static anymore (but its holder is)
- the openweathermap calls of type weather and forecast are now supported (as properly as possible)
- assemble the main JSON messages in the weather receiver, as info are lost afterwards
- switch to Uri parsing instead of String (also unify handling of legacy and new requests)
- attempt to address most of the lints/warnings of AS
- remove printStackTrace in favor of LOG.warn
2017-07-26 18:12:12 +02:00
Daniele Gobbetti
79f3cad36d Pebble: some refinements to webview
- rename the createWebView method to getInstance
- remove the stateChangeListener after it has been fired once and remove obsolete code within
- instantiate the jsInterface object only when needed
- use the application context when possible to limit the usage of the mutableContextWrapper
2017-07-24 23:57:07 +02:00
Andreas Shimokawa
eb7e635cdc Merge branch 'master' into background-javascript 2017-07-15 23:07:46 +02:00
José Rebelo
34bd2ed9cc Mi Band 2: Do Not Disturb 2017-07-15 21:17:29 +02:00
Daniele Gobbetti
737578debc The good parts of "refactor notification management"
- centralize the logic for skipping unwanted notifications
- use *Compat methods wherever possible

Leaving out the problematic parts (persistent IDs and updating)
2017-05-28 18:50:41 +02:00
Andreas Shimokawa
6d54cfab88 Merge branch 'master' into background-javascript 2017-05-12 22:16:11 +02:00
Andreas Shimokawa
a1690700f4 Revert "Refactor notification management"
This reverts commit cede8a0826.
2017-05-10 22:26:02 +02:00
Andreas Shimokawa
3751273cd0 Merge branch 'master' into background-javascript 2017-05-09 14:04:33 +02:00
Daniele Gobbetti
cede8a0826 Refactor notification management
- centralize the logic for skipping over unwanted notifications
- use *Compat methods wherever possible
- use unique and persistent ID (update notifications)
- switch to using BigText style by default (since we can now update existing notifications)
- for Pebble: delete and reinsert notification as updating is not possible
2017-04-28 18:03:19 +02:00
License Bot
8af9054f2d Update license headers 2017-04-26 00:14:25 +02:00
cpfeiffer
739b5e9c50 Enable notifications during testcases to avoid NPE starting the service 2017-04-25 22:51:56 +02:00
cpfeiffer
d9b0d639b8 Adjust test case setup and fix failing tests
- add missing call super.setUp() in LoggingTest
- make use ofGBApplication's logger and db support instead
  of adding specific test things. Avoids differences between
  the local test things and the global GBApplication instances.
2017-04-25 21:55:06 +02:00
Daniele Gobbetti
d570d188a2 Remove the low battery notification if a normal battery level is reported. 2017-04-24 09:53:48 +02:00
cpfeiffer
ed02a9781a Fix a cursor not being closed
Still won't be the cause for #655
2017-04-23 12:45:02 +02:00
cpfeiffer
2003d56190 Cleanup package blacklist handling
Didn't find a cause for #664, though.
2017-04-22 16:59:55 +02:00
Andreas Shimokawa
86392dbf06 Merge branch 'master' into background-javascript 2017-04-20 14:34:32 +02:00
cpfeiffer
1a88858c6f Fix some findbugs findings 2017-04-09 01:09:43 +02:00
cpfeiffer
4a4a1e25df Properly format the sleep goal as a duration, not as a time
Also suppress trailing zeros, e.g. display
8h instead of 8h 0m
2017-04-08 23:16:33 +02:00
Daniele Gobbetti
5c0c5581bb Merge branch 'master' into background-javascript
# Conflicts:
#	app/src/main/assets/app_config/js/gadgetbridge_boilerplate.js
#	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/AbstractDeviceCoordinator.java
#	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/DeviceCoordinator.java
2017-04-08 21:16:01 +02:00
Alberto
45eb14684b import export SharedPreferences (#600)
Import and export SharedPreferences

i add function for import and export SharedPreferences setting

when export or import db execute export or import SharedPreferences

for blacklist i preload HashSet
2017-04-05 00:16:17 +02:00
cpfeiffer
f1d07c83f6 Fix NPE #603 2017-03-18 11:41:47 +01:00
Andreas Shimokawa
06c89b508e Merge branch 'master' into background-javascript 2017-03-16 18:01:51 +01:00
License Bot
6a842c52fa Update license header in all java files. 2017-03-16 17:36:15 +01:00
cpfeiffer
5d96df3508 Mi2: add hint about intermediate firmware 1.0.0.53 2017-03-14 23:45:30 +01:00
cpfeiffer
17ecee0cab Mi2: initial support for text notifications and icons
See #560
2017-03-14 00:45:54 +01:00
cpfeiffer
4b230412b6 Some utility methods + tests 2017-03-14 00:45:54 +01:00
Andreas Shimokawa
09f3dad9ff Merge branch 'master' into background-javascript 2017-03-11 22:03:29 +01:00
Daniele Gobbetti
8117caf73c Merge branch 'master' into new_GUI 2017-03-11 16:44:16 +01:00
Translation Bot
a14e14eeb9 Merge branch 'master' into background-javascript 2017-03-10 23:14:40 +01:00
License Bot
e392fbfd80 Add license header to all java files. 2017-03-10 14:53:19 +01:00
Translation Bot
3abbe12b53 Merge branch 'master' into new_GUI 2017-03-08 21:42:52 +01:00
Andreas Shimokawa
b3c0f4e9fd Pebble: fix own fake response if units=metric was in original request 2017-03-08 11:00:46 +01:00
Andreas Shimokawa
453f94f8f6 Pebble: add cod=200 to fake owm json response (fixes TimeStyle cheking the response code) 2017-03-08 10:46:33 +01:00
Andreas Shimokawa
942984dec2 Merge branch 'master' into background-javascript 2017-03-08 10:24:31 +01:00
cpfeiffer
9411f80440 Mi2: support for updating firmware fonts (*.ft, *.ft.en)
This is related to #560, but alas is not sufficient for enabling text
notifications.
2017-03-07 23:26:41 +01:00
Yaron Shahrabani
858eaa6690 Added Hebrew transliteration and tests (#571) 2017-03-04 22:08:24 +01:00
Daniele Gobbetti
75d4abc9dc Pebble background webview: bring back the mutableContextWrapper, otherwise inputs aren't working.
Reliably go back to first step of the configuration page when closing (this causes a Toast when closing the activity while in the clay settings page)
2017-03-04 20:43:32 +01:00
Daniele Gobbetti
f84c651c38 Pebble background webview: config page should be shown reliably now. 2017-03-04 19:46:18 +01:00
Andreas Shimokawa
90c61cb71c Merge branch 'master' into background-javascript 2017-03-04 13:24:44 +01:00
cpfeiffer
4419200624 Mi2: Initial support for textual notifications #560 2017-03-03 20:12:43 +01:00
Andreas Shimokawa
50f3ee73fc Merge branch 'master' into background-javascript 2017-03-03 14:28:38 +01:00
Andreas Shimokawa
9b2f47d10a Improvements to week sleep chart
Time to close #557
2017-03-03 14:21:59 +01:00
Daniele Gobbetti
76be0ae676 Pebble background webview improvements:
remove the pre-KITKAT checks as the minsupportedversion is KITKAT
fix the currentPosition override
move the returned configuration parsing to onResume method (where it was previously) as it seems more reliable
pass the whole GBDeviceEventAppMessage object, this way the jsInterface in the webview doesn't need to be static anymore
change the way the webview is initialized, this way the context doesn't need to be static anymore
use runOnUiThread instead of the Handler .. MainLooper to post the commands to the webview instance
comment a couple of custom message handler for weather as the watchapp seem to work well with JS alone
add a couple of log messages for debugging

known issue: legacy app configuration pasting does not work.
2017-02-28 21:11:26 +01:00
Andreas Shimokawa
593b169f00 Pebble: Put icon into fake weather response, disable mario time native handler (since it works a bit now) :) 2017-02-27 22:28:42 +01:00
Daniele Gobbetti
21498bd2e9 Pebble: mimic openweatherapi response from our cached data.
This should allow watchfaces using openweathermap to run without modification (but we lack the icon ATM). Tested with multifit watchface.

Also centralize the location data in own local class and remove leftover comment.
2017-02-27 19:02:34 +01:00
Daniele Gobbetti
ca8e0db078 Merge branch 'master' into background-javascript 2017-02-26 17:57:37 +01:00
Daniele Gobbetti
a545c56680 Pebble: ack the messages that go to the webview and do not destroy it on disconnect. 2017-02-26 17:57:26 +01:00
Daniele Gobbetti
176cf79cc1 Merge branch 'master' into new_GUI
# Conflicts:
#	app/build.gradle
2017-02-26 16:55:54 +01:00
Andreas Shimokawa
8b39ef3a52 Speedup for charts by caching aggregated sleep amounts and steps for maximum 32 days 2017-02-26 00:40:50 +01:00
cpfeiffer
53dbc54041 Only start the webview when needed 2017-02-25 22:02:40 +01:00
cpfeiffer
234beace29 Some fixes for the background webview 2017-02-25 21:50:05 +01:00
cpfeiffer
711800f3d0 Collaborative attempt to initialize the background webview on startup 2017-02-25 18:01:08 +01:00
Daniele Gobbetti
a4ac108287 Pebble: merge master moving the location override to WebViewSingleton 2017-02-25 15:44:37 +01:00
Andreas Shimokawa
772a22f78b Merge branch 'master' into background-javascript 2017-02-25 13:02:07 +01:00
cpfeiffer
e5d09b9fa2 Automatically start the service on boot (can be turned off)
Fixes #9
2017-02-17 23:24:44 +01:00
ivanovlev
fd61dc602f Transliteration: capitalized just the first letter in the replacement text 2017-02-04 09:53:07 +03:00
cpfeiffer
6c16b4fb15 Updated initial array list size to reflect reality 2017-01-28 23:25:15 +01:00
Daniele Gobbetti
d6dd03a065 Pebble: webview add safety check 2017-01-28 17:45:23 +01:00
Daniele Gobbetti
f66f765fb6 Merge remote-tracking branch 'origin/master' into background-javascript
# Conflicts:
#	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java
2017-01-28 17:43:34 +01:00
ivanovlev
2d3907b0f0 Fix issue #522 : Transliterate Caller Name 2017-01-27 23:16:19 +03:00
João Paulo Barraca
b3e1cbf55e HPlus: Support of Makibes F68 and small fixes to HPlus devices 2017-01-26 13:02:58 +00:00
cpfeiffer
ac68bfe351 Mi Band 1+2: backend implementation of making BT pairing optional
- cleaned up the DeviceService.connect() variants
- discovery: pass the device candidate around instead of the mac address

Attempts to fix #512, #514, #518
2017-01-26 00:16:38 +01:00
João Paulo Barraca
1f083041b9 HPlus: Improve display of new messages and phone calls 2017-01-24 01:44:30 +00:00
ivanovlev
c13725911f Transliteration off by default, if setting not exist 2017-01-19 08:09:36 +03:00
ivanovlev
cbc91e7fef Moving transliteration call from module "HPlus" to common support 2017-01-17 23:07:12 +03:00
ivanovlev
bfe24dd9f0 Refactoring 2017-01-15 22:46:30 +03:00
ivanovlev
2de9580dea Added diacritic convertation into Transliteration 2017-01-15 22:10:12 +03:00
ivanovlev
074394cba4 Transliteration is moved to a separate class, added settings option 2017-01-15 12:24:36 +03:00
Daniele Gobbetti
c1abaaa4e0 Add support for hiding the icon in the status bar and the notification on the lockscreen.
This adds proper settings to toggle GB behavior and closes #460.
2017-01-08 15:51:56 +01:00
Yar
5c8f02d054 Set notification to minimal priority
Pebble app is not showing in status bar and on lockscreen. This change is for GadgetBridge to have the same behavior.
2017-01-08 15:31:55 +01:00
Daniele Gobbetti
c9cfaa9bd8 Pebble: webview. Implement two way communication with JS.
The support within JS is a bit hacky and sometimes conflicts with the configuration page.
2017-01-03 15:04:51 +01:00
Daniele Gobbetti
0efacfbad5 Pebble: webview ensure the webview works no matter which the order of loading the components is. 2017-01-02 12:32:52 +01:00
Daniele Gobbetti
7ab74fb11b Pebble: webview. Use the main thread explicitly again and log XHR requests at least on Lollipop and up 2017-01-02 12:07:57 +01:00
Daniele Gobbetti
4ef0415da2 Pebble: webview. Ensure we are on the main thread for disposing the webview and implement sending messages to the webview. 2017-01-01 21:01:58 +01:00
Daniele Gobbetti
d22c78e8f7 Pebble: webview, simplify the code since finals are not required anymore 2017-01-01 18:37:42 +01:00
Daniele Gobbetti
eaaa940637 Pebble: refactor the background webview
Now native controls seem to work (including datepicker), still the webview is not started upon watchapp start, but when long-pressing each app in the app manager. After the webview is started it will live in the background until device disconnect.
2017-01-01 18:33:39 +01:00
Andreas Shimokawa
6d02a76328 Merge branch 'master' into background-javascript 2017-01-01 17:25:12 +01:00
Daniele Gobbetti
dbf88bab5f Outdated TODO removed 2016-12-29 20:44:04 +01:00
cpfeiffer
aadde7d1ca Port to UriHelper, fix potential resource leak 2016-12-29 01:41:47 +01:00
cpfeiffer
0646eda646 Fix file potential handle leaks 2016-12-29 01:07:26 +01:00
Daniele Gobbetti
53d8f88670 Pebble: first steps towards background JS execution.
Progress so far:
- webview is created upon watchapp launch
- webview is destroyed after disconnect
- ready event is fired in the background
- showConfiguration is fired upon webview display
2016-12-28 20:53:17 +01:00
João Paulo Barraca
5b3ef8999f Add preliminary support for HPlus devices, such as the Zeblaze Zeband (and many others)
Working: Text and call notifications, setting most user data, date and time, heart rate monitoring, sleep monitoring (alfa)
2016-12-21 12:51:25 +00:00
cpfeiffer
d12103e95d Merge branch 'master' into new_GUI 2016-12-15 20:31:04 +01:00
cpfeiffer
c69889d177 Simplified + fixed ArrayUtils.equals() + added lots of testcases 2016-12-11 23:30:20 +01:00
cpfeiffer
6dfc895303 Mi2: Initial work on firmware update #427 2016-12-11 02:11:58 +01:00
Daniele Gobbetti
e0a844b60a Liveview: Initial support for Liveview devices
Working so far: stable connection, setting time and sending notifications.
2016-12-03 16:20:02 +01:00
Uwe Hermann
0746aaa579 app: Random typo and consistency fixes. 2016-12-01 20:22:12 +01:00
Andreas Shimokawa
34ad088b88 Pebble: Experimental support for BLE on all models via dev option in Pebble Settings
HOWTO:
1) Pair you normal Pebble (not necessary if already done), make sure it was connected once
2) Unpair your LE pebble if already paired
3) Switch on "Always prefer BLE" in Pebble Settings
4) Tap on the + in Control Center to add a new device
5) Pair your Pebble-LE XXXX or Pebble Time LE XXXX inside Gadgetbridge's Device Discovery actibity

Now Gadgetbridge will connect to your LE Pebble when tapping on Pebble XXXX if "Always Prefer BLE" option is enabled.
You can easily switch back to classic LE by turning that option off again
2016-11-27 09:49:28 +01:00
cpfeiffer
2f7eb9ef23 Some more improvements to discovery
- pass service uuids to GBDeviceCandaidate so that DeviceCoordinators
  can detect devices by their services.

Note: they should not rely on service uuids being available
2016-11-27 02:46:07 +01:00
cpfeiffer
b9ff2cd468 A few improvements to discovery
- display the right icon for found device candidates
- scan for specific LE services
2016-11-27 01:09:20 +01:00
Andreas Shimokawa
4b7f47ba6c Pebble 2: add Workout system app to app manager on P2 and hexdump incoming HRM datalog 2016-11-15 11:56:14 +01:00
cpfeiffer
3cc8d887ca Mi2: Initial support for wear location, hr during sleep and date format #323
- wear location from prefs is sent to the band
- hr measurement during sleep is sent to the band
- date format is sent to the band (date+time or just time)
  (TODO: needs preference option)
2016-11-13 01:44:52 +01:00
Daniele Gobbetti
d467b37493 ControlCenterv2: further steps:
Close drawer before launching activities (feels sloow).
Implement device deletion (untested).
Add app-management icon, remove tap-connected-device-for-primary-activity, hidden (not removed) text hint.
Use level-list for device icon.
Use the new control center when tapping GB notifications.
Added icons to the legacy control center context menu, perhaps it can be embedded in the card?
2016-10-25 17:49:21 +02:00
cpfeiffer
5c8525c5d0 Don't rely on File.canWrite() for directories, closes #406 2016-10-10 21:01:41 +02:00
cpfeiffer
f57fec25f8 Remove the coordinator instance #323
For now, always iterate over the available coordinators instead.
Should fix MiBandSupport occasionally being used in place of MiBand2Support.
2016-10-10 20:52:40 +02:00
cpfeiffer
2a0d97b39a Improved error handling, display errors when deleting device 2016-09-30 23:07:30 +02:00
cpfeiffer
09502f96c9 AlertDialog.show() is non-modal, so put code into callback. Also added unpairing. 2016-09-30 22:58:28 +02:00
cpfeiffer
0a4eefcf11 Use device information from the database for GBDevices
fixes offline charts not displaying heartrate for Mi1S
2016-09-29 22:40:16 +02:00
Andreas Shimokawa
8ba7bc7353 Add (useless) support for Vibratissimo "massage devices"
Don't take this serious. It will make the "massage device" vibrate when a phone call arrives.
It is inspired by the famous lawsuit[1] which has nothing to do with the Vibratissimo device maker.
After reading this I picked up the cheapest ble massage device just to see if we could support it.
And yes, we can.

[1] http://arstechnica.com/wp-content/uploads/2016/09/vibratorsuit.pdf
2016-09-19 12:37:41 +02:00
JohnnySun
53d4681763 Optimize Imports 2016-09-13 23:53:35 +08:00
Andreas Shimokawa
5a49f1215e Display known devices from db even if Bluetooth is off or unsupported
This allows to view activity data without turning bt on or connecting to the pebble emulator via tcp/ip (needs modified manifest for internet access)
2016-09-02 10:54:32 +02:00
cpfeiffer
cd535a0a45 Include known devices from the database in CC
(as long as device-support is still available)
Fixes non-paired devices not being displayed
2016-08-31 00:33:54 +02:00
cpfeiffer
bcb07ccacd Enable LoggingTest with robolectric 2016-08-29 00:26:29 +02:00
cpfeiffer
bfc0b4faaf Add robolectric dependency and addd a first EntitiesTest
Use KitKat (19) as target sdk since robolectric 3.1.2/sqlite4java
does not understand "WITHOUT ROWID" tables.

Also, add constants for user's gender and document some things.
2016-08-24 22:56:42 +02:00
cpfeiffer
7a16834482 *return* the created device! 2016-08-18 21:29:26 +02:00
cpfeiffer
fbf06c1fe3 Separate coordinator and support instances for Mi1 and Mi2 #323
+ Some more testing stuff for Mi2
2016-08-17 00:53:16 +02:00
cpfeiffer
154b7d28bb Let discovery activity also display device aliases 2016-07-05 23:36:21 +02:00
Andreas Shimokawa
73b2fc357e Pebble: Add some Pebble Time 2 support - NOT WORKING
Not working because these are expected to use BLE.
The Emulator should work though.
2016-07-04 22:09:56 +02:00
cpfeiffer
76a44ad3a4 more logging to detect problems with external dirs: #343 2016-06-27 22:01:52 +02:00
cpfeiffer
56615de1f0 log FileNotFoundException when checking if directory is writable or not: #343 2016-06-27 21:29:39 +02:00
Andreas Shimokawa
659165fa4c Pebble: fix new app manager on 2.x
- properly intert apps reported from pebble into the corresponding tab
- disable tracking of installed apps
- disable drag and drop for apps and watchfaces
- ...
2016-06-24 13:39:29 +02:00
cpfeiffer
dc932355b5 Some javadoc re DeviceManager 2016-06-18 23:40:37 +02:00
cpfeiffer
233a6155cc Add class DeviceManager that provides access to the list of managed devices
Basically moved code out of ControlCenter to a separate class. Also provides
change events when the device list has changed, or changes to the device
state have occurred.
2016-06-18 23:35:34 +02:00
cpfeiffer
d544509b60 Merge remote-tracking branch 'origin/master' into db-refactoring 2016-06-16 21:55:16 +02:00
Andreas Shimokawa
d225743d64 Pebble: some preparations for Pebble 2 2016-06-15 22:53:05 +02:00
cpfeiffer
3b87966fe9 Merge branch 'master' into db-refactoring 2016-06-06 22:16:40 +02:00
cpfeiffer
50b7a02ef2 One more attempt at fixing dynamic logging reconfiguration
- moved out of GBApplication to class Logging
- the main thing is: when start()ing the FileAppender again, it *must*
- be configured to be non-lazy, otherwise it won't open the stream ever again.
2016-05-26 23:46:21 +02:00
cpfeiffer
40a376bbd0 Merge branch 'master' into db-refactoring 2016-05-16 23:01:16 +02:00
cpfeiffer
8ca821ab8a More WIP on db refactoring 2016-05-13 23:47:47 +02:00
cpfeiffer
40837996f8 Fix logback initialization, closes #300 2016-05-08 21:39:23 +02:00
Andreas Shimokawa
5b21895283 try to get BT alias name by reflection. Useful if you have a lot of Mi Bands 2016-05-07 21:46:20 +02:00
cpfeiffer
5e02724c4c Make automatic reconnect after connection loss configurable #293
Mi Band: automatically reconnect when the device is back in range

Also: #89
2016-04-28 23:17:13 +02:00
cpfeiffer
eca5d40efe More javadoc 2016-04-26 00:02:35 +02:00
cpfeiffer
47984dba0a javadoc 2016-04-25 23:45:27 +02:00
cpfeiffer
e35ce978bd Remove now unused imports + fix one more SharedPreferences usage 2016-04-25 23:43:19 +02:00
cpfeiffer
0c715a2669 Wrap access to SharedPreferences with "Prefs"
(to centralize quirk handling)
2016-04-25 23:18:55 +02:00
cpfeiffer
98d7237ec3 Display a different notification icon, when disconnected
Better icons welcome :-)
2016-04-15 22:57:13 +02:00
cpfeiffer
a4919789ca Add some progress to firmware updating #271 #234
Also: remove the low latency mode for firmware update,
because my Mi1S simply disconnects then.

Still missing in the view: device disconnects
2016-04-03 00:50:45 +02:00
Andreas Shimokawa
adfef3db42 Prepare code for more music metadata (duration, track count, current track number)
Oh and format code
2016-03-27 17:45:44 +02:00
cpfeiffer
424d9cd142 More work on firmware detection, recognition and validation #234
Should be as robust as possible now.
2016-03-21 23:42:34 +01:00
Andreas Shimokawa
4be1926459 reformat code though Android Studio 2016-03-20 15:00:05 +01:00
Andreas Shimokawa
a3ee3c15fc Pebble: copy pebble-app-js.js out of the pbw upon installation not upon reading the .pbw
This eliminates the need to copy the whole file into a byte[], and all file size limts are gone.
2016-03-08 11:41:20 +01:00
Daniele Gobbetti
6d4b98719a Implement some further JS methods to make additional watchapps happy 2016-03-04 17:44:42 +01:00
Andreas Shimokawa
63d938559e pass GBDevice down to ExternalPebbleJSActivity to determine the platform version (aplite,basalt,chalk) 2016-03-03 11:52:30 +01:00
Andreas Shimokawa
ed85fd5011 convert byte and short values related to activity tracking to int
This avoids a lot of problems because java
- does not know unsigned values
- jvm and dalvic do not internally support byte and short
- sqlite does not know them either
2016-02-29 20:54:39 +01:00
cpfeiffer
a10c6f3b9f Some initial heartrate support #205
(not visible to user yet)
2016-02-26 00:30:57 +01:00
cpfeiffer
defa97b882 Log the toast message immediately, not delayed in the main thread
(this helps understanding logs)
2016-02-24 23:53:30 +01:00
Julien Pivotto
dd9864015d Fix #221 - Cast pair.first as integer
This commit fixes the following compilation error:

```
:app:compileDebugJavaWithJavac
/home/bob/dev/Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/LimitedQueue.java:26:
error: incomparable types: Object and int
            if (pair.first == id) {
                           ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.
```
2016-02-08 06:32:36 +01:00
Andreas Shimokawa
0b53f60b0d Pebble: EXPERIMENTAL support for replying to wearable notifications
Tested with Signal, more could work.
2016-01-09 17:54:17 +01:00
Andreas Shimokawa
46bbab7df0 rename IDSenderLookup to LimitedQueue and store Object instead of String 2016-01-09 16:07:22 +01:00
Andreas Shimokawa
de5f30ae97 WIP: Work towards SMS replies / canned replies, round 3
- put random id/phone number pair into limited lookup list (last 16 sms messages) when sms arrives
- lookup the phone number when replying from the a device

THIS STILL DOES NOT DO ANYTHING USEFUL
2015-12-14 23:31:31 +01:00
cpfeiffer
f258e62633 Refactoring: centralize GBDevice creation
- created and provided by DeviceHelper
- passed from UI to service
- without UI, service uses DeviceHelper directly

=> Cleaner and less duplicated code
2015-12-13 00:43:07 +01:00
cpfeiffer
159c187e5e On Quit, remove all pending notifications
At least the notifications from #141 don't stay there forever, then.
2015-12-08 21:48:56 +01:00
Andreas Shimokawa
8b87e97f51 fix crash in FileUTils.copyURItoFile() if source and destination are the same file.
This allows to install pbw files from the pbw-cache manually though a file manager.
2015-12-08 18:59:37 +01:00
cpfeiffer
7f8ba83aab This might fix the missing progress bar #155
setVisibility(Public) is only available since Lollipop.
2015-12-07 23:09:19 +01:00
Andreas Shimokawa
1c3e0b628b Pebble: store app details in pbw-cache and display them in app manager on firmware 3.x
Improves #93
2015-12-07 18:16:23 +01:00
Andreas Shimokawa
79f92b8495 Fix installing pbw files from different URIs than local files on Firmware 3.x. Fixes #183 2015-12-06 17:22:07 +01:00
cpfeiffer
bd0716ba58 Some more lint warnings fixed 2015-11-23 23:04:46 +01:00
cpfeiffer
34e08f6de8 Avoid potential NPE. Check for null first. 2015-11-18 23:21:56 +01:00
cpfeiffer
1e6db708d2 Fix NPE.
Now that is a really crappy API in Android that returns an array with null values.

closes #167
2015-11-18 23:18:01 +01:00
cpfeiffer
d4f070f0aa Simplify external dir handling again -- prefer the primary dir
The primary external dir is often a user-partition on the internal
storage medium. This one is safe in multi-user environments.

The "removable storage" (sdcard) on the other hand can be read by
everyone. If the former is not available or not writable, use the
latter.

closes #153
2015-11-01 20:49:50 +01:00
cpfeiffer
8920f5e95b Test fixing problem with non-writable getExternalFilesDir() #153 2015-10-29 00:46:52 +01:00