summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/data/MediaObject.java
diff options
context:
space:
mode:
authorMangesh Ghiware <mghiware@google.com>2012-10-10 18:37:24 -0700
committerMangesh Ghiware <mghiware@google.com>2012-10-11 15:21:29 -0700
commit83e7d70bccd93c348d70048e1add3cc1c4ac33c6 (patch)
tree7b5fb42a67c7e93528c538a726c7585bbfb861b4 /src/com/android/gallery3d/data/MediaObject.java
parent1ac23d436d226a926adc5685b8cf30a32a0afea7 (diff)
downloadandroid_packages_apps_Snap-83e7d70bccd93c348d70048e1add3cc1c4ac33c6.tar.gz
android_packages_apps_Snap-83e7d70bccd93c348d70048e1add3cc1c4ac33c6.tar.bz2
android_packages_apps_Snap-83e7d70bccd93c348d70048e1add3cc1c4ac33c6.zip
Move calls to LightCycleHelper off the UI thread.
Bug: 7320303 Replace multiple methods in LightCycleHelper with a single one that returns relevant metadata. Change-Id: Iaa75b3c1ccc8a5b724b253cec654b5b5acb4878e
Diffstat (limited to 'src/com/android/gallery3d/data/MediaObject.java')
-rw-r--r--src/com/android/gallery3d/data/MediaObject.java33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/com/android/gallery3d/data/MediaObject.java b/src/com/android/gallery3d/data/MediaObject.java
index a16b9666d..382a5c792 100644
--- a/src/com/android/gallery3d/data/MediaObject.java
+++ b/src/com/android/gallery3d/data/MediaObject.java
@@ -18,6 +18,8 @@ package com.android.gallery3d.data;
import android.net.Uri;
+import com.android.gallery3d.util.ThreadPool;
+
public abstract class MediaObject {
@SuppressWarnings("unused")
private static final String TAG = "MediaObject";
@@ -37,14 +39,20 @@ public abstract class MediaObject {
public static final int SUPPORT_INFO = 1 << 10;
public static final int SUPPORT_IMPORT = 1 << 11;
public static final int SUPPORT_TRIM = 1 << 12;
- public static final int SUPPORT_PANORAMA = 1 << 13;
- public static final int SUPPORT_PANORAMA360 = 1 << 14;
- public static final int SUPPORT_UNLOCK = 1 << 15;
- public static final int SUPPORT_BACK = 1 << 16;
- public static final int SUPPORT_ACTION = 1 << 17;
- public static final int SUPPORT_CAMERA_SHORTCUT = 1 << 18;
+ public static final int SUPPORT_UNLOCK = 1 << 13;
+ public static final int SUPPORT_BACK = 1 << 14;
+ public static final int SUPPORT_ACTION = 1 << 15;
+ public static final int SUPPORT_CAMERA_SHORTCUT = 1 << 16;
+ // The panorama specific bits are expensive to compute.
+ // Use SupportedOperationsListener to request them.
+ public static final int SUPPORT_PANORAMA = 1 << 30;
+ public static final int SUPPORT_PANORAMA360 = 1 << 31;
public static final int SUPPORT_ALL = 0xffffffff;
+ public static interface SupportedOperationsListener {
+ public void onChange(int operations);
+ }
+
// These are the bits returned from getMediaType():
public static final int MEDIA_TYPE_UNKNOWN = 1;
public static final int MEDIA_TYPE_IMAGE = 2;
@@ -72,6 +80,11 @@ public abstract class MediaObject {
protected final Path mPath;
+ private static ThreadPool sThreadPool = new ThreadPool(1, 1);
+ public static ThreadPool getThreadPool() {
+ return sThreadPool;
+ }
+
public MediaObject(Path path, long version) {
path.setObject(this);
mPath = path;
@@ -86,6 +99,14 @@ public abstract class MediaObject {
return 0;
}
+ public int getSupportedOperations(boolean getAll) {
+ return 0;
+ }
+
+ public void setSupportedOperationsListener(SupportedOperationsListener l) {
+ // nothing to do
+ }
+
public void delete() {
throw new UnsupportedOperationException();
}