diff --git a/src/android/BackgroundMode.java b/src/android/BackgroundMode.java index 3f9cfdf..3a7f70d 100644 --- a/src/android/BackgroundMode.java +++ b/src/android/BackgroundMode.java @@ -104,8 +104,8 @@ public class BackgroundMode extends CordovaPlugin { return true; } - if (action.equalsIgnoreCase("enableGeoLocation")) { - enableGeoLocation(); + if (action.equalsIgnoreCase("disableWebViewOptimizations")) { + disableWebViewOptimizations(); return true; } @@ -271,7 +271,7 @@ public class BackgroundMode extends CordovaPlugin { /** * Enable GPS position tracking while in background. */ - private void enableGeoLocation() { + private void disableWebViewOptimizations() { Thread thread = new Thread(){ public void run() { try { diff --git a/www/background-mode.js b/www/background-mode.js index 6d520a0..622859e 100644 --- a/www/background-mode.js +++ b/www/background-mode.js @@ -93,9 +93,9 @@ exports.configure = function (options) { /** * Enable GPS-tracking in background (Android). */ -exports.enableGeoLocation = function () { +exports.disableWebViewOptimizations = function () { if (device.platform == 'Android') { - cordova.exec(null, null, 'BackgroundMode', 'enableGeoLocation', []); + cordova.exec(null, null, 'BackgroundMode', 'disableWebViewOptimizations', []); } };