From 0eb8a0b5e2284b79c6ddb03fdf4f03808ddc3656 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Wed, 4 Oct 2017 23:12:49 +0200 Subject: [PATCH] Pebble: Fix background javascript for Pebble2/LE/Emulator --- .../service/devices/pebble/PebbleIoThread.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java index e7ce17c63..9738b05bb 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java @@ -162,16 +162,15 @@ class PebbleIoThread extends GBDeviceIoThread { mBtSocket.connect(); mInStream = mBtSocket.getInputStream(); mOutStream = mBtSocket.getOutputStream(); - - if (prefs.getBoolean("pebble_enable_background_javascript", false)) { - Intent startIntent = new Intent(getContext(), ExternalPebbleJSActivity.class); - startIntent.putExtra(ExternalPebbleJSActivity.START_BG_WEBVIEW, true); - getContext().startActivity(startIntent); - } else { - LOG.debug("Not enabling background Webview, is disabled in preferences."); - } } } + if (prefs.getBoolean("pebble_enable_background_javascript", false)) { + Intent startIntent = new Intent(getContext(), ExternalPebbleJSActivity.class); + startIntent.putExtra(ExternalPebbleJSActivity.START_BG_WEBVIEW, true); + getContext().startActivity(startIntent); + } else { + LOG.debug("Not enabling background Webview, is disabled in preferences."); + } } catch (IOException e) { LOG.warn("error while connecting: " + e.getMessage(), e); gbDevice.setState(originalState);