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.setAction(getIntent().getAction());
|
||||||
intent.setType(getIntent().getType());
|
intent.setType(getIntent().getType());
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
LinphoneService.instance()
|
|
||||||
.getNotificationManager()
|
|
||||||
.removeForegroundServiceNotificationIfPossible();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
100);
|
100);
|
||||||
|
|
|
@ -301,6 +301,10 @@ public abstract class MainActivity extends LinphoneGenericActivity
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
|
LinphoneService.instance()
|
||||||
|
.getNotificationManager()
|
||||||
|
.removeForegroundServiceNotificationIfPossible();
|
||||||
|
|
||||||
hideTopBar();
|
hideTopBar();
|
||||||
if (!mAlwaysHideTabBar
|
if (!mAlwaysHideTabBar
|
||||||
&& (getFragmentManager().getBackStackEntryCount() == 0
|
&& (getFragmentManager().getBackStackEntryCount() == 0
|
||||||
|
|
|
@ -236,8 +236,8 @@ public class NotificationsManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeForegroundServiceNotificationIfPossible() {
|
public void removeForegroundServiceNotificationIfPossible() {
|
||||||
if (!isServiceNotificationDisplayed()
|
if (mCurrentForegroundServiceNotification == SERVICE_NOTIF_ID
|
||||||
&& mCurrentForegroundServiceNotification == SERVICE_NOTIF_ID) {
|
&& !isServiceNotificationDisplayed()) {
|
||||||
stopForeground();
|
stopForeground();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue