// Path: app/src/main/java/me/wavever/ganklock/config/Config.java
// public class Config {
// 
//     public static final String IS_FIRST_RUN = "IS_FIRST_RUN";
// 
//     public static final String GANK_LOCK_IS_OPEN = "LOCK_IS_OPEN";
// 
//     public static final String LAST_GET_DATE = "LAST_GET_DATE";
// 
//     public static final String GET_TODAY_DATA = "GET_DATA";
// 
// }
// 
// Path: app/src/main/java/me/wavever/ganklock/receiver/GankLockReceiver.java
// public class GankLockReceiver extends BroadcastReceiver {
// 
//     private static final String TAG = GankLockReceiver.class.getSimpleName();
// 
// 
//     @Override
//     public void onReceive(Context context, Intent intent) {
//         String action = intent.getAction();
//         /*if (action.equals(Intent.ACTION_SCREEN_ON)) {
//             LockManager.createLockView();
//             onPhoneRing();
//         }*/
//         if (action.equals(Intent.ACTION_SCREEN_OFF)) {
//             Intent mLockIntent = new Intent(context, LockActivity.class);
//             mLockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
//                 | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
//             context.startActivity(mLockIntent);
//         }
//     }
// 
// 
//     public void onPhoneRing() {
//         //手机处于响铃状态
//         if (((TelephonyManager) MyApplication.getContext()
//             .getSystemService("phone")).getCallState() == TelephonyManager.CALL_STATE_IDLE) {
//         }
//     }
// 
// }
// 
// Path: app/src/main/java/me/wavever/ganklock/utils/PreferenceUtil.java
// public class PreferenceUtil {
//     private static SharedPreferences prefs;
//     private static Editor editor;
// 
// 
//     static {
//         prefs = PreferenceManager.getDefaultSharedPreferences(MyApplication.getContext());
//         editor = prefs.edit();
//     }
// 
// 
//     public static void putString(String key, String value) {
//         editor.putString(key, value).apply();
//     }
// 
// 
//     public static String getString(String key) {
//         return prefs.getString(key, "");
//     }
// 
// 
//     public static void putInt(String key, int value) {
//         editor.putInt(key, value).apply();
//     }
// 
// 
//     public static int getInt(String key,int value) {
//         return prefs.getInt(key, value);
//     }
// 
// 
//     public static void putBoolean(String key, boolean value) {
//         editor.putBoolean(key, value).apply();//apply没有返回值，commit返回值为布尔值
//     }
// 
//     public static boolean getBoolean(String key) {
//         return prefs.getBoolean(key, false);
//     }
// 
// 
//     public static boolean clear() {
//         editor.clear();
//         return editor.commit();
//     }
// 
// 
//     public static void close() {
//         prefs = null;
//     }
// }


import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
import me.wavever.ganklock.config.Config;
import me.wavever.ganklock.receiver.GankLockReceiver;
import me.wavever.ganklock.utils.PreferenceUtil;
package me.wavever.ganklock.service;


/**
 * Created by wavever on 2015/12/26.
 */
public class LockService extends Service {

    private BroadcastReceiver receiver;

    @Override
    public void onCreate() {
        super.onCreate();
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction(Intent.ACTION_SCREEN_ON);
        intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
// Path: app/src/main/java/me/wavever/ganklock/config/Config.java
// public class Config {
// 
//     public static final String IS_FIRST_RUN = "IS_FIRST_RUN";
// 
//     public static final String GANK_LOCK_IS_OPEN = "LOCK_IS_OPEN";
// 
//     public static final String LAST_GET_DATE = "LAST_GET_DATE";
// 
//     public static final String GET_TODAY_DATA = "GET_DATA";
// 
// }
// 
// Path: app/src/main/java/me/wavever/ganklock/receiver/GankLockReceiver.java
// public class GankLockReceiver extends BroadcastReceiver {
// 
//     private static final String TAG = GankLockReceiver.class.getSimpleName();
// 
// 
//     @Override
//     public void onReceive(Context context, Intent intent) {
//         String action = intent.getAction();
//         /*if (action.equals(Intent.ACTION_SCREEN_ON)) {
//             LockManager.createLockView();
//             onPhoneRing();
//         }*/
//         if (action.equals(Intent.ACTION_SCREEN_OFF)) {
//             Intent mLockIntent = new Intent(context, LockActivity.class);
//             mLockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
//                 | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
//             context.startActivity(mLockIntent);
//         }
//     }
// 
// 
//     public void onPhoneRing() {
//         //手机处于响铃状态
//         if (((TelephonyManager) MyApplication.getContext()
//             .getSystemService("phone")).getCallState() == TelephonyManager.CALL_STATE_IDLE) {
//         }
//     }
// 
// }
// 
// Path: app/src/main/java/me/wavever/ganklock/utils/PreferenceUtil.java
// public class PreferenceUtil {
//     private static SharedPreferences prefs;
//     private static Editor editor;
// 
// 
//     static {
//         prefs = PreferenceManager.getDefaultSharedPreferences(MyApplication.getContext());
//         editor = prefs.edit();
//     }
// 
// 
//     public static void putString(String key, String value) {
//         editor.putString(key, value).apply();
//     }
// 
// 
//     public static String getString(String key) {
//         return prefs.getString(key, "");
//     }
// 
// 
//     public static void putInt(String key, int value) {
//         editor.putInt(key, value).apply();
//     }
// 
// 
//     public static int getInt(String key,int value) {
//         return prefs.getInt(key, value);
//     }
// 
// 
//     public static void putBoolean(String key, boolean value) {
//         editor.putBoolean(key, value).apply();//apply没有返回值，commit返回值为布尔值
//     }
// 
//     public static boolean getBoolean(String key) {
//         return prefs.getBoolean(key, false);
//     }
// 
// 
//     public static boolean clear() {
//         editor.clear();
//         return editor.commit();
//     }
// 
// 
//     public static void close() {
//         prefs = null;
//     }
// }


// Path: app/src/main/java/me/wavever/ganklock/service/LockService.java
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
import me.wavever.ganklock.config.Config;
import me.wavever.ganklock.receiver.GankLockReceiver;
import me.wavever.ganklock.utils.PreferenceUtil;

package me.wavever.ganklock.service;


/**
 * Created by wavever on 2015/12/26.
 */
public class LockService extends Service {

    private BroadcastReceiver receiver;

    @Override
    public void onCreate() {
        super.onCreate();
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction(Intent.ACTION_SCREEN_ON);
        intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
        receiver = new GankLockReceiver();