Skip to content

Commit c99da77

Browse files
author
Antonis Tsakiridis
committed
Added some more debugging logs for sounds
1 parent 1048ad8 commit c99da77

File tree

7 files changed

+24
-13
lines changed

7 files changed

+24
-13
lines changed

Examples/restcomm-olympus/.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#Mon Sep 19 10:28:34 EEST 2016
2-
VERSION_CODE=1239
1+
#Mon Sep 19 12:31:43 EEST 2016
2+
VERSION_CODE=1263
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#Mon Sep 19 10:28:34 EEST 2016
2-
VERSION_CODE=1259
1+
#Mon Sep 19 12:31:43 EEST 2016
2+
VERSION_CODE=1283

restcomm.android.sdk/src/main/java/org/restcomm/android/sdk/MediaClient/AppRTCAudioManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ public void abandonFocus()
270270

271271
}
272272

273-
public void endCall()
273+
public void endCallMedia()
274274
{
275-
RCLogger.d(TAG, "endCall");
275+
RCLogger.d(TAG, "endCallMedia");
276276
if (!callAudioInitialized) {
277277
return;
278278
}

restcomm.android.sdk/src/main/java/org/restcomm/android/sdk/MediaClient/MediaPlayerWrapper.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,15 @@ public class MediaPlayerWrapper implements MediaPlayer.OnCompletionListener {
2727

2828
MediaPlayerWrapper(Context androidContext)
2929
{
30+
RCLogger.v(TAG, "MediaPlayerWrapper()");
3031
this.androidContext = androidContext;
3132
}
3233

3334
void play(int resid, boolean loop)
3435
{
36+
RCLogger.v(TAG, "MediaPlayerWrapper.play(): " + resid);
3537
if (mediaPlayer != null) {
38+
RCLogger.v(TAG, "MediaPlayerWrapper.play(): reset");
3639
mediaPlayer.stop();
3740
mediaPlayer.release();
3841
mediaPlayer = null;
@@ -54,7 +57,9 @@ void play(int resid, boolean loop)
5457

5558
void stop()
5659
{
60+
RCLogger.v(TAG, "MediaPlayerWrapper.stop()");
5761
if (mediaPlayer != null) {
62+
RCLogger.v(TAG, "MediaPlayerWrapper.stop(): stopping");
5863
mediaPlayer.stop();
5964
mediaPlayer.release();
6065
mediaPlayer = null;
@@ -65,6 +70,7 @@ void stop()
6570

6671
void close()
6772
{
73+
RCLogger.v(TAG, "MediaPlayerWrapper.close()");
6874
if (mediaPlayer != null) {
6975
mediaPlayer.stop();
7076
mediaPlayer.release();
@@ -76,12 +82,15 @@ void close()
7682

7783
public void onCompletion(MediaPlayer mediaPlayer)
7884
{
79-
RCLogger.i(TAG, "onCompletion()");
85+
RCLogger.v(TAG, "onCompletion()");
8086
((AudioManager) androidContext.getSystemService(Context.AUDIO_SERVICE)).abandonAudioFocus(null);
8187

82-
this.mediaPlayer.stop();
83-
// mediaPlayer.reset();
84-
this.mediaPlayer.release();
85-
this.mediaPlayer = null;
88+
if (this.mediaPlayer != null) {
89+
RCLogger.v(TAG, "onCompletion(): reset");
90+
this.mediaPlayer.stop();
91+
// mediaPlayer.reset();
92+
this.mediaPlayer.release();
93+
this.mediaPlayer = null;
94+
}
8695
}
8796
}

restcomm.android.sdk/src/main/java/org/restcomm/android/sdk/RCConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ private void disconnectWebrtc()
12681268
}
12691269

12701270
releaseVideo();
1271-
audioManager.endCall();
1271+
audioManager.endCallMedia();
12721272
}
12731273

12741274
private void releaseVideo()

restcomm.android.sdk/src/main/java/org/restcomm/android/sdk/RCDevice.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,8 @@ private void notificationHandleForegroundUpdate(RCConnection connection)
14261426
.setSmallIcon(R.drawable.ic_phone_in_talk_24dp)
14271427
.setContentTitle(peerUsername)
14281428
.setContentText("Tap to return to call")
1429+
// Notice that for some reason using FLAG_UPDATE_CURRENT doesn't work. The problem is that the intent creates a new Call Activity instead of
1430+
// taking us to the existing.
14291431
.addAction(resId, muteString, PendingIntent.getService(getApplicationContext(), 0, serviceIntentMute, PendingIntent.FLAG_CANCEL_CURRENT))
14301432
.addAction(R.drawable.ic_call_end_24dp, "Hang up", PendingIntent.getService(getApplicationContext(), 0, serviceIntentDisconnect, PendingIntent.FLAG_CANCEL_CURRENT))
14311433
.setContentIntent(PendingIntent.getActivity(getApplicationContext(), 0, callIntent, PendingIntent.FLAG_CANCEL_CURRENT));

0 commit comments

Comments
 (0)