mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-24 10:56:50 +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,8 +517,12 @@ class PebbleIoThread extends GBDeviceIoThread {
|
||||
case START:
|
||||
LOG.info("got GBDeviceEventAppManagement START event for uuid: " + appMgmt.uuid);
|
||||
if (prefs.getBoolean("pebble_enable_background_javascript", false)) {
|
||||
if (mPebbleProtocol.hasAppMessageHandler(appMgmt.uuid)) {
|
||||
WebViewSingleton.disposeWebView();
|
||||
} else {
|
||||
WebViewSingleton.runJavascriptInterface(gbDevice, appMgmt.uuid);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -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