From 523432315cea8f18d703a0d547b4614ce42b6918 Mon Sep 17 00:00:00 2001 From: Chih-Chung Chang Date: Tue, 20 Apr 2010 18:07:15 +0800 Subject: Don't stop user from taking pictures while the media scanner is scanning. Bug: 2603078 Change-Id: Ic2159201434083919d7f7bc6b1ea2f3438971ebd --- src/com/android/camera/Camera.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 9449249..056376e 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -515,8 +515,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, String action = intent.getAction(); if (action.equals(Intent.ACTION_MEDIA_MOUNTED) || action.equals(Intent.ACTION_MEDIA_UNMOUNTED) - || action.equals(Intent.ACTION_MEDIA_CHECKING) - || action.equals(Intent.ACTION_MEDIA_SCANNER_STARTED)) { + || action.equals(Intent.ACTION_MEDIA_CHECKING)) { checkStorage(); } else if (action.equals(Intent.ACTION_MEDIA_SCANNER_FINISHED)) { checkStorage(); @@ -1010,11 +1009,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, } private void checkStorage() { - if (ImageManager.isMediaScannerScanning(getContentResolver())) { - mPicturesRemaining = MenuHelper.NO_STORAGE_ERROR; - } else { - calculatePicturesRemaining(); - } + calculatePicturesRemaining(); updateStorageHint(mPicturesRemaining); } @@ -1161,8 +1156,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, if (remaining == MenuHelper.NO_STORAGE_ERROR) { String state = Environment.getExternalStorageState(); - if (state == Environment.MEDIA_CHECKING || - ImageManager.isMediaScannerScanning(getContentResolver())) { + if (state == Environment.MEDIA_CHECKING) { noStorageText = getString(R.string.preparing_sd); } else { noStorageText = getString(R.string.no_storage); @@ -1189,7 +1183,6 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MEDIA_MOUNTED); intentFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED); - intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED); intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED); intentFilter.addAction(Intent.ACTION_MEDIA_CHECKING); intentFilter.addDataScheme("file"); -- cgit v1.1