diff options
author | likaid <likaid@codeaurora.org> | 2015-09-15 17:04:00 +0800 |
---|---|---|
committer | likaid <likaid@codeaurora.org> | 2015-09-21 10:16:33 +0800 |
commit | c70d966b798508275001215b50ea9e74f3688eb7 (patch) | |
tree | 0884a8e2378db2c6df834ab8e5159d546186528b /src/com/android/camera/CameraActivity.java | |
parent | 465c11e451e18b7f3e8109fdbbc56b866f7f8a56 (diff) | |
download | android_packages_apps_Snap-c70d966b798508275001215b50ea9e74f3688eb7.tar.gz android_packages_apps_Snap-c70d966b798508275001215b50ea9e74f3688eb7.tar.bz2 android_packages_apps_Snap-c70d966b798508275001215b50ea9e74f3688eb7.zip |
SnapDragonCamera: make exit smooth in landscape mode
In landscape mode, the system will change the display config to
portrait, so the SurfaceView should destroy first, then close
the camera device.
As user press back key for exit camera, set the screen to
portrait first, then close the camera device.
CRs-Fixed: 890573
Change-Id: I01c5ed11aea00be6809231b704fb3b2514c20c84
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index 69a1182b0..3f723a667 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -110,6 +110,7 @@ import com.android.camera.util.IntentHelper; import com.android.camera.util.PhotoSphereHelper; import com.android.camera.util.PhotoSphereHelper.PanoramaViewHelper; import com.android.camera.util.UsageStatistics; +import com.android.internal.view.RotationPolicy; import org.codeaurora.snapcam.R; import java.io.File; @@ -1755,6 +1756,12 @@ public class CameraActivity extends Activity if (mCurrentModule.onKeyDown(keyCode, event)) { return true; } + // add for stop rotate for exit camera + if(keyCode == KeyEvent.KEYCODE_BACK && + RotationPolicy.isRotationSupported(this)) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + RotationPolicy.setRotationLock(this,true); + } // Prevent software keyboard or voice search from showing up. if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_MENU) { |