I am not sure about the use case where you want to use the accelerometer under the lock screen.
Applications usually run under the lock screen when you need to do something when you are not interacting with the device. like playing music or downloading a large file.
If you need accelerometer data, I would suggest that the device is held and, therefore, supposedly looked. Given this, why do you want to run under the lock screen?
If you have good reason for this, you should still know that:
when your application runs under a locked screen, it ... should minimize energy use
(from Marketplace Certification Requirement .)
In my understanding, reading values ββfrom sensors does not minimize energy consumption.
source share