Trying to set default ringtone get a SecurityException
<p>I'm trying to use this:</p>

<pre><code>RingtoneManager.setActualDefaultRingtoneUri(this, RingtoneManager.TYPE_RINGTONE, newUri);
</code></pre>

<p>... to set the default ringtone. A exception goes off, with type <code>SecurtyException</code>.</p>

<p>I looked at this:</p>

<pre><code>RingtoneManager.setActualDefaultRingtoneUri(this, RingtoneManager.TYPE_RINGTONE, newUri);
</code></pre>

<p>... to see if there was any permissions to set in menefest file that corresponded to ringtones, could not find any.</p>

<p>The following is my code:</p>

<pre><code>// make it a ring tone
    void   MakeRingtune( String name)
    {

    File newSoundFile = new File("/sdcard/", "myringtone.oog");

    String strUri = "android.resource://"+getPackageName()+  "/" + "raw/"+name;
    Uri mUri = Uri.parse(strUri);

    ContentResolver mCr = getContentResolver();
    AssetFileDescriptor soundFile;
    try {
           soundFile= mCr.openAssetFileDescriptor(mUri, "r");
       } catch (FileNotFoundException e) {
           MessageBox("Ringtone Manager ","System Error cannot add ringtone ");
           return;  
       }

       try {
          byte[] readData = new byte[1024];
          FileInputStream fis = soundFile.createInputStream();
          FileOutputStream fos = new FileOutputStream(newSoundFile);
          int i = fis.read(readData);

          while (i != -1) {
            fos.write(readData, 0, i);
            i = fis.read(readData);
          }

          fos.close();
       } catch (IOException io) {
           MessageBox("Ringtone Manager ","Could not copy Ringtone, may be due to no sd card");
           return;
       }

//////////////////////////////////////////
       ContentValues values = new ContentValues();
       values.put(MediaStore.MediaColumns.DATA, newSoundFile.getAbsolutePath());
       values.put(MediaStore.MediaColumns.TITLE, "my ringtone");
       values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/oog");
       values.put(MediaStore.MediaColumns.SIZE, newSoundFile.length());
       values.put(MediaStore.Audio.Media.ARTIST, R.string.app_name);
       values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
       values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
       values.put(MediaStore.Audio.Media.IS_ALARM, true);
       values.put(MediaStore.Audio.Media.IS_MUSIC, false);

       Uri uri = MediaStore.Audio.Media.getContentUriForPath(newSoundFile.getAbsolutePath());
       Uri newUri = mCr.insert(uri, values);


       try {
           RingtoneManager.setActualDefaultRingtoneUri(this, RingtoneManager.TYPE_RINGTONE, newUri);
       } catch (Throwable t) {
        //   Log.d(TAG, "catch exception");
           MessageBox("Ringtone Manager ","Could not set as your default ringtone ");
           return;
       }

///////////////////////////////////////   
       MessageBox("Ringtone Manager ","Sound Clip Added to your Ringtones");
    } // end methed
</code></pre>
