From 5cb1f0dc1a81c9e06367eb13a1e23df2eec1c5fd Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Wed, 26 Apr 2017 17:22:56 +0200 Subject: [PATCH] Remove old PrresenceActivityType --- src/android/org/linphone/LinphoneManager.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/android/org/linphone/LinphoneManager.java b/src/android/org/linphone/LinphoneManager.java index 7c7eb4003..95eea9f33 100644 --- a/src/android/org/linphone/LinphoneManager.java +++ b/src/android/org/linphone/LinphoneManager.java @@ -444,6 +444,34 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag public void changeStatusToOnline() { LinphoneCore lc = getLcIfManagerNotDestroyedOrNull(); + if (isInstanciated() && lc != null && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.TV) { + lc.getPresenceModel().getActivity().setType(PresenceActivityType.TV); + } else if (isInstanciated() && lc != null && !isPresenceModelActivitySet()) { + PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.TV, null); + lc.setPresenceModel(model); + } + } + + public void changeStatusToOnThePhone() { + LinphoneCore lc = getLcIfManagerNotDestroyedOrNull(); + if (isInstanciated() && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.OnThePhone) { + lc.getPresenceModel().getActivity().setType(PresenceActivityType.OnThePhone); + } else if (isInstanciated() && !isPresenceModelActivitySet()) { + PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.OnThePhone, null); + lc.setPresenceModel(model); + } + } + + public void changeStatusToOffline() { + LinphoneCore lc = getLcIfManagerNotDestroyedOrNull(); + if (isInstanciated() && lc != null) { + lc.getPresenceModel().setBasicStatus(PresenceBasicStatus.Closed); + } + } + + public void changeStatusToOnline() { + + LinphoneCore lc = getLcIfManagerNotDestroyedOrNull(); if (isInstanciated() && lc != null && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.Online) { lc.getPresenceModel().getActivity().setType(PresenceActivityType.Online); } else if (isInstanciated() && lc != null && !isPresenceModelActivitySet()) {