Ok, I got an answer that satisfies me:
public void onReceive(Context context, Intent intent) { KeyguardManager kg = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); Boolean screenBlocked = !kg.inKeyguardRestrictedInputMode(); Log.w(TAG, "Screen lock is " + screenBlocked.toString());
This solution gives information if the screen is locked. And, in my case, enough - when the screen is locked during an incoming call - this means that there was no user.
jacek source share