Back to project page PhoneProfiles_Eclipse.
The source code is released under:
Apache License
If you think the Android project PhoneProfiles_Eclipse 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 sk.henrichg.phoneprofiles; //from w w w . ja va 2 s . c om import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class ScreenOnOffBroadcastReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { GlobalData.logE("ScreenOnOffBroadcastReceiver.onReceive","xxx"); if (!GlobalData.getApplicationStarted(context)) // application is not started return; GlobalData.logE("ScreenOnOffBroadcastReceiver.onReceive","application started"); GlobalData.loadPreferences(context); if (intent.getAction().equals(Intent.ACTION_SCREEN_ON) || intent.getAction().equals(Intent.ACTION_USER_PRESENT)) { GlobalData.logE("ScreenOnOffBroadcastReceiver.onReceive","screen on"); // enable/disable keyguard if (Keyguard.keyguardService == null) Keyguard.keyguardService = new Intent(context.getApplicationContext(), KeyguardService.class); context.startService(Keyguard.keyguardService); } } }