From b98ecd613b64dff8b025ba14fc017ed6ccb191ab Mon Sep 17 00:00:00 2001 From: Owen Lin Date: Thu, 5 Jul 2012 17:06:56 +0800 Subject: Don't test the EXTRA_LOCAL_ONLY before HC. Change-Id: Idebb2aba994e38cf7eead795f1834ff98eaec27d --- src/com/android/gallery3d/util/GalleryUtils.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/com/android/gallery3d/util/GalleryUtils.java') diff --git a/src/com/android/gallery3d/util/GalleryUtils.java b/src/com/android/gallery3d/util/GalleryUtils.java index 1291ee9f7..05198f41b 100644 --- a/src/com/android/gallery3d/util/GalleryUtils.java +++ b/src/com/android/gallery3d/util/GalleryUtils.java @@ -16,6 +16,7 @@ package com.android.gallery3d.util; +import android.annotation.TargetApi; import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; @@ -35,6 +36,7 @@ import android.view.WindowManager; import com.android.gallery3d.R; import com.android.gallery3d.app.PackagesMonitor; +import com.android.gallery3d.common.ApiHelper; import com.android.gallery3d.data.DataManager; import com.android.gallery3d.data.MediaItem; import com.android.gallery3d.util.ThreadPool.CancelListener; @@ -288,6 +290,7 @@ public class GalleryUtils { return durationValue; } + @TargetApi(ApiHelper.VERSION_CODES.HONEYCOMB) public static int determineTypeBits(Context context, Intent intent) { int typeBits = 0; String type = intent.resolveType(context); @@ -304,8 +307,10 @@ public class GalleryUtils { typeBits = DataManager.INCLUDE_ALL; } - if (intent.getBooleanExtra(Intent.EXTRA_LOCAL_ONLY, false)) { - typeBits |= DataManager.INCLUDE_LOCAL_ONLY; + if (ApiHelper.HAS_INTENT_EXTRA_LOCAL_ONLY) { + if (intent.getBooleanExtra(Intent.EXTRA_LOCAL_ONLY, false)) { + typeBits |= DataManager.INCLUDE_LOCAL_ONLY; + } } return typeBits; -- cgit v1.2.3