Added logic for #273 to stop screen rotation during refresh