From 6436cf765e274bc5f3cb918585bb601a3e1fef50 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 15 May 2019 16:30:25 +0200 Subject: [PATCH] Fixed video overlay --- CHANGELOG.md | 3 +++ .../java/org/linphone/call/CallActivity.java | 22 +++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a5f5a57a..d0ddaa0d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ Group changes to describe their impact on the project, as follows: ### Added - Added shortcuts to calls history & chat rooms list +- Improved device's do not disturb policy compliance +- Added sample application to help developpers getting started with our SDK +- Added picture in picture feature if supported instead of video overlay ## [4.1.0] - 2019-05-03 diff --git a/app/src/main/java/org/linphone/call/CallActivity.java b/app/src/main/java/org/linphone/call/CallActivity.java index 5ff46a115..080546ed0 100644 --- a/app/src/main/java/org/linphone/call/CallActivity.java +++ b/app/src/main/java/org/linphone/call/CallActivity.java @@ -50,6 +50,7 @@ import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.drawerlayout.widget.DrawerLayout; import org.linphone.LinphoneManager; +import org.linphone.LinphoneService; import org.linphone.R; import org.linphone.activities.DialerActivity; import org.linphone.activities.LinphoneGenericActivity; @@ -455,20 +456,31 @@ public class CallActivity extends LinphoneGenericActivity Log.w("[Call Activity] Resuming but no call found..."); finish(); } + + LinphoneService.instance().destroyOverlay(); } @Override protected void onPause() { - super.onPause(); - ContactsManager.getInstance().removeContactsListener(this); LinphoneManager.getCallManager().setCallInterface(null); + + Core core = LinphoneManager.getCore(); + if (LinphonePreferences.instance().isOverlayEnabled() + && core != null + && core.getCurrentCall() != null) { + Call call = core.getCurrentCall(); + if (call.getState() == Call.State.StreamsRunning) { + // Prevent overlay creation if video call is paused by remote + LinphoneService.instance().createOverlay(); + } + } + + super.onPause(); } @Override protected void onDestroy() { - super.onDestroy(); - Core core = LinphoneManager.getCore(); if (core != null) { core.removeListener(mListener); @@ -478,6 +490,8 @@ public class CallActivity extends LinphoneGenericActivity if (mZoomHelper != null) { mZoomHelper.destroy(); } + + super.onDestroy(); } @Override