diff options
| author | Owen Lin <owenlin@google.com> | 2012-07-05 17:06:56 +0800 |
|---|---|---|
| committer | Owen Lin <owenlin@google.com> | 2012-07-05 17:06:56 +0800 |
| commit | fe9989a9a58d5ef883099ef747625aca0232df35 (patch) | |
| tree | ce1be358193776155593207f53818cb7317d97b2 /src/com/android | |
| parent | 88097d4175d44c4c08af4e8652df6dff458aeff1 (diff) | |
| download | android_packages_apps_Gallery2-fe9989a9a58d5ef883099ef747625aca0232df35.tar.gz android_packages_apps_Gallery2-fe9989a9a58d5ef883099ef747625aca0232df35.tar.bz2 android_packages_apps_Gallery2-fe9989a9a58d5ef883099ef747625aca0232df35.zip | |
Don't test the EXTRA_LOCAL_ONLY before HC.
Change-Id: Idebb2aba994e38cf7eead795f1834ff98eaec27d
Diffstat (limited to 'src/com/android')
| -rw-r--r-- | src/com/android/gallery3d/ui/CustomMenu.java | 6 | ||||
| -rw-r--r-- | src/com/android/gallery3d/util/GalleryUtils.java | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/com/android/gallery3d/ui/CustomMenu.java b/src/com/android/gallery3d/ui/CustomMenu.java index dd8e6abc4..15b3dc2c2 100644 --- a/src/com/android/gallery3d/ui/CustomMenu.java +++ b/src/com/android/gallery3d/ui/CustomMenu.java @@ -25,8 +25,6 @@ import android.widget.Button; import android.widget.PopupMenu; import android.widget.PopupMenu.OnMenuItemClickListener; -import com.android.gallery3d.R; - import java.util.ArrayList; public class CustomMenu implements OnMenuItemClickListener { @@ -46,6 +44,7 @@ public class CustomMenu implements OnMenuItemClickListener { mPopupMenu.getMenuInflater().inflate(menuId, mMenu); mPopupMenu.setOnMenuItemClickListener(listener); mButton.setOnClickListener(new OnClickListener() { + @Override public void onClick(View v) { mPopupMenu.show(); } @@ -61,8 +60,6 @@ public class CustomMenu implements OnMenuItemClickListener { } } - - private Context mContext; private ArrayList<DropDownMenu> mMenus; private OnMenuItemClickListener mListener; @@ -82,6 +79,7 @@ public class CustomMenu implements OnMenuItemClickListener { mListener = listener; } + @Override public boolean onMenuItemClick(MenuItem item) { if (mListener != null) { return mListener.onMenuItemClick(item); 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; |
