Reputation: 4004
We have written a test app to try and debug a issue with a 3rd party by reproducing the issues with our own source code.
The app has a feature to allow us to set times for when the devices switches off then on. This is to comply with green power saving policies.
The app switches the device off fine, but on switch on, we hear a 'click' at the expected time, but the display remains off. We wrote a test app and found this works well on other Android devices, but on the problem device we get the same - just the sound of the power relay clicking on, but nothing else.
We are wondering if this is something to do with a system setting on the devices that controls this behaviour.
The code to switch on is as follows:
public void wakeupTimer(){
new CountDownTimer(wakeupTime * 1000, 1000) {
public void onTick(long millisUntilFinished) {
textTimer.setText("0:"+checkDigit(wakeupTime));
wakeupTime--;
}
public void onFinish() {
PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wakeLock = pm.newWakeLock(( PowerManager.FULL_WAKE_LOCK
| PowerManager.ON_AFTER_RELEASE
| PowerManager.ACQUIRE_CAUSES_WAKEUP), "commandandcontrol:TAG");
wakeLock.acquire();
finish();
}
}.start();
}
Upvotes: 1
Views: 36