diff --git a/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhoneActivity.java b/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhoneActivity.java index a526d644..351712f3 100644 --- a/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhoneActivity.java +++ b/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhoneActivity.java @@ -26,8 +26,11 @@ public class FindMyPhoneActivity extends Activity { WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); - Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM); - ringtone = RingtoneManager.getRingtone(getApplicationContext(), notification); + Uri soundFile = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM); + if (soundFile == null) { + soundFile = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE); + } + ringtone = RingtoneManager.getRingtone(getApplicationContext(), soundFile); if (android.os.Build.VERSION.SDK_INT >= 21) { AudioAttributes.Builder b = new AudioAttributes.Builder();