summaryrefslogtreecommitdiff
path: root/plugins/nl.x-services.plugins.insomnia/src/android/nl
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-10-31 08:21:38 -0400
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-10-31 08:21:38 -0400
commit02811010cf62f1b21a06780d1e470d04bb24c50f (patch)
tree0d933789068aac11c810ed4bb169d14ab16c43c6 /plugins/nl.x-services.plugins.insomnia/src/android/nl
parentbca561c1b3989d62a1fba829e0380c6fbf36caf5 (diff)
removed unecessary files from git
Diffstat (limited to 'plugins/nl.x-services.plugins.insomnia/src/android/nl')
-rw-r--r--plugins/nl.x-services.plugins.insomnia/src/android/nl/xservices/plugins/Insomnia.java47
1 files changed, 0 insertions, 47 deletions
diff --git a/plugins/nl.x-services.plugins.insomnia/src/android/nl/xservices/plugins/Insomnia.java b/plugins/nl.x-services.plugins.insomnia/src/android/nl/xservices/plugins/Insomnia.java
deleted file mode 100644
index 95094938..00000000
--- a/plugins/nl.x-services.plugins.insomnia/src/android/nl/xservices/plugins/Insomnia.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package nl.xservices.plugins;
-
-import android.view.WindowManager;
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.PluginResult;
-import org.json.JSONArray;
-import org.json.JSONException;
-
-public class Insomnia extends CordovaPlugin {
-
- private static final String ACTION_KEEP_AWAKE = "keepAwake";
- private static final String ACTION_ALLOW_SLEEP_AGAIN = "allowSleepAgain";
-
- @Override
- public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
- try {
- if (ACTION_KEEP_AWAKE.equals(action)) {
- cordova.getActivity().runOnUiThread(
- new Runnable() {
- public void run() {
- cordova.getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
- }
- });
- return true;
-
- } else if (ACTION_ALLOW_SLEEP_AGAIN.equals(action)) {
- cordova.getActivity().runOnUiThread(
- new Runnable() {
- public void run() {
- cordova.getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK));
- }
- });
- return true;
-
- } else {
- callbackContext.error("insomnia." + action + " is not a supported function. Did you mean '" + ACTION_KEEP_AWAKE + "'?");
- return false;
- }
- } catch (Exception e) {
- callbackContext.error(e.getMessage());
- return false;
- }
- }
-}