title: Find out if device orientation is locked (Detect if auto-rotate is enabled/disabled)
body: <p>How can I find out is device's screen orientation locked? I am using OrientationEventListener to trigger some actions inside my app which I would like to disable if user has his screen locked.</p>
  
  <p>I know I can usually can orientation like this but how to find out is this locked orientation:</p>
  
  <pre><code>    int orientation = getResources().getConfiguration().orientation;
  
      if (orientation == Configuration.ORIENTATION_PORTRAIT) {
          // It's portrait
      } else {
          // It's landscape
      }
  </code></pre>