summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzfu <zfu@codeaurora.org>2016-03-07 15:14:53 +0800
committerSteve Kondik <steve@cyngn.com>2016-08-03 15:45:46 -0700
commit5bb6fe377c000e4287432518080968344583357a (patch)
tree152976f92ae48f88ba30ac3101efa7b68f2a7be6
parentc58924a30bda333137f5b9d808c9e6bb2e004a8f (diff)
downloadandroid_packages_apps_Snap-5bb6fe377c000e4287432518080968344583357a.zip
android_packages_apps_Snap-5bb6fe377c000e4287432518080968344583357a.tar.gz
android_packages_apps_Snap-5bb6fe377c000e4287432518080968344583357a.tar.bz2
Fix android.process.media got killed when capture
android.process.media 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
-rw-r--r--src/com/android/camera/CameraActivity.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 186fa51..a9a78e7 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -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
getContentResolver().unregisterContentObserver(mLocalVideosObserver);
unregisterReceiver(mSDcardMountedReceiver);
+ mCursor.close();
+ mCursor=null;
super.onDestroy();
}