Correctly remove the service notification when starting app for the first time since device boot
This commit is contained in:
parent
7f59bc2f95
commit
40ad029faf
3 changed files with 6 additions and 6 deletions
|
@ -97,10 +97,6 @@ public class LinphoneLauncherActivity extends Activity {
|
|||
intent.setAction(getIntent().getAction());
|
||||
intent.setType(getIntent().getType());
|
||||
startActivity(intent);
|
||||
|
||||
LinphoneService.instance()
|
||||
.getNotificationManager()
|
||||
.removeForegroundServiceNotificationIfPossible();
|
||||
}
|
||||
},
|
||||
100);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -236,8 +236,8 @@ public class NotificationsManager {
|
|||
}
|
||||
|
||||
public void removeForegroundServiceNotificationIfPossible() {
|
||||
if (!isServiceNotificationDisplayed()
|
||||
&& mCurrentForegroundServiceNotification == SERVICE_NOTIF_ID) {
|
||||
if (mCurrentForegroundServiceNotification == SERVICE_NOTIF_ID
|
||||
&& !isServiceNotificationDisplayed()) {
|
||||
stopForeground();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue