Skip to content

Commit

Permalink
Android handler for requestStateForRegion (just sends out an error)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtree1 committed Nov 25, 2014
1 parent ef1bd5b commit 3d8a80c
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/android/LocationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down Expand Up @@ -751,7 +753,8 @@ public PluginResult run() {
}
});
}



private void getMonitoredRegions(CallbackContext callbackContext) {

_handleCallSafely(callbackContext, new ILocationManagerCommand() {
Expand Down Expand Up @@ -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) {

Expand Down

0 comments on commit 3d8a80c

Please sign in to comment.