Code clean up.

Remove unused imports.
Remove unused fields.
Remove unnecessary cast.
Add missing override annotations.

Change-Id: Idad2e587697a5015eb5363d7b71fab9de9cc8ffb
diff --git a/gallerycommon/src/com/android/gallery3d/common/FileCache.java b/gallerycommon/src/com/android/gallery3d/common/FileCache.java
index a69487f..d7deda6 100644
--- a/gallerycommon/src/com/android/gallery3d/common/FileCache.java
+++ b/gallerycommon/src/com/android/gallery3d/common/FileCache.java
@@ -92,6 +92,7 @@
         mDbHelper = new DatabaseHelper(context, dbName);
     }
 
+    @Override
     public void close() {
         mDbHelper.close();
     }
diff --git a/gallerycommon/src/com/android/gallery3d/common/Fingerprint.java b/gallerycommon/src/com/android/gallery3d/common/Fingerprint.java
index 39fcf9e..2847e57 100644
--- a/gallerycommon/src/com/android/gallery3d/common/Fingerprint.java
+++ b/gallerycommon/src/com/android/gallery3d/common/Fingerprint.java
@@ -16,10 +16,6 @@
 
 package com.android.gallery3d.common;
 
-import android.content.ContentResolver;
-import android.net.Uri;
-
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.security.DigestInputStream;
diff --git a/gallerycommon/src/com/android/gallery3d/common/HttpClientFactory.java b/gallerycommon/src/com/android/gallery3d/common/HttpClientFactory.java
index cb95e33..9e327aa 100644
--- a/gallerycommon/src/com/android/gallery3d/common/HttpClientFactory.java
+++ b/gallerycommon/src/com/android/gallery3d/common/HttpClientFactory.java
@@ -20,7 +20,6 @@
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.os.Build;
-import android.util.Log;
 
 import org.apache.http.HttpVersion;
 import org.apache.http.client.HttpClient;
diff --git a/gallerycommon/src/com/android/gallery3d/common/Scroller.java b/gallerycommon/src/com/android/gallery3d/common/Scroller.java
index 160f3ca..6cefd6f 100644
--- a/gallerycommon/src/com/android/gallery3d/common/Scroller.java
+++ b/gallerycommon/src/com/android/gallery3d/common/Scroller.java
@@ -342,7 +342,7 @@
         mFinalY = startY + dy;
         mDeltaX = dx;
         mDeltaY = dy;
-        mDurationReciprocal = 1.0f / (float) mDuration;
+        mDurationReciprocal = 1.0f / mDuration;
     }
 
     /**
@@ -370,8 +370,8 @@
         if (mFlywheel && !mFinished) {
             float oldVel = getCurrVelocity();
 
-            float dx = (float) (mFinalX - mStartX);
-            float dy = (float) (mFinalY - mStartY);
+            float dx = mFinalX - mStartX;
+            float dy = mFinalY - mStartY;
             float hyp = FloatMath.sqrt(dx * dx + dy * dy);
 
             float ndx = dx / hyp;
diff --git a/src/com/android/gallery3d/app/AlbumDataLoader.java b/src/com/android/gallery3d/app/AlbumDataLoader.java
index 71a5756..8e6fcf5 100644
--- a/src/com/android/gallery3d/app/AlbumDataLoader.java
+++ b/src/com/android/gallery3d/app/AlbumDataLoader.java
@@ -201,6 +201,7 @@
     }
 
     private class MySourceListener implements ContentListener {
+        @Override
         public void onContentDirty() {
             if (mReloadTask != null) mReloadTask.notifyDirty();
         }
@@ -243,6 +244,7 @@
             mVersion = version;
         }
 
+        @Override
         public UpdateInfo call() throws Exception {
             UpdateInfo info = new UpdateInfo();
             long version = mVersion;
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java
index b4e600b..be17f97 100644
--- a/src/com/android/gallery3d/app/AlbumPage.java
+++ b/src/com/android/gallery3d/app/AlbumPage.java
@@ -459,6 +459,7 @@
         });
         mActionModeHandler = new ActionModeHandler(mActivity, mSelectionManager);
         mActionModeHandler.setActionModeListener(new ActionModeListener() {
+            @Override
             public boolean onActionItemClicked(MenuItem item) {
                 return onItemSelected(item);
             }
@@ -483,6 +484,7 @@
         if (mDetailsHelper == null) {
             mDetailsHelper = new DetailsHelper(mActivity, mRootPane, mDetailsSource);
             mDetailsHelper.setCloseListener(new CloseListener() {
+                @Override
                 public void onClose() {
                     hideDetails();
                 }
@@ -607,6 +609,7 @@
         }
     }
 
+    @Override
     public void onSelectionModeChange(int mode) {
         switch (mode) {
             case SelectionManager.ENTER_SELECTION_MODE: {
@@ -627,6 +630,7 @@
         }
     }
 
+    @Override
     public void onSelectionChange(Path path, boolean selected) {
         Utils.assertTrue(mActionMode != null);
         int count = mSelectionManager.getSelectedCount();
@@ -693,16 +697,19 @@
     private class MyDetailsSource implements DetailsHelper.DetailsSource {
         private int mIndex;
 
+        @Override
         public int size() {
             return mAlbumDataAdapter.size();
         }
 
+        @Override
         public int setIndex() {
             Path id = mSelectionManager.getSelected(false).get(0);
             mIndex = mAlbumDataAdapter.findItem(id);
             return mIndex;
         }
 
+        @Override
         public MediaDetails getDetails() {
             // this relies on setIndex() being called beforehand
             MediaObject item = mAlbumDataAdapter.get(mIndex);
diff --git a/src/com/android/gallery3d/app/AlbumPicker.java b/src/com/android/gallery3d/app/AlbumPicker.java
index 7509e63..65eb772 100644
--- a/src/com/android/gallery3d/app/AlbumPicker.java
+++ b/src/com/android/gallery3d/app/AlbumPicker.java
@@ -24,8 +24,6 @@
 
 public class AlbumPicker extends PickerActivity {
 
-    public static final String KEY_ALBUM_PATH = "album-path";
-
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
diff --git a/src/com/android/gallery3d/app/AlbumSetDataLoader.java b/src/com/android/gallery3d/app/AlbumSetDataLoader.java
index 33a30bc..9613f99 100644
--- a/src/com/android/gallery3d/app/AlbumSetDataLoader.java
+++ b/src/com/android/gallery3d/app/AlbumSetDataLoader.java
@@ -219,6 +219,7 @@
     }
 
     private class MySourceListener implements ContentListener {
+        @Override
         public void onContentDirty() {
             mReloadTask.notifyDirty();
         }
@@ -279,6 +280,7 @@
             mUpdateInfo = info;
         }
 
+        @Override
         public Void call() {
             // Avoid notifying listeners of status change after pause
             // Otherwise gallery will be in inconsistent state after resume.
diff --git a/src/com/android/gallery3d/app/AppBridge.java b/src/com/android/gallery3d/app/AppBridge.java
index 5d6b1ec..f89b35a 100644
--- a/src/com/android/gallery3d/app/AppBridge.java
+++ b/src/com/android/gallery3d/app/AppBridge.java
@@ -23,10 +23,12 @@
 
 // This is the bridge to connect a PhotoPage to the external environment.
 public abstract class AppBridge implements Parcelable {
+    @Override
     public int describeContents() {
         return 0;
     }
 
+    @Override
     public void writeToParcel(Parcel dest, int flags) {
     }
 
diff --git a/src/com/android/gallery3d/app/CropImage.java b/src/com/android/gallery3d/app/CropImage.java
index a587624..6faf8cb 100644
--- a/src/com/android/gallery3d/app/CropImage.java
+++ b/src/com/android/gallery3d/app/CropImage.java
@@ -249,6 +249,7 @@
             mCropRect = cropRect;
         }
 
+        @Override
         public Intent run(JobContext jc) {
             RectF cropRect = mCropRect;
             Bundle extra = getIntent().getExtras();
@@ -487,6 +488,7 @@
         // We wrap the OutputStream so that it can be interrupted.
         final InterruptableOutputStream ios = new InterruptableOutputStream(os);
         jc.setCancelListener(new CancelListener() {
+                @Override
                 public void onCancel() {
                     ios.interrupt();
                 }
@@ -545,6 +547,7 @@
                 this, null, getString(messageId), true, false);
         mSaveTask = getThreadPool().submit(new SaveOutput(cropRect),
                 new FutureListener<Intent>() {
+            @Override
             public void onFutureDone(Future<Intent> future) {
                 mSaveTask = null;
                 if (future.isCancelled()) return;
@@ -827,6 +830,7 @@
         if (supportedByBitmapRegionDecoder) {
             mLoadTask = getThreadPool().submit(new LoadDataTask(mMediaItem),
                     new FutureListener<BitmapRegionDecoder>() {
+                @Override
                 public void onFutureDone(Future<BitmapRegionDecoder> future) {
                     mLoadTask = null;
                     BitmapRegionDecoder decoder = future.get();
@@ -841,6 +845,7 @@
         } else {
             mLoadBitmapTask = getThreadPool().submit(new LoadBitmapDataTask(mMediaItem),
                     new FutureListener<Bitmap>() {
+                @Override
                 public void onFutureDone(Future<Bitmap> future) {
                     mLoadBitmapTask = null;
                     Bitmap bitmap = future.get();
@@ -925,6 +930,7 @@
             mItem = item;
         }
 
+        @Override
         public BitmapRegionDecoder run(JobContext jc) {
             return mItem == null ? null : mItem.requestLargeImage().run(jc);
         }
@@ -936,6 +942,7 @@
         public LoadBitmapDataTask(MediaItem item) {
             mItem = item;
         }
+        @Override
         public Bitmap run(JobContext jc) {
             return mItem == null
                     ? null
diff --git a/src/com/android/gallery3d/app/EyePosition.java b/src/com/android/gallery3d/app/EyePosition.java
index 89e0846..d99d97b 100644
--- a/src/com/android/gallery3d/app/EyePosition.java
+++ b/src/com/android/gallery3d/app/EyePosition.java
@@ -31,6 +31,7 @@
 import com.android.gallery3d.util.GalleryUtils;
 
 public class EyePosition {
+    @SuppressWarnings("unused")
     private static final String TAG = "EyePosition";
 
     public interface EyePositionListener {
@@ -180,9 +181,11 @@
     }
 
     private class PositionListener implements SensorEventListener {
+        @Override
         public void onAccuracyChanged(Sensor sensor, int accuracy) {
         }
 
+        @Override
         public void onSensorChanged(SensorEvent event) {
             switch (event.sensor.getType()) {
                 case Sensor.TYPE_GYROSCOPE: {
diff --git a/src/com/android/gallery3d/app/FilterUtils.java b/src/com/android/gallery3d/app/FilterUtils.java
index c15457e..61a261f 100644
--- a/src/com/android/gallery3d/app/FilterUtils.java
+++ b/src/com/android/gallery3d/app/FilterUtils.java
@@ -54,6 +54,7 @@
 // functions. setupMenuItems() makes sure those types cannot be selected.
 //
 public class FilterUtils {
+    @SuppressWarnings("unused")
     private static final String TAG = "FilterUtils";
 
     public static final int CLUSTER_BY_ALBUM = 1;
diff --git a/src/com/android/gallery3d/app/GalleryActionBar.java b/src/com/android/gallery3d/app/GalleryActionBar.java
index 5c61648..2794b3f 100644
--- a/src/com/android/gallery3d/app/GalleryActionBar.java
+++ b/src/com/android/gallery3d/app/GalleryActionBar.java
@@ -36,6 +36,7 @@
 import java.util.ArrayList;
 
 public class GalleryActionBar implements ActionBar.OnNavigationListener {
+    @SuppressWarnings("unused")
     private static final String TAG = "GalleryActionBar";
 
     private ClusterRunner mClusterRunner;
@@ -91,18 +92,22 @@
 
     private class ClusterAdapter extends BaseAdapter {
 
+        @Override
         public int getCount() {
             return sClusterItems.length;
         }
 
+        @Override
         public Object getItem(int position) {
             return sClusterItems[position];
         }
 
+        @Override
         public long getItemId(int position) {
             return sClusterItems[position].action;
         }
 
+        @Override
         public View getView(int position, View convertView, ViewGroup parent) {
             if (convertView == null) {
                 convertView = mInflater.inflate(R.layout.action_bar_text,
@@ -207,6 +212,7 @@
         final ArrayList<Integer> actions = mActions;
         new AlertDialog.Builder(mContext).setTitle(R.string.group_by).setItems(
                 mTitles, new DialogInterface.OnClickListener() {
+            @Override
             public void onClick(DialogInterface dialog, int which) {
                 // Need to lock rendering when operations invoked by system UI (main thread) are
                 // modifying slot data used in GL thread for rendering.
diff --git a/src/com/android/gallery3d/app/GalleryAppImpl.java b/src/com/android/gallery3d/app/GalleryAppImpl.java
index 852926b..f725ccf 100644
--- a/src/com/android/gallery3d/app/GalleryAppImpl.java
+++ b/src/com/android/gallery3d/app/GalleryAppImpl.java
@@ -49,10 +49,12 @@
         PicasaSource.initialize(this);
     }
 
+    @Override
     public Context getAndroidContext() {
         return this;
     }
 
+    @Override
     public synchronized DataManager getDataManager() {
         if (mDataManager == null) {
             mDataManager = new DataManager(this);
@@ -61,6 +63,7 @@
         return mDataManager;
     }
 
+    @Override
     public ImageCacheService getImageCacheService() {
         // This method may block on file I/O so a dedicated lock is needed here.
         synchronized (mLock) {
@@ -71,6 +74,7 @@
         }
     }
 
+    @Override
     public synchronized ThreadPool getThreadPool() {
         if (mThreadPool == null) {
             mThreadPool = new ThreadPool();
@@ -78,6 +82,7 @@
         return mThreadPool;
     }
 
+    @Override
     public synchronized DownloadCache getDownloadCache() {
         if (mDownloadCache == null) {
             File cacheDir = new File(getExternalCacheDir(), DOWNLOAD_FOLDER);
diff --git a/src/com/android/gallery3d/app/ManageCachePage.java b/src/com/android/gallery3d/app/ManageCachePage.java
index cdbbfdc..1f10728 100644
--- a/src/com/android/gallery3d/app/ManageCachePage.java
+++ b/src/com/android/gallery3d/app/ManageCachePage.java
@@ -56,6 +56,7 @@
         EyePosition.EyePositionListener, OnClickListener {
     public static final String KEY_MEDIA_PATH = "media-path";
 
+    @SuppressWarnings("unused")
     private static final String TAG = "ManageCachePage";
 
     private static final int DATA_CACHE_SIZE = 256;
diff --git a/src/com/android/gallery3d/app/MovieControllerOverlay.java b/src/com/android/gallery3d/app/MovieControllerOverlay.java
index f2c9e05..4781a1b 100644
--- a/src/com/android/gallery3d/app/MovieControllerOverlay.java
+++ b/src/com/android/gallery3d/app/MovieControllerOverlay.java
@@ -41,365 +41,387 @@
  * The playback controller for the Movie Player.
  */
 public class MovieControllerOverlay extends FrameLayout implements
-    ControllerOverlay,
-    OnClickListener,
-    AnimationListener,
-    TimeBar.Listener {
+        ControllerOverlay,
+        OnClickListener,
+        AnimationListener,
+        TimeBar.Listener {
 
-  private enum State {
-    PLAYING,
-    PAUSED,
-    ENDED,
-    ERROR,
-    LOADING
-  }
-
-  private static final float ERROR_MESSAGE_RELATIVE_PADDING = 1.0f / 6;
-
-  private Listener listener;
-
-  private final View background;
-  private final TimeBar timeBar;
-
-  private View mainView;
-  private final LinearLayout loadingView;
-  private final TextView errorView;
-  private final ImageView playPauseReplayView;
-
-  private final Handler handler;
-  private final Runnable startHidingRunnable;
-  private final Animation hideAnimation;
-
-  private State state;
-
-  private boolean hidden;
-
-  private boolean canReplay = true;
-
-  public MovieControllerOverlay(Context context) {
-    super(context);
-
-    state = State.LOADING;
-
-    LayoutParams wrapContent =
-        new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
-    LayoutParams matchParent =
-        new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
-
-    background = new View(context);
-    background.setBackgroundColor(context.getResources().getColor(R.color.darker_transparent));
-    addView(background, matchParent);
-
-    timeBar = new TimeBar(context, this);
-    addView(timeBar, wrapContent);
-
-    loadingView = new LinearLayout(context);
-    loadingView.setOrientation(LinearLayout.VERTICAL);
-    loadingView.setGravity(Gravity.CENTER_HORIZONTAL);
-    ProgressBar spinner = new ProgressBar(context);
-    spinner.setIndeterminate(true);
-    loadingView.addView(spinner, wrapContent);
-    TextView loadingText = createOverlayTextView(context);
-    loadingText.setText(R.string.loading_video);
-    loadingView.addView(loadingText, wrapContent);
-    addView(loadingView, wrapContent);
-
-    playPauseReplayView = new ImageView(context);
-    playPauseReplayView.setImageResource(R.drawable.ic_vidcontrol_play);
-    playPauseReplayView.setBackgroundResource(R.drawable.bg_vidcontrol);
-    playPauseReplayView.setScaleType(ScaleType.CENTER);
-    playPauseReplayView.setFocusable(true);
-    playPauseReplayView.setClickable(true);
-    playPauseReplayView.setOnClickListener(this);
-    addView(playPauseReplayView, wrapContent);
-
-    errorView = createOverlayTextView(context);
-    addView(errorView, matchParent);
-
-    handler = new Handler();
-    startHidingRunnable = new Runnable() {
-      public void run() {
-        startHiding();
-      }
-    };
-
-    hideAnimation = AnimationUtils.loadAnimation(context, R.anim.player_out);
-    hideAnimation.setAnimationListener(this);
-
-    RelativeLayout.LayoutParams params =
-        new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
-    setLayoutParams(params);
-    hide();
-  }
-
-  private TextView createOverlayTextView(Context context) {
-    TextView view = new TextView(context);
-    view.setGravity(Gravity.CENTER);
-    view.setTextColor(0xFFFFFFFF);
-    view.setPadding(0, 15, 0, 15);
-    return view;
-  }
-
-  public void setListener(Listener listener) {
-    this.listener = listener;
-  }
-
-  public void setCanReplay(boolean canReplay) {
-    this.canReplay = canReplay;
-  }
-
-  public View getView() {
-    return this;
-  }
-
-  public void showPlaying() {
-    state = State.PLAYING;
-    showMainView(playPauseReplayView);
-  }
-
-  public void showPaused() {
-    state = State.PAUSED;
-    showMainView(playPauseReplayView);
-  }
-
-  public void showEnded() {
-    state = State.ENDED;
-    showMainView(playPauseReplayView);
-  }
-
-  public void showLoading() {
-    state = State.LOADING;
-    showMainView(loadingView);
-  }
-
-  public void showErrorMessage(String message) {
-    state = State.ERROR;
-    int padding = (int) (getMeasuredWidth() * ERROR_MESSAGE_RELATIVE_PADDING);
-    errorView.setPadding(padding, errorView.getPaddingTop(), padding, errorView.getPaddingBottom());
-    errorView.setText(message);
-    showMainView(errorView);
-  }
-
-  public void setTimes(int currentTime, int totalTime) {
-    timeBar.setTime(currentTime, totalTime);
-  }
-
-  public void hide() {
-    boolean wasHidden = hidden;
-    hidden = true;
-    playPauseReplayView.setVisibility(View.INVISIBLE);
-    loadingView.setVisibility(View.INVISIBLE);
-    background.setVisibility(View.INVISIBLE);
-    timeBar.setVisibility(View.INVISIBLE);
-    setVisibility(View.INVISIBLE);
-    setFocusable(true);
-    requestFocus();
-    if (listener != null && wasHidden != hidden) {
-      listener.onHidden();
+    private enum State {
+        PLAYING,
+        PAUSED,
+        ENDED,
+        ERROR,
+        LOADING
     }
-  }
 
-  private void showMainView(View view) {
-    mainView = view;
-    errorView.setVisibility(mainView == errorView ? View.VISIBLE : View.INVISIBLE);
-    loadingView.setVisibility(mainView == loadingView ? View.VISIBLE : View.INVISIBLE);
-    playPauseReplayView.setVisibility(
-        mainView == playPauseReplayView ? View.VISIBLE : View.INVISIBLE);
-    show();
-  }
+    private static final float ERROR_MESSAGE_RELATIVE_PADDING = 1.0f / 6;
 
-  public void show() {
-    boolean wasHidden = hidden;
-    hidden = false;
-    updateViews();
-    setVisibility(View.VISIBLE);
-    setFocusable(false);
-    if (listener != null && wasHidden != hidden) {
-      listener.onShown();
+    private Listener listener;
+
+    private final View background;
+    private final TimeBar timeBar;
+
+    private View mainView;
+    private final LinearLayout loadingView;
+    private final TextView errorView;
+    private final ImageView playPauseReplayView;
+
+    private final Handler handler;
+    private final Runnable startHidingRunnable;
+    private final Animation hideAnimation;
+
+    private State state;
+
+    private boolean hidden;
+
+    private boolean canReplay = true;
+
+    public MovieControllerOverlay(Context context) {
+        super(context);
+
+        state = State.LOADING;
+
+        LayoutParams wrapContent =
+                new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
+        LayoutParams matchParent =
+                new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
+
+        background = new View(context);
+        background.setBackgroundColor(context.getResources().getColor(R.color.darker_transparent));
+        addView(background, matchParent);
+
+        timeBar = new TimeBar(context, this);
+        addView(timeBar, wrapContent);
+
+        loadingView = new LinearLayout(context);
+        loadingView.setOrientation(LinearLayout.VERTICAL);
+        loadingView.setGravity(Gravity.CENTER_HORIZONTAL);
+        ProgressBar spinner = new ProgressBar(context);
+        spinner.setIndeterminate(true);
+        loadingView.addView(spinner, wrapContent);
+        TextView loadingText = createOverlayTextView(context);
+        loadingText.setText(R.string.loading_video);
+        loadingView.addView(loadingText, wrapContent);
+        addView(loadingView, wrapContent);
+
+        playPauseReplayView = new ImageView(context);
+        playPauseReplayView.setImageResource(R.drawable.ic_vidcontrol_play);
+        playPauseReplayView.setBackgroundResource(R.drawable.bg_vidcontrol);
+        playPauseReplayView.setScaleType(ScaleType.CENTER);
+        playPauseReplayView.setFocusable(true);
+        playPauseReplayView.setClickable(true);
+        playPauseReplayView.setOnClickListener(this);
+        addView(playPauseReplayView, wrapContent);
+
+        errorView = createOverlayTextView(context);
+        addView(errorView, matchParent);
+
+        handler = new Handler();
+        startHidingRunnable = new Runnable() {
+                @Override
+            public void run() {
+                startHiding();
+            }
+        };
+
+        hideAnimation = AnimationUtils.loadAnimation(context, R.anim.player_out);
+        hideAnimation.setAnimationListener(this);
+
+        RelativeLayout.LayoutParams params =
+                new RelativeLayout.LayoutParams(
+                        LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
+        setLayoutParams(params);
+        hide();
     }
-    maybeStartHiding();
-  }
 
-  private void maybeStartHiding() {
-    cancelHiding();
-    if (state == State.PLAYING) {
-      handler.postDelayed(startHidingRunnable, 2500);
+    private TextView createOverlayTextView(Context context) {
+        TextView view = new TextView(context);
+        view.setGravity(Gravity.CENTER);
+        view.setTextColor(0xFFFFFFFF);
+        view.setPadding(0, 15, 0, 15);
+        return view;
     }
-  }
 
-  private void startHiding() {
-    startHideAnimation(background);
-    startHideAnimation(timeBar);
-    startHideAnimation(playPauseReplayView);
-  }
-
-  private void startHideAnimation(View view) {
-    if (view.getVisibility() == View.VISIBLE) {
-      view.startAnimation(hideAnimation);
+    @Override
+    public void setListener(Listener listener) {
+        this.listener = listener;
     }
-  }
 
-  private void cancelHiding() {
-    handler.removeCallbacks(startHidingRunnable);
-    background.setAnimation(null);
-    timeBar.setAnimation(null);
-    playPauseReplayView.setAnimation(null);
-  }
+    @Override
+    public void setCanReplay(boolean canReplay) {
+        this.canReplay = canReplay;
+    }
 
-  public void onAnimationStart(Animation animation) {
-    // Do nothing.
-  }
+    @Override
+    public View getView() {
+        return this;
+    }
 
-  public void onAnimationRepeat(Animation animation) {
-    // Do nothing.
-  }
+    @Override
+    public void showPlaying() {
+        state = State.PLAYING;
+        showMainView(playPauseReplayView);
+    }
 
-  public void onAnimationEnd(Animation animation) {
-    hide();
-  }
+    @Override
+    public void showPaused() {
+        state = State.PAUSED;
+        showMainView(playPauseReplayView);
+    }
 
-  public void onClick(View view) {
-    if (listener != null) {
-      if (view == playPauseReplayView) {
-        if (state == State.ENDED) {
-          if (canReplay) {
-              listener.onReplay();
-          }
-        } else if (state == State.PAUSED || state == State.PLAYING) {
-          listener.onPlayPause();
+    @Override
+    public void showEnded() {
+        state = State.ENDED;
+        showMainView(playPauseReplayView);
+    }
+
+    @Override
+    public void showLoading() {
+        state = State.LOADING;
+        showMainView(loadingView);
+    }
+
+    @Override
+    public void showErrorMessage(String message) {
+        state = State.ERROR;
+        int padding = (int) (getMeasuredWidth() * ERROR_MESSAGE_RELATIVE_PADDING);
+        errorView.setPadding(
+                padding, errorView.getPaddingTop(), padding, errorView.getPaddingBottom());
+        errorView.setText(message);
+        showMainView(errorView);
+    }
+
+    @Override
+    public void setTimes(int currentTime, int totalTime) {
+        timeBar.setTime(currentTime, totalTime);
+    }
+
+    public void hide() {
+        boolean wasHidden = hidden;
+        hidden = true;
+        playPauseReplayView.setVisibility(View.INVISIBLE);
+        loadingView.setVisibility(View.INVISIBLE);
+        background.setVisibility(View.INVISIBLE);
+        timeBar.setVisibility(View.INVISIBLE);
+        setVisibility(View.INVISIBLE);
+        setFocusable(true);
+        requestFocus();
+        if (listener != null && wasHidden != hidden) {
+            listener.onHidden();
         }
-      }
-    }
-  }
-
-  @Override
-  public boolean onKeyDown(int keyCode, KeyEvent event) {
-    if (hidden) {
-      show();
-    }
-    return super.onKeyDown(keyCode, event);
-  }
-
-  @Override
-  public boolean onTouchEvent(MotionEvent event) {
-    if (super.onTouchEvent(event)) {
-      return true;
     }
 
-    if (hidden) {
-      show();
-      return true;
+    private void showMainView(View view) {
+        mainView = view;
+        errorView.setVisibility(mainView == errorView ? View.VISIBLE : View.INVISIBLE);
+        loadingView.setVisibility(mainView == loadingView ? View.VISIBLE : View.INVISIBLE);
+        playPauseReplayView.setVisibility(
+                mainView == playPauseReplayView ? View.VISIBLE : View.INVISIBLE);
+        show();
     }
-    switch (event.getAction()) {
-      case MotionEvent.ACTION_DOWN:
-        cancelHiding();
-        if (state == State.PLAYING || state == State.PAUSED) {
-          listener.onPlayPause();
+
+    @Override
+    public void show() {
+        boolean wasHidden = hidden;
+        hidden = false;
+        updateViews();
+        setVisibility(View.VISIBLE);
+        setFocusable(false);
+        if (listener != null && wasHidden != hidden) {
+            listener.onShown();
         }
-        break;
-      case MotionEvent.ACTION_UP:
         maybeStartHiding();
-        break;
     }
-    return true;
-  }
 
-  // The paddings of 4 sides which covered by system components. E.g.
-  //    +-----------------+\
-  //    |   Action Bar    | insets.top
-  //    +-----------------+/
-  //    |                 |
-  //    |  Content Area   |  insets.right = insets.left = 0
-  //    |                 |
-  //    +-----------------+\
-  //    | Navigation Bar  | insets.bottom
-  //    +-----------------+/
-  // Please see View.fitSystemWindows() for more details.
-  private final Rect mWindowInsets = new Rect();
-
-  @Override
-  protected boolean fitSystemWindows(Rect insets) {
-    // We don't set the paddings of this View, otherwise,
-    // the content will get cropped outside window
-    mWindowInsets.set(insets);
-    return true;
-  }
-
-  @Override
-  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-    Rect insets = mWindowInsets;
-    int pl = insets.left; // the left paddings
-    int pr = insets.right;
-    int pt = insets.top;
-    int pb = insets.bottom;
-
-    int h = bottom - top;
-    int w = right - left;
-    boolean error = errorView.getVisibility() == View.VISIBLE;
-
-    int y = h - pb;
-    // Put both TimeBar and Background just above the bottom system component.
-    // But extend the background to the width of the screen, since we don't
-    // care if it will be covered by a system component and it looks better.
-    background.layout(0, y - timeBar.getBarHeight(), w, y);
-    timeBar.layout(pl, y - timeBar.getPreferredHeight(), w - pr, y);
-
-    // Needed, otherwise the framework will not re-layout in case only the padding is changed
-    timeBar.requestLayout();
-
-    // Put the play/pause/next/ previous button in the center of the screen
-    layoutCenteredView(playPauseReplayView, 0, 0, w, h);
-
-    if (mainView != null) {
-      layoutCenteredView(mainView, 0, 0, w, h);
+    private void maybeStartHiding() {
+        cancelHiding();
+        if (state == State.PLAYING) {
+            handler.postDelayed(startHidingRunnable, 2500);
+        }
     }
-  }
 
-  private void layoutCenteredView(View view, int l, int t, int r, int b) {
-    int cw = view.getMeasuredWidth();
-    int ch = view.getMeasuredHeight();
-    int cl = (r - l - cw) / 2;
-    int ct = (b - t - ch) / 2;
-    view.layout(cl, ct, cl + cw, ct + ch);
-  }
-
-  @Override
-  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-    measureChildren(widthMeasureSpec, heightMeasureSpec);
-  }
-
-  private void updateViews() {
-    if (hidden) {
-      return;
+    private void startHiding() {
+        startHideAnimation(background);
+        startHideAnimation(timeBar);
+        startHideAnimation(playPauseReplayView);
     }
-    background.setVisibility(View.VISIBLE);
-    timeBar.setVisibility(View.VISIBLE);
-    playPauseReplayView.setImageResource(
-        state == State.PAUSED ? R.drawable.ic_vidcontrol_play :
-          state == State.PLAYING ? R.drawable.ic_vidcontrol_pause :
-            R.drawable.ic_vidcontrol_reload);
-    playPauseReplayView.setVisibility(
-        (state != State.LOADING && state != State.ERROR &&
+
+    private void startHideAnimation(View view) {
+        if (view.getVisibility() == View.VISIBLE) {
+            view.startAnimation(hideAnimation);
+        }
+    }
+
+    private void cancelHiding() {
+        handler.removeCallbacks(startHidingRunnable);
+        background.setAnimation(null);
+        timeBar.setAnimation(null);
+        playPauseReplayView.setAnimation(null);
+    }
+
+    @Override
+    public void onAnimationStart(Animation animation) {
+        // Do nothing.
+    }
+
+    @Override
+    public void onAnimationRepeat(Animation animation) {
+        // Do nothing.
+    }
+
+    @Override
+    public void onAnimationEnd(Animation animation) {
+        hide();
+    }
+
+    @Override
+    public void onClick(View view) {
+        if (listener != null) {
+            if (view == playPauseReplayView) {
+                if (state == State.ENDED) {
+                    if (canReplay) {
+                        listener.onReplay();
+                    }
+                } else if (state == State.PAUSED || state == State.PLAYING) {
+                    listener.onPlayPause();
+                }
+            }
+        }
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        if (hidden) {
+            show();
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        if (super.onTouchEvent(event)) {
+            return true;
+        }
+
+        if (hidden) {
+            show();
+            return true;
+        }
+        switch (event.getAction()) {
+            case MotionEvent.ACTION_DOWN:
+                cancelHiding();
+                if (state == State.PLAYING || state == State.PAUSED) {
+                    listener.onPlayPause();
+                }
+                break;
+            case MotionEvent.ACTION_UP:
+                maybeStartHiding();
+                break;
+        }
+        return true;
+    }
+
+    // The paddings of 4 sides which covered by system components. E.g.
+    // +-----------------+\
+    // | Action Bar | insets.top
+    // +-----------------+/
+    // | |
+    // | Content Area | insets.right = insets.left = 0
+    // | |
+    // +-----------------+\
+    // | Navigation Bar | insets.bottom
+    // +-----------------+/
+    // Please see View.fitSystemWindows() for more details.
+    private final Rect mWindowInsets = new Rect();
+
+    @Override
+    protected boolean fitSystemWindows(Rect insets) {
+        // We don't set the paddings of this View, otherwise,
+        // the content will get cropped outside window
+        mWindowInsets.set(insets);
+        return true;
+    }
+
+    @Override
+    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+        Rect insets = mWindowInsets;
+        int pl = insets.left; // the left paddings
+        int pr = insets.right;
+        int pt = insets.top;
+        int pb = insets.bottom;
+
+        int h = bottom - top;
+        int w = right - left;
+        boolean error = errorView.getVisibility() == View.VISIBLE;
+
+        int y = h - pb;
+        // Put both TimeBar and Background just above the bottom system
+        // component.
+        // But extend the background to the width of the screen, since we don't
+        // care if it will be covered by a system component and it looks better.
+        background.layout(0, y - timeBar.getBarHeight(), w, y);
+        timeBar.layout(pl, y - timeBar.getPreferredHeight(), w - pr, y);
+
+        // Needed, otherwise the framework will not re-layout in case only the
+        // padding is changed
+        timeBar.requestLayout();
+
+        // Put the play/pause/next/ previous button in the center of the screen
+        layoutCenteredView(playPauseReplayView, 0, 0, w, h);
+
+        if (mainView != null) {
+            layoutCenteredView(mainView, 0, 0, w, h);
+        }
+    }
+
+    private void layoutCenteredView(View view, int l, int t, int r, int b) {
+        int cw = view.getMeasuredWidth();
+        int ch = view.getMeasuredHeight();
+        int cl = (r - l - cw) / 2;
+        int ct = (b - t - ch) / 2;
+        view.layout(cl, ct, cl + cw, ct + ch);
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+        measureChildren(widthMeasureSpec, heightMeasureSpec);
+    }
+
+    private void updateViews() {
+        if (hidden) {
+            return;
+        }
+        background.setVisibility(View.VISIBLE);
+        timeBar.setVisibility(View.VISIBLE);
+        playPauseReplayView.setImageResource(
+                state == State.PAUSED ? R.drawable.ic_vidcontrol_play :
+                state == State.PLAYING ? R.drawable.ic_vidcontrol_pause :
+                R.drawable.ic_vidcontrol_reload);
+        playPauseReplayView.setVisibility(
+                (state != State.LOADING && state != State.ERROR &&
                 !(state == State.ENDED && !canReplay))
-        ? View.VISIBLE : View.GONE);
-    requestLayout();
-  }
+                ? View.VISIBLE : View.GONE);
+        requestLayout();
+    }
 
-  // TimeBar listener
+    // TimeBar listener
 
-  public void onScrubbingStart() {
-    cancelHiding();
-    listener.onSeekStart();
-  }
+    @Override
+    public void onScrubbingStart() {
+        cancelHiding();
+        listener.onSeekStart();
+    }
 
-  public void onScrubbingMove(int time) {
-    cancelHiding();
-    listener.onSeekMove(time);
-  }
+    @Override
+    public void onScrubbingMove(int time) {
+        cancelHiding();
+        listener.onSeekMove(time);
+    }
 
-  public void onScrubbingEnd(int time) {
-    maybeStartHiding();
-    listener.onSeekEnd(time);
-  }
+    @Override
+    public void onScrubbingEnd(int time) {
+        maybeStartHiding();
+        listener.onSeekEnd(time);
+    }
 }
diff --git a/src/com/android/gallery3d/app/OrientationManager.java b/src/com/android/gallery3d/app/OrientationManager.java
index c3e91fb..f5cbf06 100644
--- a/src/com/android/gallery3d/app/OrientationManager.java
+++ b/src/com/android/gallery3d/app/OrientationManager.java
@@ -24,7 +24,6 @@
 import android.provider.Settings;
 import android.view.OrientationEventListener;
 import android.view.Surface;
-import android.view.ViewConfiguration;
 
 import com.android.gallery3d.ui.OrientationSource;
 
diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java
index 555ea89..5339e7e 100644
--- a/src/com/android/gallery3d/app/PhotoDataAdapter.java
+++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java
@@ -341,6 +341,7 @@
         updateImageRequests();
     }
 
+    @Override
     public void resume() {
         mIsActive = true;
         mSource.addContentListener(mSourceListener);
@@ -353,6 +354,7 @@
         fireDataChange();
     }
 
+    @Override
     public void pause() {
         mIsActive = false;
 
@@ -485,35 +487,43 @@
         return LOADING_INIT;
     }
 
+    @Override
     public ScreenNail getScreenNail() {
         return getScreenNail(0);
     }
 
+    @Override
     public int getImageHeight() {
         return mTileProvider.getImageHeight();
     }
 
+    @Override
     public int getImageWidth() {
         return mTileProvider.getImageWidth();
     }
 
+    @Override
     public int getLevelCount() {
         return mTileProvider.getLevelCount();
     }
 
+    @Override
     public Bitmap getTile(int level, int x, int y, int tileSize,
             int borderSize, BitmapPool pool) {
         return mTileProvider.getTile(level, x, y, tileSize, borderSize, pool);
     }
 
+    @Override
     public boolean isEmpty() {
         return mSize == 0;
     }
 
+    @Override
     public int getCurrentIndex() {
         return mCurrentIndex;
     }
 
+    @Override
     public MediaItem getMediaItem(int offset) {
         int index = mCurrentIndex + offset;
         if (index >= mContentStart && index < mContentEnd) {
@@ -522,6 +532,7 @@
         return null;
     }
 
+    @Override
     public void setCurrentPhoto(Path path, int indexHint) {
         if (mItemPath == path) return;
         mItemPath = path;
@@ -537,10 +548,12 @@
         }
     }
 
+    @Override
     public void setFocusHintDirection(int direction) {
         mFocusHintDirection = direction;
     }
 
+    @Override
     public void setFocusHintPath(Path path) {
         mFocusHintPath = path;
     }
@@ -848,6 +861,7 @@
     }
 
     private class SourceListener implements ContentListener {
+        @Override
         public void onContentDirty() {
             if (mReloadTask != null) mReloadTask.notifyDirty();
         }
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 950f8c5..678ba6d 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -26,15 +26,12 @@
 import android.graphics.Rect;
 import android.net.Uri;
 import android.nfc.NfcAdapter;
-import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
-import android.view.View;
-import android.view.WindowManager;
 import android.widget.ShareActionProvider;
 import android.widget.Toast;
 
diff --git a/src/com/android/gallery3d/app/PickerActivity.java b/src/com/android/gallery3d/app/PickerActivity.java
index f5b2cbd..d5bb218 100644
--- a/src/com/android/gallery3d/app/PickerActivity.java
+++ b/src/com/android/gallery3d/app/PickerActivity.java
@@ -25,7 +25,6 @@
 import android.view.Window;
 
 import com.android.gallery3d.R;
-import com.android.gallery3d.ui.GLRoot;
 import com.android.gallery3d.ui.GLRootView;
 
 public class PickerActivity extends AbstractGalleryActivity
diff --git a/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java b/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java
index f5b22d1..6885456 100644
--- a/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java
+++ b/src/com/android/gallery3d/app/SinglePhotoDataAdapter.java
@@ -84,6 +84,7 @@
 
     private FutureListener<BitmapRegionDecoder> mLargeListener =
             new FutureListener<BitmapRegionDecoder>() {
+        @Override
         public void onFutureDone(Future<BitmapRegionDecoder> future) {
             BitmapRegionDecoder decoder = future.get();
             if (decoder == null) return;
@@ -100,12 +101,14 @@
 
     private FutureListener<Bitmap> mThumbListener =
             new FutureListener<Bitmap>() {
+        @Override
         public void onFutureDone(Future<Bitmap> future) {
             mHandler.sendMessage(
                     mHandler.obtainMessage(MSG_UPDATE_IMAGE, future));
         }
     };
 
+    @Override
     public boolean isEmpty() {
         return false;
     }
@@ -137,6 +140,7 @@
         }
     }
 
+    @Override
     public void resume() {
         if (mTask == null) {
             if (mHasFullImage) {
@@ -150,6 +154,7 @@
         }
     }
 
+    @Override
     public void pause() {
         Future<?> task = mTask;
         task.cancel();
diff --git a/src/com/android/gallery3d/app/SlideshowDataAdapter.java b/src/com/android/gallery3d/app/SlideshowDataAdapter.java
index 7c934ee..7a0fba5 100644
--- a/src/com/android/gallery3d/app/SlideshowDataAdapter.java
+++ b/src/com/android/gallery3d/app/SlideshowDataAdapter.java
@@ -92,6 +92,7 @@
     }
 
     private class ReloadTask implements Job<Void> {
+        @Override
         public Void run(JobContext jc) {
             while (true) {
                 synchronized (SlideshowDataAdapter.this) {
@@ -145,6 +146,7 @@
     }
 
     private class SourceListener implements ContentListener {
+        @Override
         public void onContentDirty() {
             synchronized (SlideshowDataAdapter.this) {
                 mNeedReload.set(true);
@@ -168,8 +170,10 @@
         return mImageQueue.removeFirst();
     }
 
+    @Override
     public Future<Slide> nextSlide(FutureListener<Slide> listener) {
         return mThreadPool.submit(new Job<Slide>() {
+            @Override
             public Slide run(JobContext jc) {
                 jc.setMode(ThreadPool.MODE_NONE);
                 return innerNextBitmap();
@@ -177,6 +181,7 @@
         }, listener);
     }
 
+    @Override
     public void pause() {
         synchronized (this) {
             mIsActive = false;
@@ -188,6 +193,7 @@
         mReloadTask = null;
     }
 
+    @Override
     public synchronized void resume() {
         mIsActive = true;
         mSource.addContentListener(mSourceListener);
diff --git a/src/com/android/gallery3d/app/SlideshowPage.java b/src/com/android/gallery3d/app/SlideshowPage.java
index a6ae527..5ec447f 100644
--- a/src/com/android/gallery3d/app/SlideshowPage.java
+++ b/src/com/android/gallery3d/app/SlideshowPage.java
@@ -134,6 +134,7 @@
 
     private void loadNextBitmap() {
         mModel.nextSlide(new FutureListener<Slide>() {
+            @Override
             public void onFutureDone(Future<Slide> future) {
                 mPendingSlide = future.get();
                 mHandler.sendEmptyMessage(MSG_SHOW_PENDING_BITMAP);
@@ -242,10 +243,12 @@
             mRepeat = repeat;
         }
 
+        @Override
         public int findItemIndex(Path path, int hint) {
             return hint;
         }
 
+        @Override
         public MediaItem getMediaItem(int index) {
             if (!mRepeat && index >= mOrder.length) return null;
             if (mOrder.length == 0) return null;
@@ -259,6 +262,7 @@
             return item;
         }
 
+        @Override
         public long reload() {
             long version = mMediaSet.reload();
             if (version != mSourceVersion) {
@@ -284,10 +288,12 @@
             }
         }
 
+        @Override
         public void addContentListener(ContentListener listener) {
             mMediaSet.addContentListener(listener);
         }
 
+        @Override
         public void removeContentListener(ContentListener listener) {
             mMediaSet.removeContentListener(listener);
         }
@@ -307,10 +313,12 @@
             mRepeat = repeat;
         }
 
+        @Override
         public int findItemIndex(Path path, int hint) {
             return mMediaSet.getIndexOfItem(path, hint);
         }
 
+        @Override
         public MediaItem getMediaItem(int index) {
             int dataEnd = mDataStart + mData.size();
 
@@ -328,6 +336,7 @@
             return (index < mDataStart || index >= dataEnd) ? null : mData.get(index - mDataStart);
         }
 
+        @Override
         public long reload() {
             long version = mMediaSet.reload();
             if (version != mDataVersion) {
@@ -337,10 +346,12 @@
             return mDataVersion;
         }
 
+        @Override
         public void addContentListener(ContentListener listener) {
             mMediaSet.addContentListener(listener);
         }
 
+        @Override
         public void removeContentListener(ContentListener listener) {
             mMediaSet.removeContentListener(listener);
         }
diff --git a/src/com/android/gallery3d/data/BitmapPool.java b/src/com/android/gallery3d/data/BitmapPool.java
index 1151dde..5bc6d67 100644
--- a/src/com/android/gallery3d/data/BitmapPool.java
+++ b/src/com/android/gallery3d/data/BitmapPool.java
@@ -23,6 +23,7 @@
 import java.util.ArrayList;
 
 public class BitmapPool {
+    @SuppressWarnings("unused")
     private static final String TAG = "BitmapPool";
 
     private final ArrayList<Bitmap> mPool;
diff --git a/src/com/android/gallery3d/data/ClusterAlbum.java b/src/com/android/gallery3d/data/ClusterAlbum.java
index 569e5a4..8681952 100644
--- a/src/com/android/gallery3d/data/ClusterAlbum.java
+++ b/src/com/android/gallery3d/data/ClusterAlbum.java
@@ -19,6 +19,7 @@
 import java.util.ArrayList;
 
 public class ClusterAlbum extends MediaSet implements ContentListener {
+    @SuppressWarnings("unused")
     private static final String TAG = "ClusterAlbum";
     private ArrayList<Path> mPaths = new ArrayList<Path>();
     private String mName = "";
@@ -80,6 +81,7 @@
         ArrayList<Path> subset = new ArrayList<Path>(paths.subList(start, end));
         final MediaItem[] buf = new MediaItem[end - start];
         ItemConsumer consumer = new ItemConsumer() {
+            @Override
             public void consume(int index, MediaItem item) {
                 buf[index] = item;
             }
@@ -111,6 +113,7 @@
         return mDataVersion;
     }
 
+    @Override
     public void onContentDirty() {
         notifyContentChanged();
     }
@@ -123,6 +126,7 @@
     @Override
     public void delete() {
         ItemConsumer consumer = new ItemConsumer() {
+            @Override
             public void consume(int index, MediaItem item) {
                 if ((item.getSupportedOperations() & SUPPORT_DELETE) != 0) {
                     item.delete();
diff --git a/src/com/android/gallery3d/data/ClusterAlbumSet.java b/src/com/android/gallery3d/data/ClusterAlbumSet.java
index 863e94a..a32ba87 100644
--- a/src/com/android/gallery3d/data/ClusterAlbumSet.java
+++ b/src/com/android/gallery3d/data/ClusterAlbumSet.java
@@ -25,6 +25,7 @@
 import java.util.HashSet;
 
 public class ClusterAlbumSet extends MediaSet implements ContentListener {
+    @SuppressWarnings("unused")
     private static final String TAG = "ClusterAlbumSet";
     private GalleryApp mApplication;
     private MediaSet mBaseSet;
@@ -70,6 +71,7 @@
         return mDataVersion;
     }
 
+    @Override
     public void onContentDirty() {
         notifyContentChanged();
     }
@@ -125,6 +127,7 @@
     private void updateClustersContents() {
         final HashSet<Path> existing = new HashSet<Path>();
         mBaseSet.enumerateTotalMediaItems(new MediaSet.ItemConsumer() {
+            @Override
             public void consume(int index, MediaItem item) {
                 existing.add(item.getPath());
             }
diff --git a/src/com/android/gallery3d/data/ComboAlbum.java b/src/com/android/gallery3d/data/ComboAlbum.java
index 73c8ef3..e100dc3 100644
--- a/src/com/android/gallery3d/data/ComboAlbum.java
+++ b/src/com/android/gallery3d/data/ComboAlbum.java
@@ -24,6 +24,7 @@
 // from the input albums.
 // This only handles SubMediaSets, not MediaItems. (That's all we need now)
 public class ComboAlbum extends MediaSet implements ContentListener {
+    @SuppressWarnings("unused")
     private static final String TAG = "ComboAlbum";
     private final MediaSet[] mSets;
     private final String mName;
@@ -86,6 +87,7 @@
         return mDataVersion;
     }
 
+    @Override
     public void onContentDirty() {
         notifyContentChanged();
     }
diff --git a/src/com/android/gallery3d/data/ComboAlbumSet.java b/src/com/android/gallery3d/data/ComboAlbumSet.java
index 6d9a2a3..3f36745 100644
--- a/src/com/android/gallery3d/data/ComboAlbumSet.java
+++ b/src/com/android/gallery3d/data/ComboAlbumSet.java
@@ -24,6 +24,7 @@
 // media sets from the input album sets.
 // This only handles SubMediaSets, not MediaItems. (That's all we need now)
 public class ComboAlbumSet extends MediaSet implements ContentListener {
+    @SuppressWarnings("unused")
     private static final String TAG = "ComboAlbumSet";
     private final MediaSet[] mSets;
     private final String mName;
@@ -83,6 +84,7 @@
         return mDataVersion;
     }
 
+    @Override
     public void onContentDirty() {
         notifyContentChanged();
     }
diff --git a/src/com/android/gallery3d/data/DataManager.java b/src/com/android/gallery3d/data/DataManager.java
index 9ffdc0b..9485b02 100644
--- a/src/com/android/gallery3d/data/DataManager.java
+++ b/src/com/android/gallery3d/data/DataManager.java
@@ -88,6 +88,7 @@
             new DateTakenComparator();
 
     private static class DateTakenComparator implements Comparator<MediaItem> {
+        @Override
         public int compare(MediaItem item1, MediaItem item2) {
             return -Utils.compare(item1.getDateInMs(), item2.getDateInMs());
         }
diff --git a/src/com/android/gallery3d/data/DownloadCache.java b/src/com/android/gallery3d/data/DownloadCache.java
index 7505dac..be7820b 100644
--- a/src/com/android/gallery3d/data/DownloadCache.java
+++ b/src/com/android/gallery3d/data/DownloadCache.java
@@ -282,6 +282,7 @@
             mProxySet.add(proxy);
         }
 
+        @Override
         public void onFutureDone(Future<File> future) {
             File file = future.get();
             long id = 0;
@@ -310,6 +311,7 @@
             }
         }
 
+        @Override
         public File run(JobContext jc) {
             // TODO: utilize etag
             jc.setMode(ThreadPool.MODE_NETWORK);
@@ -345,6 +347,7 @@
 
         public synchronized Entry get(JobContext jc) {
             jc.setCancelListener(new CancelListener() {
+                @Override
                 public void onCancel() {
                     mTask.removeProxy(TaskProxy.this);
                     synchronized (TaskProxy.this) {
diff --git a/src/com/android/gallery3d/data/DownloadUtils.java b/src/com/android/gallery3d/data/DownloadUtils.java
index 9e35c45..137898e 100644
--- a/src/com/android/gallery3d/data/DownloadUtils.java
+++ b/src/com/android/gallery3d/data/DownloadUtils.java
@@ -49,6 +49,7 @@
         int rc = is.read(buffer, 0, buffer.length);
         final Thread thread = Thread.currentThread();
         jc.setCancelListener(new CancelListener() {
+            @Override
             public void onCancel() {
                 thread.interrupt();
             }
diff --git a/src/com/android/gallery3d/data/Face.java b/src/com/android/gallery3d/data/Face.java
index 29af27f..d2dc22b 100644
--- a/src/com/android/gallery3d/data/Face.java
+++ b/src/com/android/gallery3d/data/Face.java
@@ -58,6 +58,7 @@
         return false;
     }
 
+    @Override
     public int compareTo(Face another) {
         return mName.compareTo(another.mName);
     }
diff --git a/src/com/android/gallery3d/data/FaceClustering.java b/src/com/android/gallery3d/data/FaceClustering.java
index 126286c..819915e 100644
--- a/src/com/android/gallery3d/data/FaceClustering.java
+++ b/src/com/android/gallery3d/data/FaceClustering.java
@@ -94,6 +94,7 @@
         final FaceCluster untagged = new FaceCluster(mUntaggedString);
 
         baseSet.enumerateTotalMediaItems(new MediaSet.ItemConsumer() {
+            @Override
             public void consume(int index, MediaItem item) {
                 Face[] faces = item.getFaces();
                 if (faces == null || faces.length == 0) {
diff --git a/src/com/android/gallery3d/data/FilterDeleteSet.java b/src/com/android/gallery3d/data/FilterDeleteSet.java
index dbd85d5..2738387 100644
--- a/src/com/android/gallery3d/data/FilterDeleteSet.java
+++ b/src/com/android/gallery3d/data/FilterDeleteSet.java
@@ -28,6 +28,7 @@
 // int getNumberOfDeletions();
 //
 public class FilterDeleteSet extends MediaSet implements ContentListener {
+    @SuppressWarnings("unused")
     private static final String TAG = "FilterDeleteSet";
 
     private static final int REQUEST_ADD = 1;
diff --git a/src/com/android/gallery3d/data/FilterSource.java b/src/com/android/gallery3d/data/FilterSource.java
index b3e6ee3..e3f350f 100644
--- a/src/com/android/gallery3d/data/FilterSource.java
+++ b/src/com/android/gallery3d/data/FilterSource.java
@@ -19,6 +19,7 @@
 import com.android.gallery3d.app.GalleryApp;
 
 class FilterSource extends MediaSource {
+    @SuppressWarnings("unused")
     private static final String TAG = "FilterSource";
     private static final int FILTER_BY_MEDIATYPE = 0;
     private static final int FILTER_BY_DELETE = 1;
diff --git a/src/com/android/gallery3d/data/FilterTypeSet.java b/src/com/android/gallery3d/data/FilterTypeSet.java
index 1983a39..477ef73 100644
--- a/src/com/android/gallery3d/data/FilterTypeSet.java
+++ b/src/com/android/gallery3d/data/FilterTypeSet.java
@@ -100,6 +100,7 @@
         final Path[] buf = new Path[total];
 
         mBaseSet.enumerateMediaItems(new MediaSet.ItemConsumer() {
+            @Override
             public void consume(int index, MediaItem item) {
                 if (item.getMediaType() == mMediaType) {
                     if (index < 0 || index >= total) return;
@@ -124,6 +125,7 @@
     @Override
     public void delete() {
         ItemConsumer consumer = new ItemConsumer() {
+            @Override
             public void consume(int index, MediaItem item) {
                 if ((item.getSupportedOperations() & SUPPORT_DELETE) != 0) {
                     item.delete();
diff --git a/src/com/android/gallery3d/data/LocalImage.java b/src/com/android/gallery3d/data/LocalImage.java
index c432ab4..370ef26 100644
--- a/src/com/android/gallery3d/data/LocalImage.java
+++ b/src/com/android/gallery3d/data/LocalImage.java
@@ -218,6 +218,7 @@
             mLocalFilePath = localFilePath;
         }
 
+        @Override
         public BitmapRegionDecoder run(JobContext jc) {
             return DecodeUtils.createBitmapRegionDecoder(jc, mLocalFilePath, false);
         }
diff --git a/src/com/android/gallery3d/data/LocalMediaItem.java b/src/com/android/gallery3d/data/LocalMediaItem.java
index 7a54e80..fdc973e 100644
--- a/src/com/android/gallery3d/data/LocalMediaItem.java
+++ b/src/com/android/gallery3d/data/LocalMediaItem.java
@@ -99,6 +99,7 @@
         return mimeType;
     }
 
+    @Override
     public long getSize() {
         return fileSize;
     }
diff --git a/src/com/android/gallery3d/data/LocalSource.java b/src/com/android/gallery3d/data/LocalSource.java
index 6735b16..a2e3d14 100644
--- a/src/com/android/gallery3d/data/LocalSource.java
+++ b/src/com/android/gallery3d/data/LocalSource.java
@@ -245,6 +245,7 @@
 
     // This is a comparator which compares the suffix number in two Paths.
     private static class IdComparator implements Comparator<PathId> {
+        @Override
         public int compare(PathId p1, PathId p2) {
             String s1 = p1.path.getSuffix();
             String s2 = p2.path.getSuffix();
diff --git a/src/com/android/gallery3d/data/LocationClustering.java b/src/com/android/gallery3d/data/LocationClustering.java
index b36bd63..540322a 100644
--- a/src/com/android/gallery3d/data/LocationClustering.java
+++ b/src/com/android/gallery3d/data/LocationClustering.java
@@ -29,6 +29,7 @@
 import java.util.ArrayList;
 
 class LocationClustering extends Clustering {
+    @SuppressWarnings("unused")
     private static final String TAG = "LocationClustering";
 
     private static final int MIN_GROUPS = 1;
@@ -70,6 +71,7 @@
         // Separate items to two sets: with or without lat-long.
         final double[] latLong = new double[2];
         baseSet.enumerateTotalMediaItems(new MediaSet.ItemConsumer() {
+            @Override
             public void consume(int index, MediaItem item) {
                 if (index < 0 || index >= total) return;
                 SmallItem s = new SmallItem();
@@ -137,6 +139,7 @@
 
         if (hasUnresolvedAddress) {
             mHandler.post(new Runnable() {
+                @Override
                 public void run() {
                     Toast.makeText(mContext, R.string.no_connectivity,
                             Toast.LENGTH_LONG).show();
diff --git a/src/com/android/gallery3d/data/MediaDetails.java b/src/com/android/gallery3d/data/MediaDetails.java
index c18365d..2982247 100644
--- a/src/com/android/gallery3d/data/MediaDetails.java
+++ b/src/com/android/gallery3d/data/MediaDetails.java
@@ -88,6 +88,7 @@
         return mDetails.size();
     }
 
+    @Override
     public Iterator<Entry<Integer, Object>> iterator() {
         return mDetails.entrySet().iterator();
     }
diff --git a/src/com/android/gallery3d/data/MediaSet.java b/src/com/android/gallery3d/data/MediaSet.java
index 67525b1..d5d1048 100644
--- a/src/com/android/gallery3d/data/MediaSet.java
+++ b/src/com/android/gallery3d/data/MediaSet.java
@@ -32,6 +32,7 @@
 // getTotalMediaItemCount() returns the number of all MediaItems, including
 // those in sub-MediaSets.
 public abstract class MediaSet extends MediaObject {
+    @SuppressWarnings("unused")
     private static final String TAG = "MediaSet";
 
     public static final int MEDIAITEM_BATCH_FETCH_COUNT = 500;
@@ -270,6 +271,7 @@
     }
 
     private class MultiSetSyncFuture implements Future<Integer>, SyncListener {
+        @SuppressWarnings("hiding")
         private static final String TAG = "Gallery.MultiSetSync";
 
         private final SyncListener mListener;
diff --git a/src/com/android/gallery3d/data/MtpClient.java b/src/com/android/gallery3d/data/MtpClient.java
index dd65f9e..737b5b6 100644
--- a/src/com/android/gallery3d/data/MtpClient.java
+++ b/src/com/android/gallery3d/data/MtpClient.java
@@ -179,7 +179,7 @@
      * Opens the {@link android.hardware.usb.UsbDevice} for an MTP or PTP
      * device and return an {@link android.mtp.MtpDevice} for it.
      *
-     * @param device the device to open
+     * @param usbDevice the device to open
      * @return an MtpDevice for the device.
      */
     private MtpDevice openDeviceLocked(UsbDevice usbDevice) {
@@ -220,7 +220,7 @@
     }
 
     /**
-     * Registers a {@link android.mtp.MtpClient.Listener} interface to receive
+     * Registers a {@link com.android.gallery3d.data.MtpClient.Listener} interface to receive
      * notifications when MTP or PTP devices are added or removed.
      *
      * @param listener the listener to register
@@ -234,7 +234,7 @@
     }
 
     /**
-     * Unregisters a {@link android.mtp.MtpClient.Listener} interface.
+     * Unregisters a {@link com.android.gallery3d.data.MtpClient.Listener} interface.
      *
      * @param listener the listener to unregister
      */
diff --git a/src/com/android/gallery3d/data/MtpContext.java b/src/com/android/gallery3d/data/MtpContext.java
index 056211c..53b6faa 100644
--- a/src/com/android/gallery3d/data/MtpContext.java
+++ b/src/com/android/gallery3d/data/MtpContext.java
@@ -81,11 +81,13 @@
         notifyDirty();
     }
 
+    @Override
     public void deviceAdded(android.mtp.MtpDevice device) {
         notifyDirty();
         showToast(R.string.camera_connected);
     }
 
+    @Override
     public void deviceRemoved(android.mtp.MtpDevice device) {
         notifyDirty();
         showToast(R.string.camera_disconnected);
diff --git a/src/com/android/gallery3d/data/MtpImage.java b/src/com/android/gallery3d/data/MtpImage.java
index 1d0f88d..801a1d2 100644
--- a/src/com/android/gallery3d/data/MtpImage.java
+++ b/src/com/android/gallery3d/data/MtpImage.java
@@ -80,6 +80,7 @@
     @Override
     public Job<Bitmap> requestImage(int type) {
         return new Job<Bitmap>() {
+            @Override
             public Bitmap run(JobContext jc) {
                 byte[] thumbnail = mMtpContext.getMtpClient().getThumbnail(
                         UsbDevice.getDeviceName(mDeviceId), mObjectId);
@@ -95,6 +96,7 @@
     @Override
     public Job<BitmapRegionDecoder> requestLargeImage() {
         return new Job<BitmapRegionDecoder>() {
+            @Override
             public BitmapRegionDecoder run(JobContext jc) {
                 byte[] bytes = mMtpContext.getMtpClient().getObject(
                         UsbDevice.getDeviceName(mDeviceId), mObjectId, mObjectSize);
diff --git a/src/com/android/gallery3d/data/MtpSource.java b/src/com/android/gallery3d/data/MtpSource.java
index aaf50ad..47a2e6c 100644
--- a/src/com/android/gallery3d/data/MtpSource.java
+++ b/src/com/android/gallery3d/data/MtpSource.java
@@ -19,6 +19,7 @@
 import com.android.gallery3d.app.GalleryApp;
 
 public class MtpSource extends MediaSource {
+    @SuppressWarnings("unused")
     private static final String TAG = "MtpSource";
 
     private static final int MTP_DEVICESET = 0;
diff --git a/src/com/android/gallery3d/data/SizeClustering.java b/src/com/android/gallery3d/data/SizeClustering.java
index 2dbe49d..0bde55e 100644
--- a/src/com/android/gallery3d/data/SizeClustering.java
+++ b/src/com/android/gallery3d/data/SizeClustering.java
@@ -53,6 +53,7 @@
         final ArrayList<Path>[] group =
                 (ArrayList<Path>[]) new ArrayList[SIZE_LEVELS.length];
         baseSet.enumerateTotalMediaItems(new MediaSet.ItemConsumer() {
+            @Override
             public void consume(int index, MediaItem item) {
                 // Find the cluster this item belongs to.
                 long size = item.getSize();
diff --git a/src/com/android/gallery3d/data/SnailAlbum.java b/src/com/android/gallery3d/data/SnailAlbum.java
index cd4f803..18905fb 100644
--- a/src/com/android/gallery3d/data/SnailAlbum.java
+++ b/src/com/android/gallery3d/data/SnailAlbum.java
@@ -21,6 +21,7 @@
 
 // This is a simple MediaSet which contains only one MediaItem -- a SnailItem.
 public class SnailAlbum extends MediaSet {
+    @SuppressWarnings("unused")
     private static final String TAG = "SnailAlbum";
     private SnailItem mItem;
     private AtomicBoolean mDirty = new AtomicBoolean(false);
diff --git a/src/com/android/gallery3d/data/SnailItem.java b/src/com/android/gallery3d/data/SnailItem.java
index fdb1b0d..3586d2c 100644
--- a/src/com/android/gallery3d/data/SnailItem.java
+++ b/src/com/android/gallery3d/data/SnailItem.java
@@ -27,6 +27,7 @@
 // used so we can show an foreign component (like an
 // android.view.View) instead of a Bitmap.
 public class SnailItem extends MediaItem {
+    @SuppressWarnings("unused")
     private static final String TAG = "SnailItem";
     private ScreenNail mScreenNail;
 
@@ -38,6 +39,7 @@
     public Job<Bitmap> requestImage(int type) {
         // nothing to return
         return new Job<Bitmap>() {
+            @Override
             public Bitmap run(JobContext jc) {
                 return null;
             }
@@ -48,6 +50,7 @@
     public Job<BitmapRegionDecoder> requestLargeImage() {
         // nothing to return
         return new Job<BitmapRegionDecoder>() {
+            @Override
             public BitmapRegionDecoder run(JobContext jc) {
                 return null;
             }
diff --git a/src/com/android/gallery3d/data/SnailSource.java b/src/com/android/gallery3d/data/SnailSource.java
index 5f663d2..7f971d3 100644
--- a/src/com/android/gallery3d/data/SnailSource.java
+++ b/src/com/android/gallery3d/data/SnailSource.java
@@ -18,6 +18,7 @@
 import com.android.gallery3d.app.GalleryApp;
 
 public class SnailSource extends MediaSource {
+    @SuppressWarnings("unused")
     private static final String TAG = "SnailSource";
     private static final int SNAIL_ALBUM = 0;
     private static final int SNAIL_ITEM = 1;
diff --git a/src/com/android/gallery3d/data/TagClustering.java b/src/com/android/gallery3d/data/TagClustering.java
index 849f885..407ca84 100644
--- a/src/com/android/gallery3d/data/TagClustering.java
+++ b/src/com/android/gallery3d/data/TagClustering.java
@@ -43,6 +43,7 @@
         final ArrayList<Path> untagged = new ArrayList<Path>();
 
         baseSet.enumerateTotalMediaItems(new MediaSet.ItemConsumer() {
+            @Override
             public void consume(int index, MediaItem item) {
                 Path path = item.getPath();
 
diff --git a/src/com/android/gallery3d/data/TimeClustering.java b/src/com/android/gallery3d/data/TimeClustering.java
index 9a0ae1d..35cbab1 100644
--- a/src/com/android/gallery3d/data/TimeClustering.java
+++ b/src/com/android/gallery3d/data/TimeClustering.java
@@ -28,6 +28,7 @@
 import java.util.Comparator;
 
 public class TimeClustering extends Clustering {
+    @SuppressWarnings("unused")
     private static final String TAG = "TimeClustering";
 
     // If 2 items are greater than 25 miles apart, they will be in different
@@ -83,6 +84,7 @@
             new DateComparator();
 
     private static class DateComparator implements Comparator<SmallItem> {
+        @Override
         public int compare(SmallItem item1, SmallItem item2) {
             return -Utils.compare(item1.dateInMs, item2.dateInMs);
         }
@@ -101,6 +103,7 @@
         final double[] latLng = new double[2];
 
         baseSet.enumerateTotalMediaItems(new MediaSet.ItemConsumer() {
+            @Override
             public void consume(int index, MediaItem item) {
                 if (index < 0 || index >= total) return;
                 SmallItem s = new SmallItem();
diff --git a/src/com/android/gallery3d/data/UriImage.java b/src/com/android/gallery3d/data/UriImage.java
index b5bfe96..8fc873e 100644
--- a/src/com/android/gallery3d/data/UriImage.java
+++ b/src/com/android/gallery3d/data/UriImage.java
@@ -134,6 +134,7 @@
 
     private boolean prepareInputFile(JobContext jc) {
         jc.setCancelListener(new CancelListener() {
+            @Override
             public void onCancel() {
                 synchronized (this) {
                     notifyAll();
@@ -166,6 +167,7 @@
     }
 
     private class RegionDecoderJob implements Job<BitmapRegionDecoder> {
+        @Override
         public BitmapRegionDecoder run(JobContext jc) {
             if (!prepareInputFile(jc)) return null;
             BitmapRegionDecoder decoder = DecodeUtils.createBitmapRegionDecoder(
diff --git a/src/com/android/gallery3d/gadget/LocalPhotoSource.java b/src/com/android/gallery3d/gadget/LocalPhotoSource.java
index 6ec41f6..4e94e8d 100644
--- a/src/com/android/gallery3d/gadget/LocalPhotoSource.java
+++ b/src/com/android/gallery3d/gadget/LocalPhotoSource.java
@@ -41,6 +41,7 @@
 
 public class LocalPhotoSource implements WidgetSource {
 
+    @SuppressWarnings("unused")
     private static final String TAG = "LocalPhotoSource";
 
     private static final int MAX_PHOTO_COUNT = 128;
@@ -77,6 +78,7 @@
                 .registerContentObserver(CONTENT_URI, true, mContentObserver);
     }
 
+    @Override
     public void close() {
         mContext.getContentResolver().unregisterContentObserver(mContentObserver);
     }
@@ -152,6 +154,7 @@
         }
     }
 
+    @Override
     public void reload() {
         if (!mContentDirty) return;
         mContentDirty = false;
diff --git a/src/com/android/gallery3d/gadget/MediaSetSource.java b/src/com/android/gallery3d/gadget/MediaSetSource.java
index 786092b..caeff2a 100644
--- a/src/com/android/gallery3d/gadget/MediaSetSource.java
+++ b/src/com/android/gallery3d/gadget/MediaSetSource.java
@@ -32,6 +32,7 @@
 public class MediaSetSource implements WidgetSource, ContentListener {
     private static final int CACHE_SIZE = 32;
 
+    @SuppressWarnings("unused")
     private static final String TAG = "MediaSetSource";
 
     private MediaSet mSource;
diff --git a/src/com/android/gallery3d/gadget/WidgetService.java b/src/com/android/gallery3d/gadget/WidgetService.java
index 83e37a6..334b15a 100644
--- a/src/com/android/gallery3d/gadget/WidgetService.java
+++ b/src/com/android/gallery3d/gadget/WidgetService.java
@@ -120,22 +120,27 @@
             mSource = null;
         }
 
+        @Override
         public int getCount() {
             return mSource.size();
         }
 
+        @Override
         public long getItemId(int position) {
             return position;
         }
 
+        @Override
         public int getViewTypeCount() {
             return 1;
         }
 
+        @Override
         public boolean hasStableIds() {
             return true;
         }
 
+        @Override
         public RemoteViews getLoadingView() {
             RemoteViews rv = new RemoteViews(
                     mApp.getAndroidContext().getPackageName(),
@@ -144,6 +149,7 @@
             return rv;
         }
 
+        @Override
         public RemoteViews getViewAt(int position) {
             Bitmap bitmap = mSource.getImage(position);
             if (bitmap == null) return getLoadingView();
diff --git a/src/com/android/gallery3d/onetimeinitializer/GalleryWidgetMigrator.java b/src/com/android/gallery3d/onetimeinitializer/GalleryWidgetMigrator.java
index 4d85baa..0187cba 100644
--- a/src/com/android/gallery3d/onetimeinitializer/GalleryWidgetMigrator.java
+++ b/src/com/android/gallery3d/onetimeinitializer/GalleryWidgetMigrator.java
@@ -23,7 +23,6 @@
 import android.util.Log;
 
 import com.android.gallery3d.app.GalleryApp;
-import com.android.gallery3d.common.Utils;
 import com.android.gallery3d.data.DataManager;
 import com.android.gallery3d.data.LocalAlbum;
 import com.android.gallery3d.data.MediaSet;
diff --git a/src/com/android/gallery3d/ui/ActionModeHandler.java b/src/com/android/gallery3d/ui/ActionModeHandler.java
index 80d2500..0b5cd54 100644
--- a/src/com/android/gallery3d/ui/ActionModeHandler.java
+++ b/src/com/android/gallery3d/ui/ActionModeHandler.java
@@ -51,6 +51,7 @@
 
 public class ActionModeHandler implements
         ActionMode.Callback, PopupList.OnPopupItemClickListener {
+    @SuppressWarnings("unused")
     private static final String TAG = "ActionModeHandler";
     private static final int SUPPORT_MULTIPLE_MASK = MediaObject.SUPPORT_DELETE
             | MediaObject.SUPPORT_ROTATE | MediaObject.SUPPORT_SHARE
@@ -161,12 +162,14 @@
         mSelectionMenu.updateSelectAllMode(mSelectionManager.inSelectAllMode());
     }
 
+    @Override
     public boolean onCreateActionMode(ActionMode mode, Menu menu) {
         MenuInflater inflater = mode.getMenuInflater();
         inflater.inflate(R.menu.operation, menu);
 
         mShareActionProvider = GalleryActionBar.initializeShareActionProvider(menu);
         OnShareTargetSelectedListener listener = new OnShareTargetSelectedListener() {
+            @Override
             public boolean onShareTargetSelected(ShareActionProvider source, Intent intent) {
                 mSelectionManager.leaveSelectionMode();
                 return false;
@@ -178,10 +181,12 @@
         return true;
     }
 
+    @Override
     public void onDestroyActionMode(ActionMode mode) {
         mSelectionManager.leaveSelectionMode();
     }
 
+    @Override
     public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
         return true;
     }
@@ -291,6 +296,7 @@
         // Generate sharing intent and update supported operations in the background
         // The task can take a long time and be canceled in the mean time.
         mMenuTask = mActivity.getThreadPool().submit(new Job<Void>() {
+            @Override
             public Void run(final JobContext jc) {
                 // Pass1: Deal with unexpanded media object list for menu operation.
                 final int operation = computeMenuOptions(jc);
@@ -298,6 +304,7 @@
                 // Pass2: Deal with expanded media object list for sharing operation.
                 final Intent intent = supportShare ? computeSharingIntent(jc) : null;
                 mMainHandler.post(new Runnable() {
+                    @Override
                     public void run() {
                         mMenuTask = null;
                         if (!jc.isCancelled()) {
diff --git a/src/com/android/gallery3d/ui/BasicTexture.java b/src/com/android/gallery3d/ui/BasicTexture.java
index 7855927..784b499 100644
--- a/src/com/android/gallery3d/ui/BasicTexture.java
+++ b/src/com/android/gallery3d/ui/BasicTexture.java
@@ -87,10 +87,12 @@
         return mId;
     }
 
+    @Override
     public int getWidth() {
         return mWidth;
     }
 
+    @Override
     public int getHeight() {
         return mHeight;
     }
@@ -124,10 +126,12 @@
         mHasBorder = hasBorder;
     }
 
+    @Override
     public void draw(GLCanvas canvas, int x, int y) {
         canvas.drawTexture(this, x, y, getWidth(), getHeight());
     }
 
+    @Override
     public void draw(GLCanvas canvas, int x, int y, int w, int h) {
         canvas.drawTexture(this, x, y, w, h);
     }
diff --git a/src/com/android/gallery3d/ui/BitmapScreenNail.java b/src/com/android/gallery3d/ui/BitmapScreenNail.java
index 0043e0c..6cb36b0 100644
--- a/src/com/android/gallery3d/ui/BitmapScreenNail.java
+++ b/src/com/android/gallery3d/ui/BitmapScreenNail.java
@@ -31,6 +31,7 @@
 // - When the the bitmap is available, and we have drawn the placeholder color
 // before, we will do a fade-in animation.
 public class BitmapScreenNail implements ScreenNail {
+    @SuppressWarnings("unused")
     private static final String TAG = "BitmapScreenNail";
     private static final int PLACEHOLDER_COLOR = 0xFF222222;
     // The duration of the fading animation in milliseconds
diff --git a/src/com/android/gallery3d/ui/CacheStorageUsageInfo.java b/src/com/android/gallery3d/ui/CacheStorageUsageInfo.java
index c65d77e..611648a 100644
--- a/src/com/android/gallery3d/ui/CacheStorageUsageInfo.java
+++ b/src/com/android/gallery3d/ui/CacheStorageUsageInfo.java
@@ -25,6 +25,7 @@
 import java.io.File;
 
 public class CacheStorageUsageInfo {
+    @SuppressWarnings("unused")
     private static final String TAG = "CacheStorageUsageInfo";
 
     // number of bytes the storage has.
diff --git a/src/com/android/gallery3d/ui/ColorTexture.java b/src/com/android/gallery3d/ui/ColorTexture.java
index 24e8914..733c056 100644
--- a/src/com/android/gallery3d/ui/ColorTexture.java
+++ b/src/com/android/gallery3d/ui/ColorTexture.java
@@ -31,14 +31,17 @@
         mHeight = 1;
     }
 
+    @Override
     public void draw(GLCanvas canvas, int x, int y) {
         draw(canvas, x, y, mWidth, mHeight);
     }
 
+    @Override
     public void draw(GLCanvas canvas, int x, int y, int w, int h) {
         canvas.fillRect(x, y, w, h, mColor);
     }
 
+    @Override
     public boolean isOpaque() {
         return Utils.isOpaque(mColor);
     }
@@ -48,10 +51,12 @@
         mHeight = height;
     }
 
+    @Override
     public int getWidth() {
         return mWidth;
     }
 
+    @Override
     public int getHeight() {
         return mHeight;
     }
diff --git a/src/com/android/gallery3d/ui/CropView.java b/src/com/android/gallery3d/ui/CropView.java
index 78d5d37..8c2c3df 100644
--- a/src/com/android/gallery3d/ui/CropView.java
+++ b/src/com/android/gallery3d/ui/CropView.java
@@ -44,6 +44,7 @@
  * The activity can crop specific region of interest from an image.
  */
 public class CropView extends GLView {
+    @SuppressWarnings("unused")
     private static final String TAG = "CropView";
 
     private static final int FACE_PIXEL_COUNT = 120000; // around 400x300
diff --git a/src/com/android/gallery3d/ui/DetailsAddressResolver.java b/src/com/android/gallery3d/ui/DetailsAddressResolver.java
index f543923..3dd20a5 100644
--- a/src/com/android/gallery3d/ui/DetailsAddressResolver.java
+++ b/src/com/android/gallery3d/ui/DetailsAddressResolver.java
@@ -43,6 +43,7 @@
             mLatlng = latlng;
         }
 
+        @Override
         public Address run(JobContext jc) {
             ReverseGeocoder geocoder = new ReverseGeocoder(mContext.getAndroidContext());
             return geocoder.lookupAddress(mLatlng[0], mLatlng[1], true);
@@ -63,10 +64,12 @@
         mAddressLookupJob = mContext.getThreadPool().submit(
                 new AddressLookupJob(latlng),
                 new FutureListener<Address>() {
+                    @Override
                     public void onFutureDone(final Future<Address> future) {
                         mAddressLookupJob = null;
                         if (!future.isCancelled()) {
                             mHandler.post(new Runnable() {
+                                @Override
                                 public void run() {
                                     updateLocation(future.get());
                                 }
diff --git a/src/com/android/gallery3d/ui/DialogDetailsView.java b/src/com/android/gallery3d/ui/DialogDetailsView.java
index c90ab40..a556600 100644
--- a/src/com/android/gallery3d/ui/DialogDetailsView.java
+++ b/src/com/android/gallery3d/ui/DialogDetailsView.java
@@ -59,15 +59,18 @@
         mSource = source;
     }
 
+    @Override
     public void show() {
         reloadDetails();
         mDialog.show();
     }
 
+    @Override
     public void hide() {
         mDialog.hide();
     }
 
+    @Override
     public void reloadDetails() {
         int index = mSource.setIndex();
         if (index == -1) return;
@@ -92,6 +95,7 @@
             .setView(detailsList)
             .setTitle(title)
             .setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {
+                @Override
                 public void onClick(DialogInterface dialog, int whichButton) {
                     mDialog.dismiss();
                 }
@@ -99,6 +103,7 @@
             .create();
 
         mDialog.setOnDismissListener(new OnDismissListener() {
+            @Override
             public void onDismiss(DialogInterface dialog) {
                 if (mListener != null) {
                     mListener.onClose();
@@ -198,18 +203,22 @@
             return false;
         }
 
+        @Override
         public int getCount() {
             return mItems.size();
         }
 
+        @Override
         public Object getItem(int position) {
             return mDetails.getDetail(position);
         }
 
+        @Override
         public long getItemId(int position) {
             return position;
         }
 
+        @Override
         public View getView(int position, View convertView, ViewGroup parent) {
             TextView tv;
             if (convertView == null) {
@@ -222,12 +231,14 @@
             return tv;
         }
 
+        @Override
         public void onAddressAvailable(String address) {
             mItems.set(mLocationIndex, address);
             notifyDataSetChanged();
         }
     }
 
+    @Override
     public void setCloseListener(CloseListener listener) {
         mListener = listener;
     }
diff --git a/src/com/android/gallery3d/ui/EdgeEffect.java b/src/com/android/gallery3d/ui/EdgeEffect.java
index 362b8fe..ed36973 100644
--- a/src/com/android/gallery3d/ui/EdgeEffect.java
+++ b/src/com/android/gallery3d/ui/EdgeEffect.java
@@ -51,6 +51,7 @@
  * {@link #draw(Canvas)} method.</p>
  */
 public class EdgeEffect {
+    @SuppressWarnings("unused")
     private static final String TAG = "EdgeEffect";
 
     // Time it will take the effect to fully recede in ms
diff --git a/src/com/android/gallery3d/ui/EdgeView.java b/src/com/android/gallery3d/ui/EdgeView.java
index bf97108..4aff049 100644
--- a/src/com/android/gallery3d/ui/EdgeView.java
+++ b/src/com/android/gallery3d/ui/EdgeView.java
@@ -21,6 +21,7 @@
 
 // EdgeView draws EdgeEffect (blue glow) at four sides of the view.
 public class EdgeView extends GLView {
+    @SuppressWarnings("unused")
     private static final String TAG = "EdgeView";
 
     public static final int INVALID_DIRECTION = -1;
diff --git a/src/com/android/gallery3d/ui/ExtTexture.java b/src/com/android/gallery3d/ui/ExtTexture.java
index 9319d8c..eac504f 100644
--- a/src/com/android/gallery3d/ui/ExtTexture.java
+++ b/src/com/android/gallery3d/ui/ExtTexture.java
@@ -77,6 +77,7 @@
         return mTarget;
     }
 
+    @Override
     public boolean isOpaque() {
         return true;
     }
diff --git a/src/com/android/gallery3d/ui/FlingScroller.java b/src/com/android/gallery3d/ui/FlingScroller.java
index 1cddcdb..6f98c64 100644
--- a/src/com/android/gallery3d/ui/FlingScroller.java
+++ b/src/com/android/gallery3d/ui/FlingScroller.java
@@ -26,6 +26,7 @@
 // (2) The duration is different.
 // (3) The deceleration curve is different.
 class FlingScroller {
+    @SuppressWarnings("unused")
     private static final String TAG = "FlingController";
 
     // The fling duration (in milliseconds) when velocity is 1 pixel/second
diff --git a/src/com/android/gallery3d/ui/GLCanvasImpl.java b/src/com/android/gallery3d/ui/GLCanvasImpl.java
index 45ea058..7b7a317 100644
--- a/src/com/android/gallery3d/ui/GLCanvasImpl.java
+++ b/src/com/android/gallery3d/ui/GLCanvasImpl.java
@@ -92,6 +92,7 @@
         initialize();
     }
 
+    @Override
     public void setSize(int width, int height) {
         Utils.assertTrue(width >= 0 && height >= 0);
 
@@ -119,15 +120,18 @@
         }
     }
 
+    @Override
     public void setAlpha(float alpha) {
         Utils.assertTrue(alpha >= 0 && alpha <= 1);
         mAlpha = alpha;
     }
 
+    @Override
     public float getAlpha() {
         return mAlpha;
     }
 
+    @Override
     public void multiplyAlpha(float alpha) {
         Utils.assertTrue(alpha >= 0 && alpha <= 1);
         mAlpha *= alpha;
@@ -166,6 +170,7 @@
         // mMatrixValues and mAlpha will be initialized in setSize()
     }
 
+    @Override
     public void drawRect(float x, float y, float width, float height, GLPaint paint) {
         GL11 gl = mGL;
 
@@ -183,6 +188,7 @@
         mCountDrawLine++;
     }
 
+    @Override
     public void drawLine(float x1, float y1, float x2, float y2, GLPaint paint) {
         GL11 gl = mGL;
 
@@ -200,6 +206,7 @@
         mCountDrawLine++;
     }
 
+    @Override
     public void fillRect(float x, float y, float width, float height, int color) {
         mGLState.setColorMode(color, mAlpha);
         GL11 gl = mGL;
@@ -215,6 +222,7 @@
         mCountFillRect++;
     }
 
+    @Override
     public void translate(float x, float y, float z) {
         Matrix.translateM(mMatrixValues, 0, x, y, z);
     }
@@ -222,6 +230,7 @@
     // This is a faster version of translate(x, y, z) because
     // (1) we knows z = 0, (2) we inline the Matrix.translateM call,
     // (3) we unroll the loop
+    @Override
     public void translate(float x, float y) {
         float[] m = mMatrixValues;
         m[12] += m[0] * x + m[4] * y;
@@ -230,10 +239,12 @@
         m[15] += m[3] * x + m[7] * y;
     }
 
+    @Override
     public void scale(float sx, float sy, float sz) {
         Matrix.scaleM(mMatrixValues, 0, sx, sy, sz);
     }
 
+    @Override
     public void rotate(float angle, float x, float y, float z) {
         if (angle == 0) return;
         float[] temp = mTempMatrix;
@@ -242,6 +253,7 @@
         System.arraycopy(temp, 16, mMatrixValues, 0, 16);
     }
 
+    @Override
     public void multiplyMatrix(float matrix[], int offset) {
         float[] temp = mTempMatrix;
         Matrix.multiplyMM(temp, 0, mMatrixValues, 0, matrix, offset);
@@ -262,6 +274,7 @@
         mCountTextureRect++;
     }
 
+    @Override
     public void drawMesh(BasicTexture tex, int x, int y, int xyBuffer,
             int uvBuffer, int indexBuffer, int indexCount) {
         float alpha = mAlpha;
@@ -352,6 +365,7 @@
         }
     }
 
+    @Override
     public void drawTexture(
             BasicTexture texture, int x, int y, int width, int height) {
         drawTexture(texture, x, y, width, height, mAlpha);
@@ -368,6 +382,7 @@
         drawBoundTexture(texture, x, y, width, height);
     }
 
+    @Override
     public void drawTexture(BasicTexture texture, RectF source, RectF target) {
         if (target.width() <= 0 || target.height() <= 0) return;
 
@@ -386,6 +401,7 @@
         textureRect(target.left, target.top, target.width(), target.height());
     }
 
+    @Override
     public void drawTexture(BasicTexture texture, float[] mTextureTransform,
             int x, int y, int w, int h) {
         mGLState.setBlendEnabled(mBlendEnabled
@@ -427,6 +443,7 @@
         }
     }
 
+    @Override
     public void drawMixed(BasicTexture from,
             int toColor, float ratio, int x, int y, int w, int h) {
         drawMixed(from, toColor, ratio, x, y, w, h, mAlpha);
@@ -626,10 +643,12 @@
         }
     }
 
+    @Override
     public GL11 getGLInstance() {
         return mGL;
     }
 
+    @Override
     public void clearBuffer() {
         mGL.glClear(GL10.GL_COLOR_BUFFER_BIT);
     }
@@ -659,6 +678,7 @@
 
     // unloadTexture and deleteBuffer can be called from the finalizer thread,
     // so we synchronized on the mUnboundTextures object.
+    @Override
     public boolean unloadTexture(BasicTexture t) {
         synchronized (mUnboundTextures) {
             if (!t.isLoaded()) return false;
@@ -667,12 +687,14 @@
         }
     }
 
+    @Override
     public void deleteBuffer(int bufferId) {
         synchronized (mUnboundTextures) {
             mDeleteBuffers.add(bufferId);
         }
     }
 
+    @Override
     public void deleteRecycledResources() {
         synchronized (mUnboundTextures) {
             IntArray ids = mUnboundTextures;
@@ -689,10 +711,12 @@
         }
     }
 
+    @Override
     public void save() {
         save(SAVE_FLAG_ALL);
     }
 
+    @Override
     public void save(int saveFlags) {
         ConfigState config = obtainRestoreConfig();
 
@@ -712,6 +736,7 @@
         mRestoreStack.add(config);
     }
 
+    @Override
     public void restore() {
         if (mRestoreStack.isEmpty()) throw new IllegalStateException();
         ConfigState config = mRestoreStack.remove(mRestoreStack.size() - 1);
@@ -746,6 +771,7 @@
         }
     }
 
+    @Override
     public void dumpStatisticsAndClear() {
         String line = String.format(
                 "MESH:%d, TEX_OES:%d, TEX_RECT:%d, FILL_RECT:%d, LINE:%d",
diff --git a/src/com/android/gallery3d/ui/GalleryEGLConfigChooser.java b/src/com/android/gallery3d/ui/GalleryEGLConfigChooser.java
index 0d5643f..7089d3c 100644
--- a/src/com/android/gallery3d/ui/GalleryEGLConfigChooser.java
+++ b/src/com/android/gallery3d/ui/GalleryEGLConfigChooser.java
@@ -39,6 +39,7 @@
             EGL10.EGL_NONE
     };
 
+    @Override
     public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
         int[] numConfig = new int[1];
         if (!egl.eglChooseConfig(display, mConfigSpec, null, 0, numConfig)) {
diff --git a/src/com/android/gallery3d/ui/GestureRecognizer.java b/src/com/android/gallery3d/ui/GestureRecognizer.java
index 780c548..e4e0c49 100644
--- a/src/com/android/gallery3d/ui/GestureRecognizer.java
+++ b/src/com/android/gallery3d/ui/GestureRecognizer.java
@@ -25,6 +25,7 @@
 // This class aggregates three gesture detectors: GestureDetector,
 // ScaleGestureDetector, and DownUpDetector.
 public class GestureRecognizer {
+    @SuppressWarnings("unused")
     private static final String TAG = "GestureRecognizer";
 
     public interface Listener {
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index 3619ca0..aaf5d39 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -380,6 +380,7 @@
             mListener = listener;
         }
 
+        @Override
         public Void run(JobContext jc) {
             int index = 0;
             DataManager manager = mActivity.getDataManager();
diff --git a/src/com/android/gallery3d/ui/Paper.java b/src/com/android/gallery3d/ui/Paper.java
index 3b67a04..3bd0a21 100644
--- a/src/com/android/gallery3d/ui/Paper.java
+++ b/src/com/android/gallery3d/ui/Paper.java
@@ -25,6 +25,7 @@
 
 // This class does the overscroll effect.
 class Paper {
+    @SuppressWarnings("unused")
     private static final String TAG = "Paper";
     private static final int ROTATE_FACTOR = 4;
     private EdgeAnimation mAnimationLeft = new EdgeAnimation();
@@ -90,6 +91,7 @@
 
 // This class follows the structure of frameworks's EdgeEffect class.
 class EdgeAnimation {
+    @SuppressWarnings("unused")
     private static final String TAG = "EdgeAnimation";
 
     private static final int STATE_IDLE = 0;
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java
index 2525433..ec042da 100644
--- a/src/com/android/gallery3d/ui/PhotoView.java
+++ b/src/com/android/gallery3d/ui/PhotoView.java
@@ -539,7 +539,7 @@
         boolean isDeletable();  // whether the picture can be deleted
         void forceSize();  // called when mCompensation changes
         Size getSize();
-    };
+    }
 
     class FullPicture implements Picture {
         private int mRotation;
@@ -1046,9 +1046,8 @@
                     || !mTouchBoxDeletable) {
                 return false;
             }
-            int maxVelocity = (int) GalleryUtils.dpToPixel(MAX_DISMISS_VELOCITY);
-            int escapeVelocity =
-                    (int) GalleryUtils.dpToPixel(SWIPE_ESCAPE_VELOCITY);
+            int maxVelocity = GalleryUtils.dpToPixel(MAX_DISMISS_VELOCITY);
+            int escapeVelocity = GalleryUtils.dpToPixel(SWIPE_ESCAPE_VELOCITY);
             int centerY = mPositionController.getPosition(mTouchBoxIndex)
                     .centerY();
             boolean fastEnough = (Math.abs(vy) > escapeVelocity)
diff --git a/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java b/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java
index dd9b7ce..fd16b35 100644
--- a/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java
+++ b/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java
@@ -19,12 +19,12 @@
 import android.annotation.TargetApi;
 import android.graphics.RectF;
 import android.graphics.SurfaceTexture;
-import android.opengl.GLES11Ext;
 
 import com.android.gallery3d.common.ApiHelper;
 
 public abstract class SurfaceTextureScreenNail implements ScreenNail,
         SurfaceTexture.OnFrameAvailableListener {
+    @SuppressWarnings("unused")
     private static final String TAG = "SurfaceTextureScreenNail";
     // This constant is not available in API level before 15, but it was just an
     // oversight.
diff --git a/src/com/android/gallery3d/ui/UndoBarView.java b/src/com/android/gallery3d/ui/UndoBarView.java
index f5ea5d1..8c9836d 100644
--- a/src/com/android/gallery3d/ui/UndoBarView.java
+++ b/src/com/android/gallery3d/ui/UndoBarView.java
@@ -24,6 +24,7 @@
 import com.android.gallery3d.util.GalleryUtils;
 
 public class UndoBarView extends GLView {
+    @SuppressWarnings("unused")
     private static final String TAG = "UndoBarView";
 
     private static final int WHITE = 0xFFFFFFFF;
@@ -55,16 +56,16 @@
     //    +-+----+----------------+-+--+----+-+------+--+-+
     //     4  16                   1 12  32  8        16 4
     public UndoBarView(Context context) {
-        mBarHeight = (int) GalleryUtils.dpToPixel(48);
-        mBarMargin = (int) GalleryUtils.dpToPixel(4);
-        mUndoTextMargin = (int) GalleryUtils.dpToPixel(16);
-        mIconMargin = (int) GalleryUtils.dpToPixel(8);
-        mIconSize = (int) GalleryUtils.dpToPixel(32);
-        mSeparatorRightMargin = (int) GalleryUtils.dpToPixel(12);
-        mSeparatorTopMargin = (int) GalleryUtils.dpToPixel(10);
-        mSeparatorBottomMargin = (int) GalleryUtils.dpToPixel(10);
-        mSeparatorWidth = (int) GalleryUtils.dpToPixel(1);
-        mDeletedTextMargin = (int) GalleryUtils.dpToPixel(16);
+        mBarHeight = GalleryUtils.dpToPixel(48);
+        mBarMargin = GalleryUtils.dpToPixel(4);
+        mUndoTextMargin = GalleryUtils.dpToPixel(16);
+        mIconMargin = GalleryUtils.dpToPixel(8);
+        mIconSize = GalleryUtils.dpToPixel(32);
+        mSeparatorRightMargin = GalleryUtils.dpToPixel(12);
+        mSeparatorTopMargin = GalleryUtils.dpToPixel(10);
+        mSeparatorBottomMargin = GalleryUtils.dpToPixel(10);
+        mSeparatorWidth = GalleryUtils.dpToPixel(1);
+        mDeletedTextMargin = GalleryUtils.dpToPixel(16);
 
         mPanel = new NinePatchTexture(context, R.drawable.panel_undo_holo);
         mUndoText = StringTexture.newInstance(context.getString(R.string.undo),
@@ -166,6 +167,7 @@
         return (visibility == VISIBLE) ? 1f : 0f;
     }
 
+    @Override
     public void setVisibility(int visibility) {
         mAlpha = getTargetAlpha(visibility);
         mAnimationStartTime = NO_ANIMATION;
diff --git a/src/com/android/gallery3d/ui/UploadedTexture.java b/src/com/android/gallery3d/ui/UploadedTexture.java
index 0fe5067..bb86d05 100644
--- a/src/com/android/gallery3d/ui/UploadedTexture.java
+++ b/src/com/android/gallery3d/ui/UploadedTexture.java
@@ -318,6 +318,7 @@
         mOpaque = isOpaque;
     }
 
+    @Override
     public boolean isOpaque() {
         return mOpaque;
     }
diff --git a/src/com/android/gallery3d/util/GalleryUtils.java b/src/com/android/gallery3d/util/GalleryUtils.java
index 05198f4..3b73d34 100644
--- a/src/com/android/gallery3d/util/GalleryUtils.java
+++ b/src/com/android/gallery3d/util/GalleryUtils.java
@@ -164,6 +164,7 @@
     public static void fakeBusy(JobContext jc, int timeout) {
         final ConditionVariable cv = new ConditionVariable();
         jc.setCancelListener(new CancelListener() {
+            @Override
             public void onCancel() {
                 cv.open();
             }
diff --git a/src/com/android/gallery3d/util/MediaSetUtils.java b/src/com/android/gallery3d/util/MediaSetUtils.java
index 3bb3f8b..b71326a 100644
--- a/src/com/android/gallery3d/util/MediaSetUtils.java
+++ b/src/com/android/gallery3d/util/MediaSetUtils.java
@@ -50,6 +50,7 @@
 
     // Sort MediaSets by name
     public static class NameComparator implements Comparator<MediaSet> {
+        @Override
         public int compare(MediaSet set1, MediaSet set2) {
             int result = set1.getName().compareToIgnoreCase(set2.getName());
             if (result != 0) return result;
diff --git a/src/com/android/gallery3d/util/PriorityThreadFactory.java b/src/com/android/gallery3d/util/PriorityThreadFactory.java
index 67b2152..30d8e4a 100644
--- a/src/com/android/gallery3d/util/PriorityThreadFactory.java
+++ b/src/com/android/gallery3d/util/PriorityThreadFactory.java
@@ -35,6 +35,7 @@
         mPriority = priority;
     }
 
+    @Override
     public Thread newThread(Runnable r) {
         return new Thread(r, mName + '-' + mNumber.getAndIncrement()) {
             @Override
diff --git a/src/com/android/gallery3d/util/Profile.java b/src/com/android/gallery3d/util/Profile.java
index 6b6e5c3..7ed72c9 100644
--- a/src/com/android/gallery3d/util/Profile.java
+++ b/src/com/android/gallery3d/util/Profile.java
@@ -32,6 +32,7 @@
 // can be called in onPause() to ensure all profiling is disabled when an
 // activity is paused.
 public class Profile {
+    @SuppressWarnings("unused")
     private static final String TAG = "Profile";
     private static final int NS_PER_MS = 1000000;
 
@@ -56,6 +57,7 @@
         private HandlerThread mHandlerThread;
         private Handler mHandler;
         private Runnable mProcessRunnable = new Runnable() {
+            @Override
             public void run() {
                 synchronized (Watchdog.this) {
                     processList();
diff --git a/src/com/android/gallery3d/util/ProfileData.java b/src/com/android/gallery3d/util/ProfileData.java
index 02eb37a..a1bb8e1 100644
--- a/src/com/android/gallery3d/util/ProfileData.java
+++ b/src/com/android/gallery3d/util/ProfileData.java
@@ -31,6 +31,7 @@
 // The addSample() method adds a sample. The dumpToFile() method saves the data
 // to a file. The reset() method clears all samples.
 public class ProfileData {
+    @SuppressWarnings("unused")
     private static final String TAG = "ProfileData";
 
     private static class Node {
diff --git a/src/com/android/gallery3d/util/ReverseGeocoder.java b/src/com/android/gallery3d/util/ReverseGeocoder.java
index 3df4c49..a8b26d9 100644
--- a/src/com/android/gallery3d/util/ReverseGeocoder.java
+++ b/src/com/android/gallery3d/util/ReverseGeocoder.java
@@ -35,6 +35,7 @@
 import java.util.Locale;
 
 public class ReverseGeocoder {
+    @SuppressWarnings("unused")
     private static final String TAG = "ReverseGeocoder";
     public static final int EARTH_RADIUS_METERS = 6378137;
     public static final int LAT_MIN = -90;
diff --git a/src/com/android/gallery3d/util/ThreadPool.java b/src/com/android/gallery3d/util/ThreadPool.java
index 71bb3c5..4c077c8 100644
--- a/src/com/android/gallery3d/util/ThreadPool.java
+++ b/src/com/android/gallery3d/util/ThreadPool.java
@@ -22,6 +22,7 @@
 import java.util.concurrent.TimeUnit;
 
 public class ThreadPool {
+    @SuppressWarnings("unused")
     private static final String TAG = "ThreadPool";
     private static final int CORE_POOL_SIZE = 4;
     private static final int MAX_POOL_SIZE = 8;
@@ -98,6 +99,7 @@
     }
 
     private class Worker<T> implements Runnable, Future<T>, JobContext {
+        @SuppressWarnings("hiding")
         private static final String TAG = "Worker";
         private Job<T> mJob;
         private FutureListener<T> mListener;
@@ -114,6 +116,7 @@
         }
 
         // This is called by a thread in the thread pool.
+        @Override
         public void run() {
             T result = null;
 
@@ -137,6 +140,7 @@
         }
 
         // Below are the methods for Future.
+        @Override
         public synchronized void cancel() {
             if (mIsCancelled) return;
             mIsCancelled = true;
@@ -150,14 +154,17 @@
             }
         }
 
+        @Override
         public boolean isCancelled() {
             return mIsCancelled;
         }
 
+        @Override
         public synchronized boolean isDone() {
             return mIsDone;
         }
 
+        @Override
         public synchronized T get() {
             while (!mIsDone) {
                 try {
@@ -170,12 +177,14 @@
             return mResult;
         }
 
+        @Override
         public void waitDone() {
             get();
         }
 
         // Below are the methods for JobContext (only called from the
         // thread running the job)
+        @Override
         public synchronized void setCancelListener(CancelListener listener) {
             mCancelListener = listener;
             if (mIsCancelled && mCancelListener != null) {
@@ -183,6 +192,7 @@
             }
         }
 
+        @Override
         public boolean setMode(int mode) {
             // Release old resource
             ResourceCounter rc = modeToCounter(mMode);