Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aec967ac authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Move lockscreen sound effects to the system stream.

Bug: 2458106, 2451532
Change-Id: I01869e3fd461dc24aa3157bf38aba9d2967526ec
parent f2d8e74c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
@@ -932,8 +933,12 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
                final Uri soundUri = Uri.parse("file://" + soundPath);
                if (soundUri != null) {
                    final Ringtone sfx = RingtoneManager.getRingtone(mContext, soundUri);
                    if (sfx != null) sfx.play();
                    else Log.d(TAG, "playSounds: failed to load ringtone from uri: " + soundUri);
                    if (sfx != null) {
                        sfx.setStreamType(AudioManager.STREAM_SYSTEM);
                        sfx.play();
                    } else {
                        Log.d(TAG, "playSounds: failed to load ringtone from uri: " + soundUri);
                    }
                } else {
                    Log.d(TAG, "playSounds: could not parse Uri: " + soundPath);
                }