There is no way to prevent that.
Screen lock or CPU lock has nothing to do with visibility state. User
is always allowed to press home to hide the app and press the hardware
sleep/power key to turn off the screen.
Screen lock simply stops system app from automatically turning off the
screen, e.g. for video/monitoring app.
CPU lock simply stop the phone from suspending JavaScript execution
cycles when the screen is asleep.
Maybe we should decouple visibility state and OOM when the screen is
turned off, and keep the original OOM scores? Not sure how hard it
would be for platform to implement.
(Didn't realize there is a thread here so I am copying my
https://bugzilla.mozilla.org/show_bug.cgi?id=963917#c81)
--
Tim Guan-tin Chien, Engineering Manager and Front-end Lead, Firefox
OS, Mozilla Corp. (Taiwan)