[Android] Remove lint warnings for API version

Geoffrey Métais git at videolan.org
Tue Feb 9 14:44:33 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb  9 14:40:02 2016 +0100| [2e3ba2728a4990f21c26ec2b81a8e1cd01d9258d] | committer: Geoffrey Métais

Remove lint warnings for API version

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

 vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java        | 2 ++
 vlc-android/src/org/videolan/vlc/gui/tv/SearchFragment.java        | 5 ++++-
 .../src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java        | 7 +++++--
 .../org/videolan/vlc/gui/tv/browser/DirectoryBrowserFragment.java  | 3 +++
 .../org/videolan/vlc/gui/tv/browser/NetworkBrowserFragment.java    | 4 ++++
 .../src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java  | 3 +++
 6 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
index 6f53f26..e1c4621 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -20,6 +20,7 @@
  *****************************************************************************/
 package org.videolan.vlc.gui.tv;
 
+import android.annotation.TargetApi;
 import android.app.Activity;
 import android.app.FragmentManager;
 import android.content.Intent;
@@ -74,6 +75,7 @@ import org.videolan.vlc.util.VLCInstance;
 import java.util.ArrayList;
 import java.util.List;
 
+ at TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 public class MainTvActivity extends BaseTvActivity implements IVideoBrowser, OnItemViewSelectedListener,
         OnItemViewClickedListener, OnClickListener, PlaybackService.Callback {
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/SearchFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/SearchFragment.java
index e5b4176..785ec2f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/SearchFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/SearchFragment.java
@@ -20,7 +20,9 @@
  *****************************************************************************/
 package org.videolan.vlc.gui.tv;
 
+import android.annotation.TargetApi;
 import android.app.Activity;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.support.v17.leanback.widget.ArrayObjectAdapter;
@@ -41,6 +43,7 @@ import org.videolan.vlc.media.MediaWrapper;
 
 import java.util.ArrayList;
 
+ at TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 public class SearchFragment extends android.support.v17.leanback.app.SearchFragment
         implements android.support.v17.leanback.app.SearchFragment.SearchResultProvider {
 
@@ -106,7 +109,7 @@ public class SearchFragment extends android.support.v17.leanback.app.SearchFragm
             @Override
             public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
                 if (item instanceof MediaWrapper) {
-                    TvUtil.openMedia(mActivity, (MediaWrapper) item, row);
+                    TvUtil.openMedia(mActivity, item, row);
                 }
             }
         };
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
index c3590ff..10da623 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
@@ -23,6 +23,7 @@
 
 package org.videolan.vlc.gui.tv.browser;
 
+import android.annotation.TargetApi;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -30,6 +31,7 @@ import android.content.IntentFilter;
 import android.content.SharedPreferences;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
@@ -42,6 +44,7 @@ import org.videolan.vlc.gui.PlaybackServiceActivity;
 import org.videolan.vlc.gui.tv.SearchActivity;
 import org.videolan.vlc.util.WeakHandler;
 
+ at TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 public abstract class BaseTvActivity extends PlaybackServiceActivity {
     protected MediaLibrary mMediaLibrary;
     protected SharedPreferences mSettings;
@@ -57,13 +60,13 @@ public abstract class BaseTvActivity extends PlaybackServiceActivity {
     protected void onResume() {
         super.onResume();
         //Handle network connection state
-        IntentFilter networkfilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
+        IntentFilter networkFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
 
         IntentFilter storageFilter = new IntentFilter(Intent.ACTION_MEDIA_MOUNTED);
         storageFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
         storageFilter.addDataScheme("file");
 
-        registerReceiver(mExternalDevicesReceiver, networkfilter);
+        registerReceiver(mExternalDevicesReceiver, networkFilter);
         registerReceiver(mExternalDevicesReceiver, storageFilter);
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/DirectoryBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/DirectoryBrowserFragment.java
index 6d5938f..6495222 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/DirectoryBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/DirectoryBrowserFragment.java
@@ -23,6 +23,8 @@
 
 package org.videolan.vlc.gui.tv.browser;
 
+import android.annotation.TargetApi;
+import android.os.Build;
 import android.text.TextUtils;
 
 import org.videolan.libvlc.util.AndroidUtil;
@@ -33,6 +35,7 @@ import org.videolan.vlc.util.AndroidDevices;
 
 import java.io.File;
 
+ at TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 public class DirectoryBrowserFragment extends SortedBrowserFragment{
 
     public static final String TAG = "VLC/NetworkBrowserFragment";
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/NetworkBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/NetworkBrowserFragment.java
index 2ec247a..5393e09 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/NetworkBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/NetworkBrowserFragment.java
@@ -23,10 +23,14 @@
 
 package org.videolan.vlc.gui.tv.browser;
 
+import android.annotation.TargetApi;
+import android.os.Build;
+
 import org.videolan.libvlc.Media;
 import org.videolan.vlc.media.MediaWrapper;
 import org.videolan.vlc.util.Util;
 
+ at TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 public class NetworkBrowserFragment extends SortedBrowserFragment {
 
     public static final String TAG = "VLC/NetworkBrowserFragment";
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
index 62bfb1f..d52568f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
@@ -20,7 +20,9 @@
  *****************************************************************************/
 package org.videolan.vlc.gui.tv.browser;
 
+import android.annotation.TargetApi;
 import android.app.Fragment;
+import android.os.Build;
 import android.os.Bundle;
 import android.view.KeyEvent;
 import android.view.View;
@@ -32,6 +34,7 @@ import org.videolan.vlc.gui.tv.MainTvActivity;
 import org.videolan.vlc.gui.tv.browser.interfaces.BrowserActivityInterface;
 import org.videolan.vlc.gui.tv.browser.interfaces.BrowserFragmentInterface;
 
+ at TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 public class VerticalGridActivity extends BaseTvActivity implements BrowserActivityInterface {
 
     BrowserFragmentInterface mFragment;



More information about the Android mailing list