diff options
author | Owen Lin <owenlin@google.com> | 2009-09-23 22:27:04 +0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2009-09-24 00:50:19 +0800 |
commit | 71d56e21859a797ec4633f209b3605276345d44e (patch) | |
tree | b57629d0323ec516a2fd158ab1913e67ac307075 /src/com/android | |
parent | e15c0ad52981ba7413002b028784e09da772ec35 (diff) | |
download | LegacyCamera-71d56e21859a797ec4633f209b3605276345d44e.zip LegacyCamera-71d56e21859a797ec4633f209b3605276345d44e.tar.gz LegacyCamera-71d56e21859a797ec4633f209b3605276345d44e.tar.bz2 |
Fix some warnnings reported by eclipse.
Change-Id: I40037e0735ddbca750cbe5f8364af5247992c51c
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/camera/Camera.java | 10 | ||||
-rw-r--r-- | src/com/android/camera/CameraHardwareException.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/CameraSettings.java | 1 | ||||
-rw-r--r-- | src/com/android/camera/IconIndicator.java | 6 | ||||
-rw-r--r-- | src/com/android/camera/MenuHelper.java | 44 | ||||
-rw-r--r-- | src/com/android/camera/OnScreenSettings.java | 4 | ||||
-rw-r--r-- | src/com/android/camera/ReviewImage.java | 8 | ||||
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 1 | ||||
-rw-r--r-- | src/com/android/camera/Wallpaper.java | 1 | ||||
-rw-r--r-- | src/com/android/camera/gallery/Image.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/gallery/ImageListUber.java | 1 | ||||
-rw-r--r-- | src/com/android/camera/gallery/LruCache.java | 1 | ||||
-rw-r--r-- | src/com/android/camera/gallery/UriImage.java | 1 |
13 files changed, 10 insertions, 72 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 068ff86..f600325 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -28,7 +28,6 @@ import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; -import android.graphics.Matrix; import android.hardware.Camera.Parameters; import android.hardware.Camera.PictureCallback; import android.hardware.Camera.Size; @@ -46,7 +45,6 @@ import android.os.Handler; import android.os.Message; import android.os.SystemClock; import android.preference.PreferenceManager; -import android.preference.PreferenceScreen; import android.provider.MediaStore; import android.text.format.DateFormat; import android.util.AttributeSet; @@ -156,7 +154,7 @@ public class Camera extends Activity implements View.OnClickListener, private Uri mSaveUri; private int mMaxNumOfPixels; - private int mViewFinderWidth, mViewFinderHeight; + private int mViewFinderHeight; private ImageCapture mImageCapture = null; @@ -449,7 +447,7 @@ public class Camera extends Activity implements View.OnClickListener, zoomToLevel(ZOOM_IMMEDIATE, mZoomValue + ZOOM_STEP_MIN); // Wait for a while so we are not changing zoom too fast. try { - Thread.currentThread().sleep(5); + Thread.sleep(5); } catch (InterruptedException ex) { } } @@ -459,7 +457,7 @@ public class Camera extends Activity implements View.OnClickListener, zoomToLevel(ZOOM_IMMEDIATE, mZoomValue - ZOOM_STEP_MIN); // Wait for a while so we are not changing zoom too fast. try { - Thread.currentThread().sleep(5); + Thread.sleep(5); } catch (InterruptedException ex) { } } @@ -877,7 +875,6 @@ public class Camera extends Activity implements View.OnClickListener, win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); setContentView(R.layout.camera); mSurfaceView = (VideoPreview) findViewById(R.id.camera_preview); - mViewFinderWidth = mSurfaceView.getLayoutParams().width; mViewFinderHeight = mSurfaceView.getLayoutParams().height; mPreferences = PreferenceManager.getDefaultSharedPreferences(this); mPreferences.registerOnSharedPreferenceChangeListener(this); @@ -1441,7 +1438,6 @@ public class Camera extends Activity implements View.OnClickListener, if (mCameraDevice == null) return; mSurfaceHolder = holder; - mViewFinderWidth = w; mViewFinderHeight = h; // Sometimes surfaceChanged is called after onPause. Ignore it. diff --git a/src/com/android/camera/CameraHardwareException.java b/src/com/android/camera/CameraHardwareException.java index b6689b9..a975cbd 100644 --- a/src/com/android/camera/CameraHardwareException.java +++ b/src/com/android/camera/CameraHardwareException.java @@ -17,6 +17,8 @@ package com.android.camera; public class CameraHardwareException extends Exception { + private static final long serialVersionUID = -4453804913829319918L; + public CameraHardwareException() { } diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java index 5b6fc5b..a7f1746 100644 --- a/src/com/android/camera/CameraSettings.java +++ b/src/com/android/camera/CameraSettings.java @@ -46,6 +46,7 @@ public class CameraSettings { // MMS video length public static final int DEFAULT_VIDEO_DURATION_VALUE = -1; + @SuppressWarnings("unused") private static final String TAG = "CameraSettings"; private final Context mContext; diff --git a/src/com/android/camera/IconIndicator.java b/src/com/android/camera/IconIndicator.java index d179c9f..c3f0392 100644 --- a/src/com/android/camera/IconIndicator.java +++ b/src/com/android/camera/IconIndicator.java @@ -16,19 +16,13 @@ package com.android.camera; - import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; -import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.RectF; import android.graphics.drawable.Drawable; -import android.text.Layout; import android.util.AttributeSet; import android.widget.ImageView; - public class IconIndicator extends ImageView { private Drawable[] mIcons; diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java index 2ff473d..3fed674 100644 --- a/src/com/android/camera/MenuHelper.java +++ b/src/com/android/camera/MenuHelper.java @@ -39,7 +39,6 @@ import android.view.Menu; import android.view.MenuItem; import android.view.SubMenu; import android.view.View; -import android.view.MenuItem.OnMenuItemClickListener; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; @@ -52,7 +51,6 @@ import java.lang.ref.WeakReference; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; -import java.util.HashMap; import java.util.List; /** @@ -361,48 +359,6 @@ public class MenuHelper { } } - /** - * Returns a human-readable string describing the orientation value. Returns empty - * string if there is no orientation value or it it not recognized. - */ - private static String getOrientationString(ExifInterface exif) { - // TODO: this function needs to be localized. - int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1); - if (orientation == -1) return ""; - - String orientationString; - switch (orientation) { - case ExifInterface.ORIENTATION_NORMAL: - orientationString = "Normal"; - break; - case ExifInterface.ORIENTATION_FLIP_HORIZONTAL: - orientationString = "Flipped horizontal"; - break; - case ExifInterface.ORIENTATION_ROTATE_180: - orientationString = "Rotated 180 degrees"; - break; - case ExifInterface.ORIENTATION_FLIP_VERTICAL: - orientationString = "Upside down mirror"; - break; - case ExifInterface.ORIENTATION_TRANSPOSE: - orientationString = "Transposed"; - break; - case ExifInterface.ORIENTATION_ROTATE_90: - orientationString = "Rotated 90 degrees"; - break; - case ExifInterface.ORIENTATION_TRANSVERSE: - orientationString = "Transversed"; - break; - case ExifInterface.ORIENTATION_ROTATE_270: - orientationString = "Rotated 270 degrees"; - break; - default: - orientationString = "Undefined"; - break; - } - return orientationString; - } - // Called when "Details" is clicked. // Displays detailed information about the image/video. private static boolean onDetailsClicked(MenuInvoker onInvoke, diff --git a/src/com/android/camera/OnScreenSettings.java b/src/com/android/camera/OnScreenSettings.java index 4107900..0aaf818 100644 --- a/src/com/android/camera/OnScreenSettings.java +++ b/src/com/android/camera/OnScreenSettings.java @@ -9,7 +9,6 @@ import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceGroup; import android.preference.PreferenceScreen; -import android.util.Log; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.view.Gravity; @@ -34,6 +33,7 @@ import java.util.ArrayList; // Please reference to {@link android.widget.ZoomButtonsController} for detail // information about adding window to WindowManager. public class OnScreenSettings { + @SuppressWarnings("unused") private static final String TAG = "OnScreenSettings"; private static final int MSG_POST_SET_HIDE = 1; private static final int MSG_POST_SET_VISIBLE = 2; @@ -156,8 +156,6 @@ public class OnScreenSettings { // Position the zoom controls on the bottom of the owner view. int ownerHeight = mOwnerView.getHeight(); int ownerWidth = mOwnerView.getWidth(); - // The gap between the top of the owner and the top of the container - int containerOwnerYOffset = ownerHeight - mContainer.getHeight(); // Calculate the owner view's bounds int[] mOwnerViewRawLocation = new int[2]; diff --git a/src/com/android/camera/ReviewImage.java b/src/com/android/camera/ReviewImage.java index 2dd1748..3c597c1 100644 --- a/src/com/android/camera/ReviewImage.java +++ b/src/com/android/camera/ReviewImage.java @@ -19,11 +19,9 @@ package com.android.camera; import android.app.Activity; import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; -import android.preference.PreferenceManager; import android.provider.MediaStore; import android.util.AttributeSet; import android.util.Log; @@ -68,10 +66,6 @@ public class ReviewImage extends Activity implements View.OnClickListener { int mCurrentPosition = 0; - // represents which style animation to use - - private SharedPreferences mPrefs; - private View mRootView; private View mControlBar; private View mNextImageView; @@ -474,8 +468,6 @@ public class ReviewImage extends Activity implements View.OnClickListener { mFullScreenInNormalMode = intent.getBooleanExtra( MediaStore.EXTRA_FULL_SCREEN, true); - mPrefs = PreferenceManager.getDefaultSharedPreferences(this); - setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.review_image); diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index fb5d11d..dc2ae94 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -1434,6 +1434,7 @@ public class VideoCamera extends Activity implements View.OnClickListener, // DefaultHashMap is a HashMap which returns a default value if the specified // key is not found. // +@SuppressWarnings("serial") class DefaultHashMap<K, V> extends HashMap<K, V> { private V mDefaultValue; diff --git a/src/com/android/camera/Wallpaper.java b/src/com/android/camera/Wallpaper.java index 4b72dd7..2d533b5 100644 --- a/src/com/android/camera/Wallpaper.java +++ b/src/com/android/camera/Wallpaper.java @@ -26,6 +26,7 @@ import android.os.Bundle; * standard pick action. */ public class Wallpaper extends Activity { + @SuppressWarnings("unused") private static final String TAG = "Wallpaper"; private static final int PHOTO_PICKED = 1; private static final int CROP_DONE = 2; diff --git a/src/com/android/camera/gallery/Image.java b/src/com/android/camera/gallery/Image.java index bc93152..9110a9b 100644 --- a/src/com/android/camera/gallery/Image.java +++ b/src/com/android/camera/gallery/Image.java @@ -35,7 +35,6 @@ import android.util.Log; import java.io.FileNotFoundException; import java.io.IOException; -import java.util.HashMap; /** * The class for normal images in gallery. @@ -106,7 +105,6 @@ public class Image extends BaseImage implements IImage { public void saveImageContents(Bitmap image, byte [] jpegData, boolean newFile, String filePath) { - Bitmap thumbnail = null; Uri uri = mContainer.contentUri(mId); compressImageToFile(image, jpegData, uri); } diff --git a/src/com/android/camera/gallery/ImageListUber.java b/src/com/android/camera/gallery/ImageListUber.java index bd0d59f..837e2a8 100644 --- a/src/com/android/camera/gallery/ImageListUber.java +++ b/src/com/android/camera/gallery/ImageListUber.java @@ -192,7 +192,6 @@ public class ImageListUber implements IImageList { for (int i = 0, n = mSkipListSize; i < n; i++) { long v = mSkipList[i]; int offset = (int) (v & 0xFFFFFFFF); - int which = (int) (v >> 32); if (skipCount + offset > index) { mSkipList[i] = v - 1; break; diff --git a/src/com/android/camera/gallery/LruCache.java b/src/com/android/camera/gallery/LruCache.java index 9a7eb96..2e15ee5 100644 --- a/src/com/android/camera/gallery/LruCache.java +++ b/src/com/android/camera/gallery/LruCache.java @@ -29,6 +29,7 @@ public class LruCache<K, V> { new HashMap<K, Entry<K, V>>(); private ReferenceQueue<V> mQueue = new ReferenceQueue<V>(); + @SuppressWarnings("serial") public LruCache(final int capacity) { mLruMap = new LinkedHashMap<K, V>(16, 0.75f, true) { @Override diff --git a/src/com/android/camera/gallery/UriImage.java b/src/com/android/camera/gallery/UriImage.java index 61f668c..0db1633 100644 --- a/src/com/android/camera/gallery/UriImage.java +++ b/src/com/android/camera/gallery/UriImage.java @@ -53,7 +53,6 @@ class UriImage implements IImage { private InputStream getInputStream() { try { if (mUri.getScheme().equals("file")) { - String path = mUri.getPath(); return new java.io.FileInputStream(mUri.getPath()); } else { return mContentResolver.openInputStream(mUri); |