From 3d8a80c6199f785d6010b5c15cfa04fbde95bbfe Mon Sep 17 00:00:00 2001 From: Tree Date: Tue, 25 Nov 2014 17:54:53 +0000 Subject: [PATCH] Android handler for requestStateForRegion (just sends out an error) --- src/android/LocationManager.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/android/LocationManager.java b/src/android/LocationManager.java index 613046f..0a4548c 100644 --- a/src/android/LocationManager.java +++ b/src/android/LocationManager.java @@ -160,6 +160,8 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo getMonitoredRegions(callbackContext); } else if (action.equals("getRangedRegions")) { getRangedRegions(callbackContext); + } else if (action.equals("requestStateForRegion")) { + requestStateForRegion(args.optJSONObject(0), callbackContext); } else if (action.equals("registerDelegateCallbackId")) { registerDelegateCallbackId(args.optJSONObject(0), callbackContext); } else if (action.equals("isMonitoringAvailableForClass")) { @@ -751,7 +753,8 @@ public PluginResult run() { } }); } - + + private void getMonitoredRegions(CallbackContext callbackContext) { _handleCallSafely(callbackContext, new ILocationManagerCommand() { @@ -796,6 +799,23 @@ public PluginResult run() { } }); } + + //NOT IMPLEMENTED: Manually request monitoring scan for region. + //This might not even be needed for Android as it should happen no matter what + private void requestStateForRegion(final JSONObject arguments, CallbackContext callbackContext) { + + _handleCallSafely(callbackContext, new ILocationManagerCommand() { + @Override + public PluginResult run() { + + //not supported on Android + PluginResult result = new PluginResult(PluginResult.Status.ERROR, "Manual request for monitoring update is not supported on Android"); + result.setKeepCallback(true); + return result; + + } + }); + } private void isRangingAvailable(CallbackContext callbackContext) {