summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/Camera.java2
-rw-r--r--src/com/android/camera/MenuHelper.java10
-rw-r--r--src/com/android/camera/RotateImageView.java12
-rw-r--r--src/com/android/camera/Util.java9
4 files changed, 7 insertions, 26 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index 521bbdb..6cfd06d 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -958,7 +958,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
} catch (IOException e) {
return false;
} finally {
- MenuHelper.closeSilently(f);
+ Util.closeSilently(f);
}
return true;
}
diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java
index a90726b..39fd0b2 100644
--- a/src/com/android/camera/MenuHelper.java
+++ b/src/com/android/camera/MenuHelper.java
@@ -74,16 +74,6 @@ public class MenuHelper {
private static final String CAMERA_CLASS = "com.android.camera.Camera";
private static final String VIDEO_CAMERA_CLASS = "com.android.camera.VideoCamera";
- public static void closeSilently(Closeable c) {
- if (c != null) {
- try {
- c.close();
- } catch (Throwable e) {
- // ignore
- }
- }
- }
-
public static void confirmAction(Context context, String title,
String message, final Runnable action) {
OnClickListener listener = new OnClickListener() {
diff --git a/src/com/android/camera/RotateImageView.java b/src/com/android/camera/RotateImageView.java
index 57a7f13..531169b 100644
--- a/src/com/android/camera/RotateImageView.java
+++ b/src/com/android/camera/RotateImageView.java
@@ -174,9 +174,9 @@ public class RotateImageView extends ImageView {
} catch (IOException e) {
return false;
} finally {
- MenuHelper.closeSilently(f);
- MenuHelper.closeSilently(b);
- MenuHelper.closeSilently(d);
+ Util.closeSilently(f);
+ Util.closeSilently(b);
+ Util.closeSilently(d);
}
return true;
}
@@ -198,9 +198,9 @@ public class RotateImageView extends ImageView {
} catch (IOException e) {
return false;
} finally {
- MenuHelper.closeSilently(f);
- MenuHelper.closeSilently(b);
- MenuHelper.closeSilently(d);
+ Util.closeSilently(f);
+ Util.closeSilently(b);
+ Util.closeSilently(d);
}
return true;
}
diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java
index f2350d0..6017d45 100644
--- a/src/com/android/camera/Util.java
+++ b/src/com/android/camera/Util.java
@@ -158,15 +158,6 @@ public class Util {
}
}
- public static <T> int indexOf(T [] array, T s) {
- for (int i = 0; i < array.length; i++) {
- if (array[i].equals(s)) {
- return i;
- }
- }
- return -1;
- }
-
public static void closeSilently(Closeable c) {
if (c == null) return;
try {