mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-04 01:09:47 +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:
|
||||
LOG.info("got GBDeviceEventAppManagement START event for uuid: " + appMgmt.uuid);
|
||||
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;
|
||||
default:
|
||||
|
@ -2710,6 +2710,10 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||
mEnablePebbleKit = enablePebbleKit;
|
||||
}
|
||||
|
||||
boolean hasAppMessageHandler(UUID uuid) {
|
||||
return mAppMessageHandlers.containsKey(uuid);
|
||||
}
|
||||
|
||||
private String getFixedString(ByteBuffer buf, int length) {
|
||||
byte[] tmp = new byte[length];
|
||||
buf.get(tmp, 0, length);
|
||||
|
Loading…
Reference in New Issue
Block a user