fixed issue#645 that notification will show again when dismissed if the app is not the default message app.

This commit is contained in:
Coldice Ray Esedra
2017-02-21 15:39:28 +08:00
parent c54c1cc28c
commit 59c1946c8b
3 changed files with 8 additions and 2 deletions
@@ -36,6 +36,7 @@ import com.moez.QKSMS.model.SlideshowModel;
import com.moez.QKSMS.receiver.RemoteMessagingReceiver;
import com.moez.QKSMS.ui.MainActivity;
import com.moez.QKSMS.ui.ThemeManager;
import com.moez.QKSMS.ui.dialog.DefaultSmsHelper;
import com.moez.QKSMS.ui.messagelist.MessageItem;
import com.moez.QKSMS.ui.messagelist.MessageListActivity;
import com.moez.QKSMS.ui.popup.QKComposeActivity;
@@ -244,7 +245,8 @@ public class NotificationManager {
dismissOld(context, conversations);
// If there are no messages, don't try to create a notification
if (conversations.size() == 0) {
// If this app is not default message app, don't try to create a notification either
if (conversations.size() == 0||!(new DefaultSmsHelper(context, 0).isDefault())) {
return;
}
@@ -84,4 +84,8 @@ public class DefaultSmsHelper implements ActionClickListener {
return snackbarType;
}
public boolean isDefault() {
return mIsDefault;
}
}
+1 -1
View File
@@ -3,6 +3,6 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.android.tools.build:gradle:2.2.3'
}
}