diff options
author | Ray Chen <> | 2009-04-10 02:11:35 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-10 02:11:35 -0700 |
commit | 993105a927b1b67ce04cd56a597d3d6742e7c205 (patch) | |
tree | 5b99c560886ad1872332b872f0ae22ee7125d8ef /src/com/android/camera/CropImage.java | |
parent | 9dacf7b214339440c16f3d66e12d6afef1248f68 (diff) | |
download | LegacyCamera-993105a927b1b67ce04cd56a597d3d6742e7c205.zip LegacyCamera-993105a927b1b67ce04cd56a597d3d6742e7c205.tar.gz LegacyCamera-993105a927b1b67ce04cd56a597d3d6742e7c205.tar.bz2 |
AI 145696: Utilize BitmapManager to control bitmap related resources, making
decoding cancelable, thus reduce activities switch latency and gallery related ANR.
BUG=1692286
Automated import of CL 145696
Diffstat (limited to 'src/com/android/camera/CropImage.java')
-rw-r--r-- | src/com/android/camera/CropImage.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/com/android/camera/CropImage.java b/src/com/android/camera/CropImage.java index 29d857c..8bdf52d 100644 --- a/src/com/android/camera/CropImage.java +++ b/src/com/android/camera/CropImage.java @@ -53,6 +53,9 @@ import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; +/** + * The activity can crop specific region of interest from an image. + */ public class CropImage extends Activity { private static final String TAG = "CropImage"; private ProgressDialog mFaceDetectionDialog = null; @@ -164,7 +167,7 @@ public class CropImage extends Activity { startFaceDetection(); } }, 100); - } catch (Exception e) { + } catch (RuntimeException e) { Log.e(TAG, "Failed to load bitmap", e); finish(); } @@ -422,6 +425,17 @@ public class CropImage extends Activity { Thread t = new Thread(r); t.start(); } + + } + + public void onResume() { + super.onResume(); + BitmapManager.instance().allowAllDecoding(); + } + + public void onPause() { + super.onPause(); + BitmapManager.instance().cancelAllDecoding(); } Handler mHandler = new Handler(); |