summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriele M <moto.falcon.git@gmail.com>2017-03-26 12:13:09 +0200
committerArne Coucheron <arco68@gmail.com>2018-01-27 00:41:41 +0100
commitf4a2adc4555e1cca168e723f1f7f415de08e4c68 (patch)
tree7fd5fd263b75ab8b31b792eadad4b46aa164f1a2
parent27371b3fbcb25d8be26e6a84b12871d0ed20f6ea (diff)
downloadandroid_packages_apps_Snap-f4a2adc4555e1cca168e723f1f7f415de08e4c68.zip
android_packages_apps_Snap-f4a2adc4555e1cca168e723f1f7f415de08e4c68.tar.gz
android_packages_apps_Snap-f4a2adc4555e1cca168e723f1f7f415de08e4c68.tar.bz2
Always apply frame size reduction to panorama pictures
Panorama mode requires quite some memory, especially after the frame num bump done with commit aa0733567c30 ("Make panorama able to go 270 degrees in landscape"). Some devices run out of memory while taking a panorama picture and force close Snap before the picture is complete. We have a config to reduce the memory requirements that reduces the size of each frame, but it's applied only if ro.config.low_ram is true. Bump the default value to 100 and always respect it. Devices having ro.config.low_ram set to true will have to override this config from their device tree. BUGBASH-326 Change-Id: Ic6d24b17b2293adf8d715904c8c1874a4c624e99
-rw-r--r--res/values/config.xml2
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java8
2 files changed, 2 insertions, 8 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index a02c6b7..422fb21 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -22,7 +22,7 @@
<!-- This value may be tweaked to save memory on low RAM devices. The value
is the percentage of camera preview height/width to scale to. -->
- <integer name="panorama_frame_size_reduction">90</integer>
+ <integer name="panorama_frame_size_reduction">100</integer>
<!-- This value may be changed to true to enable the warped pano preview overlayed on top
of the fullscreen pano preview. -->
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index c745248..be68e20 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -16,7 +16,6 @@
package com.android.camera;
-import android.app.ActivityManager;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@@ -915,12 +914,7 @@ public class WideAnglePanoramaModule
return;
}
- int perct = 100;
- final ActivityManager am = (ActivityManager)
- mActivity.getSystemService(Context.ACTIVITY_SERVICE);
- if (am.isLowRamDevice()) {
- perct = mActivity.getResources().getInteger(R.integer.panorama_frame_size_reduction);
- }
+ int perct = mActivity.getResources().getInteger(R.integer.panorama_frame_size_reduction);
int width = (mCameraPreviewWidth * perct) / 100;
int height = (mCameraPreviewHeight * perct) / 100;