Correctly remove the service notification when starting app for the first time since device boot

This commit is contained in:
Sylvain Berfini 2019-05-15 12:52:05 +02:00
parent 7f59bc2f95
commit 40ad029faf
3 changed files with 6 additions and 6 deletions

View file

@ -97,10 +97,6 @@ public class LinphoneLauncherActivity extends Activity {
intent.setAction(getIntent().getAction());
intent.setType(getIntent().getType());
startActivity(intent);
LinphoneService.instance()
.getNotificationManager()
.removeForegroundServiceNotificationIfPossible();
}
},
100);

View file

@ -301,6 +301,10 @@ public abstract class MainActivity extends LinphoneGenericActivity
protected void onResume() {
super.onResume();
LinphoneService.instance()
.getNotificationManager()
.removeForegroundServiceNotificationIfPossible();
hideTopBar();
if (!mAlwaysHideTabBar
&& (getFragmentManager().getBackStackEntryCount() == 0

View file

@ -236,8 +236,8 @@ public class NotificationsManager {
}
public void removeForegroundServiceNotificationIfPossible() {
if (!isServiceNotificationDisplayed()
&& mCurrentForegroundServiceNotification == SERVICE_NOTIF_ID) {
if (mCurrentForegroundServiceNotification == SERVICE_NOTIF_ID
&& !isServiceNotificationDisplayed()) {
stopForeground();
}
}