mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-24 19:06:53 +01:00
Pebble: dispose webview when app with app handler has been started (misfit, morpheuz)
This commit is contained in:
parent
086974be8c
commit
ea06df4d0c
@ -517,7 +517,11 @@ class PebbleIoThread extends GBDeviceIoThread {
|
|||||||
case START:
|
case START:
|
||||||
LOG.info("got GBDeviceEventAppManagement START event for uuid: " + appMgmt.uuid);
|
LOG.info("got GBDeviceEventAppManagement START event for uuid: " + appMgmt.uuid);
|
||||||
if (prefs.getBoolean("pebble_enable_background_javascript", false)) {
|
if (prefs.getBoolean("pebble_enable_background_javascript", false)) {
|
||||||
WebViewSingleton.runJavascriptInterface(gbDevice, appMgmt.uuid);
|
if (mPebbleProtocol.hasAppMessageHandler(appMgmt.uuid)) {
|
||||||
|
WebViewSingleton.disposeWebView();
|
||||||
|
} else {
|
||||||
|
WebViewSingleton.runJavascriptInterface(gbDevice, appMgmt.uuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -2710,6 +2710,10 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
|||||||
mEnablePebbleKit = enablePebbleKit;
|
mEnablePebbleKit = enablePebbleKit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean hasAppMessageHandler(UUID uuid) {
|
||||||
|
return mAppMessageHandlers.containsKey(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
private String getFixedString(ByteBuffer buf, int length) {
|
private String getFixedString(ByteBuffer buf, int length) {
|
||||||
byte[] tmp = new byte[length];
|
byte[] tmp = new byte[length];
|
||||||
buf.get(tmp, 0, length);
|
buf.get(tmp, 0, length);
|
||||||
|
Loading…
Reference in New Issue
Block a user