Sensor-based Power Management for mobile devices