Fix CtsDevicePolicyManagerTestCases not to rely on default ringtone

The default ringtone content is played in testAudioRestriction, but it
could fail on GSI environment if the default ringtone content doesn't
exist on GSI.

This CL fixes not to rely on default ringtone content and use internal
test resource instead.

Bug: 117805558
Change-Id: If9390e2b9a0a82c7a374daa260e3496cffaa6d2a
diff --git a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/res/raw/ringer.mp3 b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/res/raw/ringer.mp3
new file mode 100644
index 0000000..aa052e7
--- /dev/null
+++ b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/res/raw/ringer.mp3
Binary files differ
diff --git a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AudioRestrictionTest.java b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AudioRestrictionTest.java
index d44b782..e66d041 100644
--- a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AudioRestrictionTest.java
+++ b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AudioRestrictionTest.java
@@ -20,6 +20,7 @@
 import android.content.pm.PackageManager;
 import android.media.AudioManager;
 import android.media.MediaPlayer;
+import android.net.Uri;
 import android.provider.Settings;
 import android.os.SystemClock;
 import android.os.UserManager;
@@ -84,8 +85,9 @@
             return;
         }
 
+        Uri uri = Uri.parse("android.resource://" + mContext.getPackageName() + "/" + R.raw.ringer);
         MediaPlayer mediaPlayer = new MediaPlayer();
-        mediaPlayer.setDataSource(mContext, Settings.System.DEFAULT_RINGTONE_URI);
+        mediaPlayer.setDataSource(mContext, uri);
         mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
         mediaPlayer.prepare();
         mediaPlayer.setLooping(true);