package com.icaynia.pracler.lockscreen;

import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;

/**
 * Created by icaynia on 31/03/2017.
 */

public class LockScreenService extends Service
{
    public BroadcastReceiver receiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
                Intent i = new Intent(context, LockScreenActivity.class);
                i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(i);
            }
        }
    };

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_OFF);
        registerReceiver(receiver, filter);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        unregisterReceiver(receiver);
    }

}
@@ -232,16 +232,52 @@
 inder;%0A%0A
+import com.icaynia.pracler.Global;%0A%0A
 /**%0A * C
@@ -363,16 +363,43 @@
 rvice%0A%7B%0A
+    private Global global;%0A
     publ
@@ -606,19 +606,144 @@
 tion()))
+%0A           
  %7B%0A
+                // %EC%9D%8C%EC%95%85%EC%9D%B4 %EC%8B%A4%ED%96%89 %EC%A4%91%EC%9D%BC%EB%95%8C%EB%A7%8C %EC%82%AC%EC%9A%A9%ED%95%A9%EB%8B%88%EB%8B%A4.%0A                if (global.musicService.isPlaying())%0A                %7B%0A    
         
@@ -824,16 +824,20 @@
         
+    
 i.setFla
@@ -871,16 +871,20 @@
 _TASK);%0A
+    
         
@@ -917,16 +917,34 @@
 ity(i);%0A
+                %7D%0A
         
@@ -1091,24 +1091,24 @@
 nCreate() %7B%0A
-
         supe
@@ -1117,24 +1117,68 @@
 onCreate();%0A
+        global = (Global) getApplication();%0A
         Inte

Fix bugs lock screen service start lock screen activity intent when it's not playing