title: Android: get orientation, even if app is locked to portrait
body: <p>I'm developing an android camera api app that is locked in portrait mode in the manifest file.</p>
  
  <pre><code>android:configChanges="orientation"
  android:screenOrientation="portrait"
  </code></pre>
  
  <p>My problem is, when I store pictures, they are all stored in the same orientation.</p>
  
  <p>I would like them to be stored with the true orientation, eg. my ceiling should be at the top of the stored picture, no matter how I orient my phone, if that makes any sense </p>
  
  <p>In order to do this I have to know the orientation of the device, however it seems that when the app is locked inn portrait, all getOrientation'ish methods thinks my phone is in portrait mode, no matter the physical orientation of my phone.</p>
  
  <p>Here are the ones I've tried:</p>
  
  <pre><code>Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
  Camera.getCameraInfo(mCurrentlyUsedCamera,cameraInfo);
  Log.e("debug","orientation:"+cameraInfo.orientation);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>getResources().getConfiguration().orientation
  </code></pre>
  
  <p>and</p>
  
  <pre><code>this.getWindowManager().getDefaultDisplay().getRotation()
  </code></pre>
  
  <p>.</p>
  
  <h2>Any way of getting the true orientation in a portrait locked app?</h2>
  
  <p>.</p>