1) Open /sys/power/state and write "on". If this doesn't return an error, use early suspend.
2) Else open /sys/power/autosleep. If this is successful, use autosleep.
3) Else attempt to use the legacy PM interfaces (I won't go into detail).
4) Else fail
So I guess powerd should do similar to be compatible. It's still nonsensical to have an autosleep file which doesn't work, but I guess the reality is that this works okay with Android.
Okay, it looks like Android does it this way:
1) Open /sys/power/state and write "on". If this doesn't return an error, use early suspend. autosleep. If this is successful, use autosleep.
2) Else open /sys/power/
3) Else attempt to use the legacy PM interfaces (I won't go into detail).
4) Else fail
So I guess powerd should do similar to be compatible. It's still nonsensical to have an autosleep file which doesn't work, but I guess the reality is that this works okay with Android.
References:
https:/ /android. googlesource. com/platform/ system/ core/+/ android- 4.4.2_r2/ libsuspend/ autosuspend. c /android. googlesource. com/platform/ system/ core/+/ android- 4.4.2_r2/ libsuspend/ autosuspend_ earlysuspend. c /android. googlesource. com/platform/ system/ core/+/ android- 4.4.2_r2/ libsuspend/ autosuspend_ autosleep. c /android. googlesource. com/platform/ system/ core/+/ android- 4.4.2_r2/ libsuspend/ autosuspend_ wakeup_ count.c
https:/
https:/
https:/