Commit 14dfd156 authored by Sebastián Katzer's avatar Sebastián Katzer
Browse files

Small code changes

parent cbf00120
Loading
Loading
Loading
Loading
+6 −13
Changes for src/android/LocalNotification.java: 6 added lines, 13 removed lines.
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ public class LocalNotification extends CordovaPlugin {

                    cancel(id);
                    unpersist(id);
                    execCallback(command);
                    command.success();
                }
            });
        }
@@ -97,7 +97,7 @@ public class LocalNotification extends CordovaPlugin {
                public void run() {
                    cancelAll();
                    unpersistAll();
                    execCallback(command);
                    command.success();
                }
            });
        }
@@ -227,13 +227,13 @@ public class LocalNotification extends CordovaPlugin {
     *          The notification ID to be check.
     * @param callbackContext
     */
    public static void isScheduled (String id, CallbackContext callbackContext) {
    public static void isScheduled (String id, CallbackContext command) {
        SharedPreferences settings = getSharedPreferences();
        Map<String, ?> alarms      = settings.getAll();
        boolean isScheduled        = alarms.containsKey(id);
        PluginResult result        = new PluginResult(PluginResult.Status.OK, isScheduled);

        callbackContext.sendPluginResult(result);
        command.sendPluginResult(result);
    }

    /**
@@ -241,13 +241,13 @@ public class LocalNotification extends CordovaPlugin {
     *
     * @param callbackContext
     */
    public static void getScheduledIds (CallbackContext callbackContext) {
    public static void getScheduledIds (CallbackContext command) {
        SharedPreferences settings = getSharedPreferences();
        Map<String, ?> alarms      = settings.getAll();
        Set<String> alarmIds       = alarms.keySet();
        JSONArray pendingIds       = new JSONArray(alarmIds);

        callbackContext.success(pendingIds);
        command.success(pendingIds);
    }

    /**
@@ -294,13 +294,6 @@ public class LocalNotification extends CordovaPlugin {
        editor.apply();
    }

    /**
     * Simply invokes the callback without any parameter.
     */
    private static void execCallback (CallbackContext command) {
        command.sendPluginResult(new PluginResult(PluginResult.Status.OK));
    }

    /**
     * Fires the given event.
     *