[Android] fix some lint warnings

Sébastien Toque git at videolan.org
Tue Aug 13 15:16:09 CEST 2013


vlc-ports/android | branch: 0.1.x-bugfix | Sébastien Toque <xilasz at gmail.com> | Mon Aug  5 15:40:11 2013 +0200| [19dda55633ba81ca1ffdc31d97e3e37c60bc9194] | committer: Edward Wang

fix some lint warnings

(cherry picked from commit aa36195fbb7e44816b84f79205471863686d18b3)
Signed-off-by: Edward Wang <edward.c.wang at compdigitec.com>

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=19dda55633ba81ca1ffdc31d97e3e37c60bc9194
---

 vlc-android/src/org/videolan/libvlc/LibVlcUtil.java          |    3 ++-
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java  |   10 +---------
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java b/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java
index 5485779..d38300a 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java
@@ -28,6 +28,7 @@ import java.io.IOException;
 import java.io.RandomAccessFile;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
+import java.util.Locale;
 
 import android.content.Context;
 import android.os.Build;
@@ -131,7 +132,7 @@ public class LibVlcUtil {
                     hasFpu = true;
                 if(line.startsWith("processor"))
                     processors++;
-                if(bogoMIPS < 0 && line.toLowerCase().contains("bogomips")) {
+                if(bogoMIPS < 0 && line.toLowerCase(Locale.ENGLISH).contains("bogomips")) {
                     String[] bogo_parts = line.split(":");
                     try {
                         bogoMIPS = Float.parseFloat(bogo_parts[1].trim());
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 67c12f0..0a624d6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -274,21 +274,13 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
         mSurface = (SurfaceView) findViewById(R.id.player_surface);
         mSurfaceHolder = mSurface.getHolder();
         mSurfaceFrame = (FrameLayout) findViewById(R.id.player_surface_frame);
-        int pitch;
         String chroma = pref.getString("chroma_format", "");
         if(Util.isGingerbreadOrLater() && chroma.equals("YV12")) {
             mSurfaceHolder.setFormat(ImageFormat.YV12);
-            pitch = ImageFormat.getBitsPerPixel(ImageFormat.YV12) / 8;
         } else if (chroma.equals("RV16")) {
             mSurfaceHolder.setFormat(PixelFormat.RGB_565);
-            PixelFormat info = new PixelFormat();
-            PixelFormat.getPixelFormatInfo(PixelFormat.RGB_565, info);
-            pitch = info.bytesPerPixel;
         } else {
             mSurfaceHolder.setFormat(PixelFormat.RGBX_8888);
-            PixelFormat info = new PixelFormat();
-            PixelFormat.getPixelFormatInfo(PixelFormat.RGBX_8888, info);
-            pitch = info.bytesPerPixel;
         }
         mSurfaceAlign = 16 / pitch - 1;
         mSurfaceHolder.addCallback(mSurfaceCallback);
@@ -1339,7 +1331,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
      * Dim the status bar and/or navigation icons when needed on Android 3.x.
      * Hide it on Android 4.0 and later
      */
-    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
+    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
     private void dimStatusBar(boolean dim) {
         if (!Util.isHoneycombOrLater() || !Util.hasNavBar())
             return;



More information about the Android mailing list