From 47f0f3ddf4eca0faf5a8d372f96f8274bc6e6ac0 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 6 Apr 2021 10:39:18 +0200 Subject: [PATCH] Improved hide notification when not needed --- app/src/main/java/org/linphone/core/CoreContext.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/org/linphone/core/CoreContext.kt b/app/src/main/java/org/linphone/core/CoreContext.kt index ee6d4bd97..78d9b5f1b 100644 --- a/app/src/main/java/org/linphone/core/CoreContext.kt +++ b/app/src/main/java/org/linphone/core/CoreContext.kt @@ -121,6 +121,17 @@ class CoreContext(val context: Context, coreConfig: Config) { Log.i("[Context] Global state changed [$state]") if (state == GlobalState.On) { contactsManager.fetchContactsAsync() + } + } + + override fun onAccountRegistrationStateChanged( + core: Core, + account: Account, + state: RegistrationState?, + message: String + ) { + Log.i("[Context] Account [${account.params.identityAddress?.asStringUriOnly()}] registration state changed [$state]") + if (state == RegistrationState.Ok && account == core.defaultAccount) { notificationsManager.stopForegroundNotificationIfPossible() } }