// Path: app/src/main/java/clock/socoolby/com/clock/ClockApplication.java
// public class ClockApplication extends Application {
// 
//     private static ClockApplication sEndzoneBoxApp;
//     private BusinessService mBusinessService = new BusinessService();
// 
//     public static ClockApplication getInstance() {
//         return sEndzoneBoxApp;
//     }
// 
//     @Override
//     public void onCreate() {
//         sEndzoneBoxApp = this;
//         init();
//         super.onCreate();
//     }
// 
// 
//     public void init() {
//         if (!FileUtils.isExistsFile(Constants.SHARE_PERFERENCE_FILE)) {
//             SharePerferenceModel model = new SharePerferenceModel();
//             model.setTypeHourPower(Constants.TALKING_HALF_AN_HOUR);
//             DateModel startTimeModel = new DateModel();
//             startTimeModel.setTime(12, 31);
//             DateModel stopTimeModel = new DateModel();
//             stopTimeModel.setTime(14, 31);
//             model.setStartHourPowerTime(startTimeModel);
//             model.setStopHourPowerTime(stopTimeModel);
//             model.setCity(getString(R.string.shenzhen));
//             model.save();
//         }
//     }
// 
//     public static Context getContext() {
//         return ClockApplication.getInstance().getApplicationContext();
//     }
// 
//     public BusinessService getBusinessService() {
//         return mBusinessService;
//     }
// 
//     private MainActivity mMainActivity;
// 
//     public void setMainActivity(MainActivity mainActivity) {
//         this.mMainActivity = mainActivity;
//     }
// 
//     public MainActivity getMainActivity() {
//         return mMainActivity;
//     }
// 
// }
// 
// Path: app/src/main/java/clock/socoolby/com/clock/ActivateAdmin.java
// public class ActivateAdmin extends DeviceAdminReceiver {
// 
// }


import android.app.Activity;
import android.app.ActivityManager;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import android.os.SystemClock;
import android.view.Window;
import android.view.WindowManager;
import java.util.List;
import clock.socoolby.com.clock.ClockApplication;
import clock.socoolby.com.clock.ActivateAdmin;
package clock.socoolby.com.clock.utils;




public class ScreenManager {
    public static boolean isScreenOn() {
        PowerManager pm = (PowerManager) ClockApplication.getContext().getSystemService(Activity.POWER_SERVICE);
        return pm.isScreenOn();
    }

    public static void turnScreenOff() {
        PowerManager pm = (PowerManager) ClockApplication.getContext().getSystemService(Activity.POWER_SERVICE);
        pm.goToSleep(SystemClock.uptimeMillis());
    }

    public static void systemLock(Activity context) {
        DevicePolicyManager policyManager;
        ComponentName componentName;
        policyManager = (DevicePolicyManager) context.getSystemService(Activity.DEVICE_POLICY_SERVICE);

// Path: app/src/main/java/clock/socoolby/com/clock/ClockApplication.java
// public class ClockApplication extends Application {
// 
//     private static ClockApplication sEndzoneBoxApp;
//     private BusinessService mBusinessService = new BusinessService();
// 
//     public static ClockApplication getInstance() {
//         return sEndzoneBoxApp;
//     }
// 
//     @Override
//     public void onCreate() {
//         sEndzoneBoxApp = this;
//         init();
//         super.onCreate();
//     }
// 
// 
//     public void init() {
//         if (!FileUtils.isExistsFile(Constants.SHARE_PERFERENCE_FILE)) {
//             SharePerferenceModel model = new SharePerferenceModel();
//             model.setTypeHourPower(Constants.TALKING_HALF_AN_HOUR);
//             DateModel startTimeModel = new DateModel();
//             startTimeModel.setTime(12, 31);
//             DateModel stopTimeModel = new DateModel();
//             stopTimeModel.setTime(14, 31);
//             model.setStartHourPowerTime(startTimeModel);
//             model.setStopHourPowerTime(stopTimeModel);
//             model.setCity(getString(R.string.shenzhen));
//             model.save();
//         }
//     }
// 
//     public static Context getContext() {
//         return ClockApplication.getInstance().getApplicationContext();
//     }
// 
//     public BusinessService getBusinessService() {
//         return mBusinessService;
//     }
// 
//     private MainActivity mMainActivity;
// 
//     public void setMainActivity(MainActivity mainActivity) {
//         this.mMainActivity = mainActivity;
//     }
// 
//     public MainActivity getMainActivity() {
//         return mMainActivity;
//     }
// 
// }
// 
// Path: app/src/main/java/clock/socoolby/com/clock/ActivateAdmin.java
// public class ActivateAdmin extends DeviceAdminReceiver {
// 
// }


// Path: app/src/main/java/clock/socoolby/com/clock/utils/ScreenManager.java
import android.app.Activity;
import android.app.ActivityManager;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import android.os.SystemClock;
import android.view.Window;
import android.view.WindowManager;
import java.util.List;
import clock.socoolby.com.clock.ClockApplication;
import clock.socoolby.com.clock.ActivateAdmin;

package clock.socoolby.com.clock.utils;




public class ScreenManager {
    public static boolean isScreenOn() {
        PowerManager pm = (PowerManager) ClockApplication.getContext().getSystemService(Activity.POWER_SERVICE);
        return pm.isScreenOn();
    }

    public static void turnScreenOff() {
        PowerManager pm = (PowerManager) ClockApplication.getContext().getSystemService(Activity.POWER_SERVICE);
        pm.goToSleep(SystemClock.uptimeMillis());
    }

    public static void systemLock(Activity context) {
        DevicePolicyManager policyManager;
        ComponentName componentName;
        policyManager = (DevicePolicyManager) context.getSystemService(Activity.DEVICE_POLICY_SERVICE);

        componentName = new ComponentName(context, ActivateAdmin.class);