[Android] Test the new RequirePermission annotation

Jean-Baptiste Kempf git at videolan.org
Tue Aug 18 15:44:35 CEST 2015


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Aug 18 15:44:20 2015 +0200| [44d4b826d4e2ff36f35e72e36a7f61445005df8a] | committer: Jean-Baptiste Kempf

Test the new RequirePermission annotation

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

 vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
index b759732..c85a107 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
@@ -30,6 +30,7 @@ import android.graphics.BitmapFactory;
 import android.media.RingtoneManager;
 import android.net.Uri;
 import android.provider.MediaStore;
+import android.support.annotation.RequiresPermission;
 import android.util.Log;
 import android.widget.Toast;
 
@@ -75,6 +76,7 @@ public class AudioUtil {
      */
     public static String PLAYLIST_DIR = null;
 
+    @RequiresPermission(android.Manifest.permission.WRITE_SETTINGS)
     public static void setRingtone(MediaWrapper song, Context context){
         File newringtone = AndroidUtil.UriToFile(song.getUri());
         if(newringtone == null || !newringtone.exists()) {



More information about the Android mailing list