top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Disabling screen wakeup with charger status change in android

+2 votes
264 views

I've been looking through the sources trying to figure out where it wakes up the screen when I connect and disconnect the charger. Please suggest some hint? I thought it might be NfcService, but I "froze" that service and it still wakes the screen.

posted Jul 29, 2013 by Amit Parthsarthi

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+4 votes

I am having trouble with showing up fragments on orientation change. I have 2 fragments, one fragment handles the portrait mode and the another handles landscape mode. But the problem is that when I rotate from portrait to landscape then back to portrait again. It doesn't show the portrait fragment properly.

+2 votes

Hi I want to record my screen and save as video file in Android. Note: I don't need the code to work in old versions (I need for Jelly bean and later versions) of android.

Thanks in advance!

+1 vote

How to create an application like button savior that display a button or a group of buttons on the screen when we turn them on PERMANENTLY. I tried to found solution for it but i failed. Please provide the solution for it or any example

+3 votes

After using SCREEN_ON SCREEN_OFF broadcast receiver, screen does not seem to switch off automatically as it used to for default android app.

None of the code commented below works for Android 4.4.2 (API 19 onward)

int time = android.provider.Settings.System.getInt(context.getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, Integer.MAX_VALUE);
// Toast.makeText(context, "Screen Time out is "+new Date(lastTimeScreenOn+15000) + ", lastTimeScreenOn = "+new Date(lastTimeScreenOn), Toast.LENGTH_SHORT).show();
// screen off if more than 15 sec
if(System.currentTimeMillis() - lastTimeScreenOn > 15000)
 {
      Toast.makeText(context, "Screen Time out ", Toast.LENGTH_LONG).show();
      //DevicePolicyManager mDPM = (DevicePolicyManager)context.getSystemService(Context.DEVICE_POLICY_SERVICE);
      //mDPM.lockNow();
      //Settings.System.putInt(context.getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, 1000);
 }
...