Use a fixed ringtone provided with the test case in resource folder.
Bug: 2557533

The file was created using the command: "sox -n -r 8000 -c 1 john_cage.ogg trim 0 433".
This solves the problem of being dependent on the current OEM ringtone in position 0,
and the length is long enough that isPlaying() should still be true.

Change-Id: Ic7e304cf3892fee6de02707bf57efc1b00c7e152
diff --git a/tests/tests/media/res/raw/john_cage.ogg b/tests/tests/media/res/raw/john_cage.ogg
new file mode 100644
index 0000000..62d2335
--- /dev/null
+++ b/tests/tests/media/res/raw/john_cage.ogg
Binary files differ
diff --git a/tests/tests/media/src/android/media/cts/RingtoneManagerTest.java b/tests/tests/media/src/android/media/cts/RingtoneManagerTest.java
index 0bece06..daa2645 100644
--- a/tests/tests/media/src/android/media/cts/RingtoneManagerTest.java
+++ b/tests/tests/media/src/android/media/cts/RingtoneManagerTest.java
@@ -238,7 +238,8 @@
 
         mRingtoneManager.setStopPreviousRingtone(true);
         assertTrue(mRingtoneManager.getStopPreviousRingtone());
-        Ringtone ringtone = mRingtoneManager.getRingtone(0);
+        Uri uri = Uri.parse("android.resource://android.media.cts/raw/John_Cage.ogg");
+        Ringtone ringtone = RingtoneManager.getRingtone(mContext, uri);
         ringtone.play();
         assertTrue(ringtone.isPlaying());
         Ringtone newRingtone = mRingtoneManager.getRingtone(0);
@@ -248,4 +249,4 @@
         mRingtoneManager.stopPreviousRingtone();
         assertFalse(newRingtone.isPlaying());
     }
-}
\ No newline at end of file
+}