path: root/src
diff options
authorzfu <>2016-03-07 15:14:53 +0800
committerSteve Kondik <>2016-08-03 15:45:46 -0700
commit5bb6fe377c000e4287432518080968344583357a (patch)
tree152976f92ae48f88ba30ac3101efa7b68f2a7be6 /src
parentc58924a30bda333137f5b9d808c9e6bb2e004a8f (diff)
Fix got killed when capture has a very low priority as Cached app in background. When snapdragon camera using ContentResolver and do query/updating it will promot to foreground priority, but there may have some race condition that lmk in the progress to kill media, and AMS want set to foreground. So, keep this process as foreground during the whole ActivityLife time, by hold a query cursor onCreate and destory onStop. CRs-Fixed: 984061 Change-Id: I530fddfa240030ad84dc09b599ad783f6a2f21e0
Diffstat (limited to 'src')
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/camera/ b/src/com/android/camera/
index 186fa51..a9a78e7 100644
--- a/src/com/android/camera/
+++ b/src/com/android/camera/
@@ -252,6 +252,7 @@ public class CameraActivity extends Activity
// FilmStripView.setDataAdapter fires 2 onDataLoaded calls before any data is actually loaded
// Keep track of data request here to avoid creating useless UpdateThumbnailTask.
private boolean mDataRequested;
+ private Cursor mCursor;
private WakeLock mWakeLock;
private Context mContext;
@@ -1437,6 +1438,8 @@ public class CameraActivity extends Activity
mSecureCamera = intent.getBooleanExtra(SECURE_CAMERA_EXTRA, false);
+ mCursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, null);
if (mSecureCamera) {
// Change the window flags so that secure camera can show when locked
Window win = getWindow();
@@ -1757,6 +1760,8 @@ public class CameraActivity extends Activity
+ mCursor.close();
+ mCursor=null;