Hi everyone ..
i´m using cruserlite flip case which could lock and unlock moto g with magnetic sensor as the original flip case from motorola does.
Anyway... if i´m going to install a non stock rom i lost the funtionality to lock device with magnetic sensor.
I found a app that does this job ..so for everyone who had the same issue as me ... give it a try
PS: Right now i could not say how much this app drains battery...