Gallery2: Reduce logspam in video player
Change-Id: I71b1356f7e326174378c99b4b0e5e60764a7c139
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index f5e7a65..708507b 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -89,7 +89,7 @@
public class MovieActivity extends AbstractPermissionActivity {
@SuppressWarnings("unused")
private static final String TAG = "MovieActivity";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
public static final String KEY_LOGO_BITMAP = "logo-bitmap";
public static final String KEY_TREAT_UP_AS_BACK = "treat-up-as-back";
private static final String VIDEO_SDP_MIME_TYPE = "application/sdp";
diff --git a/src/com/android/gallery3d/app/MovieControllerOverlay.java b/src/com/android/gallery3d/app/MovieControllerOverlay.java
index fd2b631..251c3a2 100755
--- a/src/com/android/gallery3d/app/MovieControllerOverlay.java
+++ b/src/com/android/gallery3d/app/MovieControllerOverlay.java
@@ -53,7 +53,7 @@
AnimationListener {
private static final String TAG = "Gallery3D/MovieControllerOverlay";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private ScreenModeManager mScreenModeManager;
protected ScreenModeExt mScreenModeExt = new ScreenModeExt();
@@ -274,7 +274,9 @@
@Override
public void setViewEnabled(boolean isEnabled) {
if (mListener.onIsRTSP()) {
- Log.v(TAG, "setViewEnabled is " + isEnabled);
+ if (LOG) {
+ Log.v(TAG, "setViewEnabled is " + isEnabled);
+ }
mOverlayExt.setCanScrubbing(isEnabled);
mPlayPauseReplayView.setEnabled(isEnabled);
if (enableRewindAndForward) {
@@ -292,7 +294,9 @@
@Override
public void setPlayPauseReplayResume() {
if (mListener.onIsRTSP()) {
- Log.v(TAG, "setPlayPauseReplayResume is enabled is true");
+ if (LOG) {
+ Log.v(TAG, "setPlayPauseReplayResume is enabled is true");
+ }
mPlayPauseReplayView.setEnabled(true);
}
}
@@ -680,7 +684,9 @@
addView(mScreenView, wrapContent);
if (enableRewindAndForward) {
- Log.v(TAG, "ScreenModeExt enableRewindAndForward");
+ if (LOG) {
+ Log.v(TAG, "ScreenModeExt enableRewindAndForward");
+ }
mSeprator = new ImageView(context);
// default next screen mode
mSeprator.setImageResource(R.drawable.ic_separator_line);
@@ -691,7 +697,9 @@
addView(mSeprator, wrapContent);
} else {
- Log.v(TAG, "ScreenModeExt unenableRewindAndForward");
+ if (LOG) {
+ Log.v(TAG, "ScreenModeExt unenableRewindAndForward");
+ }
}
// for screen layout
@@ -784,7 +792,9 @@
}
void init(Context context) {
- Log.v(TAG, "ControllerRewindAndForwardExt init");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt init");
+ }
mTimeBarHeight = mTimeBar.getPreferredHeight();
Drawable forwardMenu = context.getResources().
@@ -837,10 +847,14 @@
@Override
public void onClick(View v) {
if (v == mStop) {
- Log.v(TAG, "ControllerRewindAndForwardExt onClick mStop");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onClick mStop");
+ }
mListenerForRewind.onStopVideo();
} else if (v == mRewind) {
- Log.v(TAG, "ControllerRewindAndForwardExt onClick mRewind");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onClick mRewind");
+ }
if (TextUtils.getLayoutDirectionFromLocale(Locale.getDefault())
== View.LAYOUT_DIRECTION_RTL) {
mListenerForRewind.onForward();
@@ -848,7 +862,9 @@
mListenerForRewind.onRewind();
}
} else if (v == mForward) {
- Log.v(TAG, "ControllerRewindAndForwardExt onClick mForward");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onClick mForward");
+ }
if (TextUtils.getLayoutDirectionFromLocale(Locale.getDefault())
== View.LAYOUT_DIRECTION_RTL) {
mListenerForRewind.onRewind();
@@ -859,28 +875,38 @@
}
public void onStartHiding() {
- Log.v(TAG, "ControllerRewindAndForwardExt onStartHiding");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onStartHiding");
+ }
startHideAnimation(mContollerButtons);
}
public void onCancelHiding() {
- Log.v(TAG, "ControllerRewindAndForwardExt onCancelHiding");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onCancelHiding");
+ }
mContollerButtons.setAnimation(null);
}
public void onHide() {
- Log.v(TAG, "ControllerRewindAndForwardExt onHide");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onHide");
+ }
mContollerButtons.setVisibility(View.INVISIBLE);
}
public void onShow() {
- Log.v(TAG, "ControllerRewindAndForwardExt onShow: "+mState);
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onShow: " + mState);
+ }
mContollerButtons.setVisibility(View.VISIBLE);
updateBackgroundColor();
}
public void onLayout(int l, int r, int b) {
- Log.v(TAG, "ControllerRewindAndForwardExt onLayout");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onLayout");
+ }
int cl = (r - l - getAddedRightPadding()) / 2;
int cr = cl + getAddedRightPadding();
mContollerButtons.layout(cl, b - mTimeBar.getPreferredHeight(), cr, b);
@@ -892,14 +918,18 @@
@Override
public void setIListener(IRewindAndForwardListener listener) {
- Log.v(TAG, "ControllerRewindAndForwardExt setIListener " + listener);
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt setIListener " + listener);
+ }
mListenerForRewind = listener;
}
@Override
public void showControllerButtonsView(boolean canStop, boolean canRewind, boolean canForward) {
- Log.v(TAG, "ControllerRewindAndForwardExt showControllerButtonsView " + canStop
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt showControllerButtonsView " + canStop
+ canRewind + canForward);
+ }
// show ui
mStop.setEnabled(canStop);
mRewind.setEnabled(canRewind);
@@ -970,7 +1000,9 @@
public void setViewEnabled(boolean isEnabled) {
// TODO Auto-generated method stub
- Log.v(TAG, "ControllerRewindAndForwardExt setViewEnabled is " + isEnabled);
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt setViewEnabled is " + isEnabled);
+ }
mRewind.setEnabled(isEnabled);
mForward.setEnabled(isEnabled);
}
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index c79c44f..4fea7f1 100755
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -79,7 +79,7 @@
MediaPlayer.OnBufferingUpdateListener {
@SuppressWarnings("unused")
private static final String TAG = "MoviePlayer";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private static final String KEY_VIDEO_POSITION = "video-position";
private static final String KEY_RESUMEABLE_TIME = "resumeable-timeout";
@@ -219,7 +219,9 @@
mKeyguardLocked = false;
mCanResumed = false;
} else if (Intent.ACTION_SHUTDOWN.equals(intent.getAction())) {
- Log.v(TAG, "Intent.ACTION_SHUTDOWN received");
+ if (LOG) {
+ Log.v(TAG, "Intent.ACTION_SHUTDOWN received");
+ }
mActivityContext.finish();
}
}
@@ -821,10 +823,14 @@
public boolean onIsRTSP() {
if (MovieUtils.isRtspStreaming(mMovieItem.getUri(), mMovieItem
.getMimeType())) {
- Log.v(TAG, "onIsRTSP() is RTSP");
+ if (LOG) {
+ Log.v(TAG, "onIsRTSP() is RTSP");
+ }
return true;
}
- Log.v(TAG, "onIsRTSP() is not RTSP");
+ if (LOG) {
+ Log.v(TAG, "onIsRTSP() is not RTSP");
+ }
return false;
}
@@ -882,9 +888,11 @@
}
public void updateRewindAndForwardUI() {
- Log.v(TAG, "updateRewindAndForwardUI");
- Log.v(TAG, "updateRewindAndForwardUI== getCurrentPosition = " + mVideoView.getCurrentPosition());
- Log.v(TAG, "updateRewindAndForwardUI==getDuration =" + mVideoView.getDuration());
+ if (LOG) {
+ Log.v(TAG, "updateRewindAndForwardUI: " +
+ "getCurrentPosition = " + mVideoView.getCurrentPosition() + ", " +
+ "getDuration = " + mVideoView.getDuration());
+ }
if (mControllerRewindAndForwardExt != null) {
mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt
.canStop(), mVideoView.canSeekBackward()
@@ -1529,7 +1537,9 @@
@Override
public void onStopVideo() {
- Log.v(TAG, "ControllerRewindAndForwardExt onStopVideo()");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onStopVideo()");
+ }
if (mPlayerExt.canStop()) {
mPlayerExt.stopVideo();
mControllerRewindAndForwardExt.showControllerButtonsView(false,
@@ -1539,7 +1549,9 @@
@Override
public void onRewind() {
- Log.v(TAG, "ControllerRewindAndForwardExt onRewind()");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onRewind()");
+ }
if (mVideoView != null && mVideoView.canSeekBackward()) {
mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt
.canStop(),
@@ -1548,7 +1560,9 @@
int targetDuration = mVideoView.getCurrentPosition()
- stepValue < 0 ? 0 : mVideoView.getCurrentPosition()
- stepValue;
- Log.v(TAG, "onRewind targetDuration " + targetDuration);
+ if (LOG) {
+ Log.v(TAG, "onRewind targetDuration " + targetDuration);
+ }
mVideoView.seekTo(targetDuration);
} else {
mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt
@@ -1559,7 +1573,9 @@
@Override
public void onForward() {
- Log.v(TAG, "ControllerRewindAndForwardExt onForward()");
+ if (LOG) {
+ Log.v(TAG, "ControllerRewindAndForwardExt onForward()");
+ }
if (mVideoView != null && mVideoView.canSeekForward()) {
mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt
.canStop(),
@@ -1569,7 +1585,9 @@
+ stepValue > mVideoView.getDuration() ? mVideoView
.getDuration() : mVideoView.getCurrentPosition()
+ stepValue;
- Log.v(TAG, "onForward targetDuration " + targetDuration);
+ if (LOG) {
+ Log.v(TAG, "onForward targetDuration " + targetDuration);
+ }
mVideoView.seekTo(targetDuration);
} else {
mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt
diff --git a/src/com/android/gallery3d/app/TimeBar.java b/src/com/android/gallery3d/app/TimeBar.java
index 91d46b2..976335a 100755
--- a/src/com/android/gallery3d/app/TimeBar.java
+++ b/src/com/android/gallery3d/app/TimeBar.java
@@ -56,7 +56,7 @@
private static final int TEXT_SIZE_IN_DP = 14;
private static final String TAG = "Gallery3D/TimeBar";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
public static final int UNKNOWN = -1;
protected final Listener mListener;
@@ -439,7 +439,7 @@
class TimeBarInfoExtImpl implements ITimeBarInfoExt {
private static final String TAG = "TimeBarInfoExtensionImpl";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private static final String ELLIPSE = "...";
private Paint mInfoPaint;
@@ -504,7 +504,7 @@
class TimeBarSecondaryProgressExtImpl implements ITimeBarSecondaryProgressExt {
private static final String TAG = "TimeBarSecondaryProgressExtensionImpl";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private int mBufferPercent;
private Rect mSecondaryBar;
@@ -539,7 +539,7 @@
class TimeBarLayoutExtImpl implements ITimeBarLayoutExt {
private static final String TAG = "TimeBarLayoutExtensionImpl";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private int mTextPadding;
private int mVPaddingInPx;
diff --git a/src/org/codeaurora/gallery3d/ext/MovieItem.java b/src/org/codeaurora/gallery3d/ext/MovieItem.java
index c6d53d0..56afdda 100644
--- a/src/org/codeaurora/gallery3d/ext/MovieItem.java
+++ b/src/org/codeaurora/gallery3d/ext/MovieItem.java
@@ -5,7 +5,7 @@
public class MovieItem implements IMovieItem {
private static final String TAG = "MovieItem";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private Uri mUri;
private String mMimeType;
diff --git a/src/org/codeaurora/gallery3d/ext/MovieList.java b/src/org/codeaurora/gallery3d/ext/MovieList.java
index 585e288..ecb7f0d 100644
--- a/src/org/codeaurora/gallery3d/ext/MovieList.java
+++ b/src/org/codeaurora/gallery3d/ext/MovieList.java
@@ -6,7 +6,7 @@
public class MovieList implements IMovieList {
private static final String TAG = "MovieList";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private final ArrayList<IMovieItem> mItems = new ArrayList<IMovieItem>();
private static final int UNKNOWN = -1;
diff --git a/src/org/codeaurora/gallery3d/ext/MovieListLoader.java b/src/org/codeaurora/gallery3d/ext/MovieListLoader.java
index 910c00a..237d7e1 100644
--- a/src/org/codeaurora/gallery3d/ext/MovieListLoader.java
+++ b/src/org/codeaurora/gallery3d/ext/MovieListLoader.java
@@ -23,7 +23,7 @@
*/
public class MovieListLoader implements IMovieListLoader {
private static final String TAG = "MovieListLoader";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private MovieListFetcherTask mListTask;
@@ -101,7 +101,7 @@
private class MovieListFetcherTask extends AsyncTask<IMovieItem, Void, IMovieList> {
private static final String TAG = "MovieListFetcherTask";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
// TODO comments by sunlei
// public static final String COLUMN_STEREO_TYPE = MediaStore.Video.Media.STEREO_TYPE;
diff --git a/src/org/codeaurora/gallery3d/ext/MovieUtils.java b/src/org/codeaurora/gallery3d/ext/MovieUtils.java
index 2846ab5..4bc70a3 100644
--- a/src/org/codeaurora/gallery3d/ext/MovieUtils.java
+++ b/src/org/codeaurora/gallery3d/ext/MovieUtils.java
@@ -10,7 +10,7 @@
*/
public class MovieUtils {
private static final String TAG = "MovieUtils";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private MovieUtils() {
}
diff --git a/src/org/codeaurora/gallery3d/video/BookmarkActivity.java b/src/org/codeaurora/gallery3d/video/BookmarkActivity.java
index 3865931..75e4562 100644
--- a/src/org/codeaurora/gallery3d/video/BookmarkActivity.java
+++ b/src/org/codeaurora/gallery3d/video/BookmarkActivity.java
@@ -33,7 +33,7 @@
public class BookmarkActivity extends Activity implements OnItemClickListener {
private static final String TAG = "BookmarkActivity";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private BookmarkEnhance mBookmark;
private BookmarkAdapter mAdapter;
diff --git a/src/org/codeaurora/gallery3d/video/BookmarkEnhance.java b/src/org/codeaurora/gallery3d/video/BookmarkEnhance.java
index 855cea3..a5424d6 100644
--- a/src/org/codeaurora/gallery3d/video/BookmarkEnhance.java
+++ b/src/org/codeaurora/gallery3d/video/BookmarkEnhance.java
@@ -12,7 +12,7 @@
public class BookmarkEnhance {
private static final String TAG = "BookmarkEnhance";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private static final Uri BOOKMARK_URI = Uri.parse("content://media/internal/bookmark");
diff --git a/src/org/codeaurora/gallery3d/video/BookmarkHooker.java b/src/org/codeaurora/gallery3d/video/BookmarkHooker.java
index c6d014e..867ca11 100644
--- a/src/org/codeaurora/gallery3d/video/BookmarkHooker.java
+++ b/src/org/codeaurora/gallery3d/video/BookmarkHooker.java
@@ -10,7 +10,7 @@
public class BookmarkHooker extends MovieHooker {
private static final String TAG = "BookmarkHooker";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private static final String ACTION_BOOKMARK = "org.codeaurora.bookmark.VIEW";
private static final int MENU_BOOKMARK_ADD = 1;
diff --git a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
index 6b5a9be..415972a 100644
--- a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
+++ b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
@@ -45,7 +45,7 @@
* such as scaling and tinting.
*/
public class CodeauroraVideoView extends SurfaceView implements MediaPlayerControl, ScreenModeListener{
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private String TAG = "CodeauroraVideoView";
// settable by the client
private Uri mUri;
diff --git a/src/org/codeaurora/gallery3d/video/LoopVideoHooker.java b/src/org/codeaurora/gallery3d/video/LoopVideoHooker.java
index 64463cc..ec660b9 100644
--- a/src/org/codeaurora/gallery3d/video/LoopVideoHooker.java
+++ b/src/org/codeaurora/gallery3d/video/LoopVideoHooker.java
@@ -9,7 +9,7 @@
public class LoopVideoHooker extends MovieHooker {
private static final String TAG = "LoopVideoHooker";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private static final int MENU_LOOP = 1;
private MenuItem mMenuLoopButton;
diff --git a/src/org/codeaurora/gallery3d/video/MovieHooker.java b/src/org/codeaurora/gallery3d/video/MovieHooker.java
index 47e4bce..a859d44 100644
--- a/src/org/codeaurora/gallery3d/video/MovieHooker.java
+++ b/src/org/codeaurora/gallery3d/video/MovieHooker.java
@@ -9,7 +9,7 @@
public class MovieHooker extends ActivityHooker {
private static final String TAG = "MovieHooker";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private IMovieItem mMovieItem;
private IMoviePlayer mPlayer;
diff --git a/src/org/codeaurora/gallery3d/video/MovieListHooker.java b/src/org/codeaurora/gallery3d/video/MovieListHooker.java
index 244f401..1020981 100644
--- a/src/org/codeaurora/gallery3d/video/MovieListHooker.java
+++ b/src/org/codeaurora/gallery3d/video/MovieListHooker.java
@@ -14,7 +14,7 @@
public class MovieListHooker extends MovieHooker implements LoaderListener {
private static final String TAG = "MovieListHooker";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private static final int MENU_NEXT = 1;
private static final int MENU_PREVIOUS = 2;
diff --git a/src/org/codeaurora/gallery3d/video/MovieTitleHelper.java b/src/org/codeaurora/gallery3d/video/MovieTitleHelper.java
index 5f2229d..4f23e81 100644
--- a/src/org/codeaurora/gallery3d/video/MovieTitleHelper.java
+++ b/src/org/codeaurora/gallery3d/video/MovieTitleHelper.java
@@ -13,7 +13,7 @@
public class MovieTitleHelper {
private static final String TAG = "MovieTitleHelper";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
public static String getTitleFromMediaData(final Context context, final Uri uri) {
String title = null;
diff --git a/src/org/codeaurora/gallery3d/video/ScreenModeManager.java b/src/org/codeaurora/gallery3d/video/ScreenModeManager.java
index 3dbba68..a1c04c6 100644
--- a/src/org/codeaurora/gallery3d/video/ScreenModeManager.java
+++ b/src/org/codeaurora/gallery3d/video/ScreenModeManager.java
@@ -6,7 +6,7 @@
public class ScreenModeManager {
private static final String TAG = "ScreenModeManager";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
//support screen mode.
public static final int SCREENMODE_BIGSCREEN = 1;
public static final int SCREENMODE_FULLSCREEN = 2;
diff --git a/src/org/codeaurora/gallery3d/video/StereoAudioHooker.java b/src/org/codeaurora/gallery3d/video/StereoAudioHooker.java
index 43d277b..a660480 100755
--- a/src/org/codeaurora/gallery3d/video/StereoAudioHooker.java
+++ b/src/org/codeaurora/gallery3d/video/StereoAudioHooker.java
@@ -10,7 +10,7 @@
public class StereoAudioHooker extends MovieHooker {
private static final String TAG = "StereoAudioHooker";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private static final int MENU_STEREO_AUDIO = 1;
private MenuItem mMenuStereoAudio;
diff --git a/src/org/codeaurora/gallery3d/video/StreamingHooker.java b/src/org/codeaurora/gallery3d/video/StreamingHooker.java
index 5fa9191..b8b1136 100755
--- a/src/org/codeaurora/gallery3d/video/StreamingHooker.java
+++ b/src/org/codeaurora/gallery3d/video/StreamingHooker.java
@@ -14,7 +14,7 @@
public class StreamingHooker extends MovieHooker {
private static final String TAG = "StreamingHooker";
- private static final boolean LOG = true;
+ private static final boolean LOG = false;
private static final String ACTION_STREAMING = "org.codeaurora.settings.streaming";
private static final int MENU_INPUT_URL = 1;