Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/acomminos/Plumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Comminos <andrew@comminos.com>2017-08-03 23:52:04 +0300
committerAndrew Comminos <andrew@comminos.com>2017-08-03 23:52:04 +0300
commit1d120322c5af19646f502aa8a0b6c3ec14da47de (patch)
tree8f240a1354bff199c855f478c03327546699c8be
parent3fbbef140168f6bb8bb609c7976ef572083969d4 (diff)
Avoid suppressing foreground service notifications when activity is shown.
-rw-r--r--app/src/main/java/com/morlunk/mumbleclient/channel/ChannelFragment.java2
-rw-r--r--app/src/main/java/com/morlunk/mumbleclient/service/PlumbleService.java8
2 files changed, 4 insertions, 6 deletions
diff --git a/app/src/main/java/com/morlunk/mumbleclient/channel/ChannelFragment.java b/app/src/main/java/com/morlunk/mumbleclient/channel/ChannelFragment.java
index bc2932c..6bc85b4 100644
--- a/app/src/main/java/com/morlunk/mumbleclient/channel/ChannelFragment.java
+++ b/app/src/main/java/com/morlunk/mumbleclient/channel/ChannelFragment.java
@@ -289,7 +289,7 @@ public class ChannelFragment extends JumbleServiceFragment implements SharedPref
mTalkButton.setLayoutParams(params);
boolean muted = false;
- if (getService().isConnected()) {
+ if (getService() != null && getService().isConnected()) {
IUser user = getService().getSession().getSessionUser();
muted = user.isMuted() || user.isSuppressed() || user.isSelfMuted();
}
diff --git a/app/src/main/java/com/morlunk/mumbleclient/service/PlumbleService.java b/app/src/main/java/com/morlunk/mumbleclient/service/PlumbleService.java
index 30865ba..0872487 100644
--- a/app/src/main/java/com/morlunk/mumbleclient/service/PlumbleService.java
+++ b/app/src/main/java/com/morlunk/mumbleclient/service/PlumbleService.java
@@ -123,16 +123,14 @@ public class PlumbleService extends JumbleService implements
getString(R.string.plumbleConnecting),
getString(R.string.connecting),
PlumbleService.this);
- if (!mSuppressNotifications) {
- mNotification.show();
- }
+ mNotification.show();
mErrorShown = false;
}
@Override
public void onConnected() {
- if (mNotification != null && !mSuppressNotifications) {
+ if (mNotification != null) {
mNotification.setCustomTicker(getString(R.string.plumbleConnected));
mNotification.setCustomContentText(getString(R.string.connected));
mNotification.setActionsShown(true);
@@ -167,7 +165,7 @@ public class PlumbleService extends JumbleService implements
public void onUserStateUpdated(IUser user) {
if(user.getSession() == getSessionId()) {
mSettings.setMutedAndDeafened(user.isSelfMuted(), user.isSelfDeafened()); // Update settings mute/deafen state
- if(mNotification != null && !mSuppressNotifications) {
+ if(mNotification != null) {
String contentText;
if (user.isSelfMuted() && user.isSelfDeafened())
contentText = getString(R.string.status_notify_muted_and_deafened);