Bug 368089 - Ringing Phone stops
Summary: Ringing Phone stops
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: android-application (other bugs)
Version First Reported In: unspecified
Platform: Android Android 5.x
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-01 08:17 UTC by Victor Tran
Modified: 2018-02-05 19:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Tran 2016-09-01 08:17:11 UTC
Ok, there are a few prerequisites.
- The user must have a custom ringtone.
- There are possibly more that I don't know about.

When the ringtone is a user defined ringtone, after one iteration, KDE Connect stops playing the ringtone.

I tested with a custom ringtone, and it didn't loop. When I reverted back to the default 'Over the Horizon' (which sounds pretty good!) the sound looped.

I had this problem when I was coding this thing called theLink for Android, I fixed this issue by creating an object of type MediaPlayer, setting the Data Source to the URI of the default ringtone, setting the Looping property to true and starting it. When the activity was destroyed, I would stop the media player.

           MediaPlayer mp = new MediaPlayer();
            mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
            mp.setDataSource(getApplicationContext(), RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE));
            mp.setLooping(true);
            mp.prepare();
            mp.start();