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

497 Commits

Author SHA1 Message Date
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
cpfeiffer
1f599c660f Improved file and error handling 2015-10-28 23:54:08 +01:00
cpfeiffer
1e56e540fa Remove hardcoded equals("MI") in favor of DeviceCoordintator #136 2015-10-18 01:01:13 +02:00
Andreas Shimokawa
a9186791dc register/unregister receivers at runtime instead of enabling/disabling them via packagemanger 2015-10-16 00:23:16 +09:00
Andreas Shimokawa
a4a59f5df4 fix hexdump() when using an offset with -1 as length (= full length) 2015-10-04 22:42:21 +09:00
Andreas Shimokawa
e3533a2b18 Pebble: Allow muting (blacklisting) Apps from within generic notifications on the watch
Closes #113
2015-09-25 00:53:40 +02:00
Andreas Shimokawa
1d41f2f8e4 Refactoring
The notfification APIs now use NotificationSpec as their only parameter, which
contains all information (required and optional ones).
We no longer have separate methods and actions for SMS/EMAIL/GENERIC anymore.
The type of notification is important now, not how we received them technically.
2015-09-24 14:45:21 +02:00
Daniele Gobbetti
e1ea8270ca Add a progress notification for the activity data transfer. 2015-09-24 14:03:01 +02:00
cpfeiffer
d9b4bbe550 Move activity data and progress manipulation into dedicated methods
I did this in trying to understand the code better and to easier allow
for error handling/transaction rollback to be added.
2015-09-23 23:16:42 +02:00
cpfeiffer
69b64ed4b6 More logging for time/timezone changes
(trying to find an explanation for #91)
2015-09-05 00:14:09 +02:00
Andreas Shimokawa
2da717ea4c set visibility of service notification to public again 2015-08-31 21:29:00 +02:00
cpfeiffer
25ddc20f89 Fix testcases with sdk 23: don't call Notificaton API during local tests 2015-08-29 20:39:34 +02:00
Daniele Gobbetti
6ebc727f97 Merge remote-tracking branch 'origin/master' into low_battery_notification
Conflicts:
	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java
2015-08-24 17:48:17 +02:00
cpfeiffer
77cad5c47f Initial support for testing the DeviceCommunicationService
Lots of support classes to enable local testing, without
a device or an emulator.
2015-08-22 01:09:56 +02:00
Andreas Shimokawa
1150ad2b8d Pebble: Support taking Pebble Time screenshots. Closes #97. 2015-08-22 00:14:14 +02:00
Daniele Gobbetti
dcc988139f Merge remote-tracking branch 'origin/master' into low_battery_notification 2015-08-21 17:34:11 +02:00
cpfeiffer
a1cb246e27 Add and use a "client interface" for the actions of the service
Previously, the DeviceCommunicationService was invoked directly,
via
Intent intent = new Intent(foo, bar);
intent.setExtra(EXTRA_BAZ, baz);
startService(...);

and this was scattered throughout GadgetBridge.
Now there is a "frontend" available, so that you can call
the service more easily, like
GBApplication.deviceService().connect();

For a start, this client interface (DeviceService) actually
implements the same interface (EventHandler) as the receiving side
(DeviceSupport). This may change in the future.

This will also make testing much easier, because we can use
this client interface to invoke the test service as well.
2015-08-21 01:03:57 +02:00
Daniele Gobbetti
0d8adeb7f9 Some refinements:
- only show the bigtext notification if the device has set extended battery info
- custom icon for the low battery notification (with license information)
- show device name in the notification
- set the notification to high priority
- the battery threshold is now set in GBDevice
2015-08-19 17:36:53 +02:00
Daniele Gobbetti
c3e395818f Adding support for battery events using GBDeviceEvent.
- show notification on low battery (closes #40)
- Miband specific: add date of last charge and number of charges
2015-08-18 17:37:51 +02:00
cpfeiffer
585a888ecb Improved javadoc 2015-08-18 00:11:51 +02:00
cpfeiffer
e6a0c35f73 Extract checksum implementations into separate class CheckSums 2015-08-17 22:43:42 +02:00
cpfeiffer
bcf42f8022 Finally, the prev and next buttons do something (#79)
Far from perfect, but a start.
2015-08-17 02:22:16 +02:00
cpfeiffer
2a2eae068a Improvements to the install activity #30
- made it independent of Mi fw and Pebble fw + app classes
- automatically connect to the last used device
- some other small fixes/improvements
2015-08-06 02:17:38 +02:00
cpfeiffer
910d9ef398 Make firmware reading a bit more failsafe #30 2015-08-04 23:02:36 +02:00
cpfeiffer
7c597b325a Big refactoring: move classes and packages around to get a better structure
- model package contains mostly shared interfaces (UI+service), not named GB*
- impl package contains implementations of those interfaces, named GB*
  the impl classes should not be used by the service (not completely done)
- the service classes should mostly use classes inside the service and deviceevents
  packages (tbd)

Every device now has two packages:
- devices/[device name] for UI related functionality
- service[device name] for lowlevel communication
2015-08-03 23:09:49 +02:00
Andreas Shimokawa
dbbcf20bbc reformat code 2015-07-25 21:52:52 +02:00
cpfeiffer
cc549a6c49 Basic database import and export (to external storage)
(In the Debug Activity)
2015-07-08 23:11:23 +02:00