Back to project page UnlockCounter.
The source code is released under:
MIT License
If you think the Android project UnlockCounter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.vaya.unlockcounter; // ww w.j a v a 2 s .c o m import android.app.Service; import android.content.BroadcastReceiver; import android.content.Intent; import android.content.IntentFilter; import android.os.IBinder; import android.util.Log; public class LockerService extends Service { public static final String LOG_TAG = "UC_SERVICE"; public IBinder onBind(Intent intent) { return null; } @Override public void onCreate() { super.onCreate(); Log.d(LOG_TAG, "Service started"); IntentFilter filter = new IntentFilter(Intent.ACTION_USER_PRESENT); filter.addAction(Intent.ACTION_SCREEN_OFF); BroadcastReceiver mReceiver = new BroadReceiver(); registerReceiver(mReceiver, filter); } @Override public void onDestroy() { super.onDestroy(); Log.d(LOG_TAG, "Service exited"); } }