Implementation of device rotation.