Loading media/java/android/media/RingtoneManager.java +16 −3 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.annotation.SdkConstant.SdkConstantType; import android.app.Activity; import android.content.ContentUris; import android.content.Context; import android.content.pm.PackageManager; import android.database.Cursor; import android.net.Uri; import android.os.Environment; import android.os.Process; import android.provider.MediaStore; import android.provider.Settings; import android.provider.Settings.System; Loading Loading @@ -359,6 +361,9 @@ public class RingtoneManager { * If {@link RingtoneManager#RingtoneManager(Activity)} was not used, the * caller should manage the returned cursor through its activity's life * cycle to prevent leaking the cursor. * <p> * Note that the list of ringtones available will differ depending on whether the caller * has the {@link android.Manifest.permission#READ_EXTERNAL_STORAGE} permission. * * @return A {@link Cursor} of all the ringtones available. * @see #ID_COLUMN_INDEX Loading Loading @@ -455,7 +460,9 @@ public class RingtoneManager { /** * Returns a valid ringtone URI. No guarantees on which it returns. If it * cannot find one, returns null. * cannot find one, returns null. If it can only find one on external storage and the caller * doesn't have the {@link android.Manifest.permission#READ_EXTERNAL_STORAGE} permission, * returns null. * * @param context The context to use for querying. * @return A ringtone URI, or null if one cannot be found. Loading Loading @@ -495,6 +502,12 @@ public class RingtoneManager { } private Cursor getMediaRingtones() { if (PackageManager.PERMISSION_GRANTED != mContext.checkPermission( android.Manifest.permission.READ_EXTERNAL_STORAGE, Process.myPid(), Process.myUid())) { Log.w(TAG, "No READ_EXTERNAL_STORAGE permission, ignoring ringtones on ext storage"); return null; } // Get the external media cursor. First check to see if it is mounted. final String status = Environment.getExternalStorageState(); Loading Loading
media/java/android/media/RingtoneManager.java +16 −3 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.annotation.SdkConstant.SdkConstantType; import android.app.Activity; import android.content.ContentUris; import android.content.Context; import android.content.pm.PackageManager; import android.database.Cursor; import android.net.Uri; import android.os.Environment; import android.os.Process; import android.provider.MediaStore; import android.provider.Settings; import android.provider.Settings.System; Loading Loading @@ -359,6 +361,9 @@ public class RingtoneManager { * If {@link RingtoneManager#RingtoneManager(Activity)} was not used, the * caller should manage the returned cursor through its activity's life * cycle to prevent leaking the cursor. * <p> * Note that the list of ringtones available will differ depending on whether the caller * has the {@link android.Manifest.permission#READ_EXTERNAL_STORAGE} permission. * * @return A {@link Cursor} of all the ringtones available. * @see #ID_COLUMN_INDEX Loading Loading @@ -455,7 +460,9 @@ public class RingtoneManager { /** * Returns a valid ringtone URI. No guarantees on which it returns. If it * cannot find one, returns null. * cannot find one, returns null. If it can only find one on external storage and the caller * doesn't have the {@link android.Manifest.permission#READ_EXTERNAL_STORAGE} permission, * returns null. * * @param context The context to use for querying. * @return A ringtone URI, or null if one cannot be found. Loading Loading @@ -495,6 +502,12 @@ public class RingtoneManager { } private Cursor getMediaRingtones() { if (PackageManager.PERMISSION_GRANTED != mContext.checkPermission( android.Manifest.permission.READ_EXTERNAL_STORAGE, Process.myPid(), Process.myUid())) { Log.w(TAG, "No READ_EXTERNAL_STORAGE permission, ignoring ringtones on ext storage"); return null; } // Get the external media cursor. First check to see if it is mounted. final String status = Environment.getExternalStorageState(); Loading