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

51 Commits

Author SHA1 Message Date
Daniele Gobbetti
13064036fe Fix pebble webview local content- and HttpService access. 2023-08-23 14:56:47 +02:00
José Rebelo
1af800666e Update pebble webview to use HttpService 2023-08-23 09:18:08 +01:00
Andreas Shimokawa
969164ba5d Remove KitKat support 2022-09-10 12:04:16 +02:00
License Bot
1b5402dcb4 update license headers 2021-01-10 23:38:13 +01:00
Bot
40852d3641 Fixed a bunch of misspellings and formatting 2020-08-26 14:37:40 +03:00
TaaviE
7db3b68047 Fixed a bunch of warnings 2020-08-26 09:38:31 +02:00
License Bot
d6fa5d0dd5 Update license headers 2020-01-09 10:44:32 +01:00
License Bot
beedb653e6 Update license headers 2019-02-13 20:43:31 +01:00
Daniele Gobbetti
75d3dffb14 Migrate to androidx support libraries and bump compile SDK version
"Optimize imports" has been run on all source files, there might be
unrelated changes, but these should be harmless.
2019-01-26 16:00:56 +01: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
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
License Bot
238bacde9f Update license headers 2018-02-26 14:27:33 +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
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
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
df2a313168 Webview: make the webview more robust to disconnections 2017-09-03 17:55:00 +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
ceec76b4f6 Pebble: preparations for js appmessage ack/nack callbacks 2017-08-01 00:03:28 +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
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
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
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
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
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
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
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
Daniele Gobbetti
d6dd03a065 Pebble: webview add safety check 2017-01-28 17:45:23 +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
Daniele Gobbetti
dbf88bab5f Outdated TODO removed 2016-12-29 20:44:04 +01:00