package com.marcshilling.idletimer;

import android.app.Activity;
import android.view.WindowManager;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;

public class IdleTimerManager extends ReactContextBaseJavaModule
{

    public IdleTimerManager(ReactApplicationContext reactContext) {
        super(reactContext);
    }

    @Override
    public String getName() {
        return "IdleTimerManager";
    }

    @ReactMethod
    public void setIdleTimerDisabled(final boolean disabled) {

        final Activity activity = this.getCurrentActivity();
        if (activity != null) {
            activity.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    if (disabled) {
                        activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
                    } else {
                        activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
                    }
                }
            });
        }


    }
}

@@ -260,16 +260,124 @@
 Method;%0A
+import com.facebook.react.module.annotations.ReactModule;%0A%0A@ReactModule(name = IdleTimerManager.MODULE_NAME)
 %0Apublic 
@@ -435,16 +435,74 @@
 Module%0A%7B
+%0A    static final String MODULE_NAME = %22IdleTimerManager%22;
 %0A%0A    pu
@@ -658,34 +658,32 @@
  return 
-%22IdleTimerManager%22
+this.MODULE_NAME
 ;%0A    %7D%0A

Add module annotation (#18)