summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlikaid <likaid@codeaurora.org>2015-04-17 16:31:41 +0800
committerlikaid <likaid@codeaurora.org>2015-04-17 16:31:41 +0800
commit470636359402f05bbbacb074d5fdac3bf073b344 (patch)
tree2864b71d5f5ef4a31f62af474db24dc3dc6c336f
parent0202eb424a9f8dfe472b6cfbf35b88f3fdacd025 (diff)
downloadandroid_packages_apps_Snap-470636359402f05bbbacb074d5fdac3bf073b344.tar.gz
android_packages_apps_Snap-470636359402f05bbbacb074d5fdac3bf073b344.tar.bz2
android_packages_apps_Snap-470636359402f05bbbacb074d5fdac3bf073b344.zip
SnapdragonCamera: Fix app auto close when repeat plug in/out USB cable
When the system try to unmount SDcard, it will kill the process which hold the instance of media provider. When camera is in idle state, do not keep the media provider instance. Change-Id: Ie1edf2397544e613435f0930dba73da9660616cd CRs-Fixed: 823334
-rw-r--r--src/com/android/camera/PhotoModule.java22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index e2fc34b0c..95bebe181 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -18,7 +18,6 @@ package com.android.camera;
import android.annotation.TargetApi;
import android.app.Activity;
-import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@@ -204,7 +203,6 @@ public class PhotoModule
private static final String sTempCropFilename = "crop-temp";
- private ContentProviderClient mMediaProviderClient;
private boolean mFaceDetectionStarted = false;
private static final String PERSIST_LONG_ENABLE = "persist.camera.longshot.enable";
@@ -806,16 +804,6 @@ public class PhotoModule
Toast.LENGTH_SHORT).show();
}
- private void keepMediaProviderInstance() {
- // We want to keep a reference to MediaProvider in camera's lifecycle.
- // TODO: Utilize mMediaProviderClient instance to replace
- // ContentResolver calls.
- if (mMediaProviderClient == null) {
- mMediaProviderClient = mContentResolver
- .acquireContentProviderClient(MediaStore.AUTHORITY);
- }
- }
-
// Snapshots can only be taken after this is called. It should be called
// once only. We could have done these things in onCreate() but we want to
// make preview screen appear as soon as possible.
@@ -829,8 +817,6 @@ public class PhotoModule
mPreferences, mContentResolver);
mLocationManager.recordLocation(recordLocation);
- keepMediaProviderInstance();
-
mUI.initializeFirstTime();
MediaSaveService s = mActivity.getMediaSaveService();
// We set the listener only when both service and shutterbutton
@@ -871,7 +857,6 @@ public class PhotoModule
mUI.showSwitcher();
}
mUI.initializeSecondTime(mParameters);
- keepMediaProviderInstance();
}
private void showTapToFocusToastIfNeeded() {
@@ -1910,12 +1895,7 @@ public class PhotoModule
}
@Override
- public void onStop() {
- if (mMediaProviderClient != null) {
- mMediaProviderClient.release();
- mMediaProviderClient = null;
- }
- }
+ public void onStop() {}
@Override
public void onCaptureCancelled() {