summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlikaid <likaid@codeaurora.org>2015-04-17 16:31:41 +0800
committerSteve Kondik <steve@cyngn.com>2016-07-30 05:05:25 -0700
commit828954c631f980ce16e451a3f6b907f810cdf8d7 (patch)
tree666d0830ef5b2fc309e6b986f02622f83ed76069
parent2428156332b92a090e86444b6fd17ab4b33bd80f (diff)
downloadandroid_packages_apps_Snap-828954c631f980ce16e451a3f6b907f810cdf8d7.zip
android_packages_apps_Snap-828954c631f980ce16e451a3f6b907f810cdf8d7.tar.gz
android_packages_apps_Snap-828954c631f980ce16e451a3f6b907f810cdf8d7.tar.bz2
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 b7e2f8e..8a091de 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -19,7 +19,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;
@@ -198,7 +197,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";
@@ -828,16 +826,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.
@@ -851,8 +839,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
@@ -885,7 +871,6 @@ public class PhotoModule
mUI.showSwitcher();
}
mUI.initializeSecondTime(mParameters);
- keepMediaProviderInstance();
}
private void showTapToFocusToastIfNeeded() {
@@ -2029,12 +2014,7 @@ public class PhotoModule
}
@Override
- public void onStop() {
- if (mMediaProviderClient != null) {
- mMediaProviderClient.release();
- mMediaProviderClient = null;
- }
- }
+ public void onStop() {}
@Override
public void onCaptureCancelled() {