[Android] Video player: Hide debug logs from release

Geoffrey Métais git at videolan.org
Fri Mar 30 16:51:15 CEST 2018


vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar 16 11:40:00 2018 +0100| [ce72cc1b442417346a1014818e3fd19ff4f3b6ac] | committer: Geoffrey Métais

Video player: Hide debug logs from release

(cherry picked from commit b74887c6890a88cca9fb283f1b2abd1ca9093fff)

> https://code.videolan.org/videolan/vlc-android/commit/ce72cc1b442417346a1014818e3fd19ff4f3b6ac
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java   | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 262c9ddcb..8fee58413 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -684,7 +684,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         String subtitleList_serialized = null;
         synchronized (mSubtitleSelectedFiles) {
             if(mSubtitleSelectedFiles.size() > 0) {
-                Log.d(TAG, "Saving selected subtitle files");
+                if (BuildConfig.DEBUG) Log.d(TAG, "Saving selected subtitle files");
                 ByteArrayOutputStream bos = new ByteArrayOutputStream();
                 try {
                     ObjectOutputStream oos = new ObjectOutputStream(bos);
@@ -874,7 +874,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         vlcVout.removeCallback(this);
         vlcVout.detachViews();
         if (mService.hasMedia() && mSwitchingView) {
-            Log.d(TAG, "mLocation = \"" + mUri + "\"");
+            if (BuildConfig.DEBUG) Log.d(TAG, "mLocation = \"" + mUri + "\"");
             if (mSwitchToPopup)
                 mService.switchToPopup(mService.getCurrentMediaPosition());
             else {
@@ -931,8 +931,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                     MediaDatabase.getInstance().saveSlave(mService.getCurrentMediaLocation(), Media.Slave.Type.Subtitle, 2, data.getStringExtra(FilePickerFragment.EXTRA_MRL));
                 }
             });
-        } else
-            Log.d(TAG, "Subtitle selection dialog was cancelled");
+        } else if (BuildConfig.DEBUG) Log.d(TAG, "Subtitle selection dialog was cancelled");
     }
 
     public static void start(Context context, Uri uri) {
@@ -3077,7 +3076,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         final KeyguardManager km = (KeyguardManager) getApplicationContext().getSystemService(KEYGUARD_SERVICE);
         if (km != null && km.inKeyguardRestrictedInputMode())
             mWasPaused = true;
-        if (mWasPaused)
+        if (mWasPaused && BuildConfig.DEBUG)
             Log.d(TAG, "Video was previously paused, resuming in paused mode");
 
         if (intent.getData() != null) mUri = intent.getData();
@@ -3108,7 +3107,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         final boolean continueplayback = isPlaying && (restorePlayback || positionInPlaylist == mService.getCurrentMediaPosition());
         if (resumePlaylist) {
             // Provided externally from AudioService
-            Log.d(TAG, "Continuing playback from PlaybackService at index " + positionInPlaylist);
+            if (BuildConfig.DEBUG) Log.d(TAG, "Continuing playback from PlaybackService at index " + positionInPlaylist);
             openedMedia = mService.getMedias().get(positionInPlaylist);
             if (openedMedia == null) {
                 encounteredError();



More information about the Android mailing list