Show allowed/blocked/hosts count only if there is something to count

This commit is contained in:
M66B 2016-02-04 08:54:54 +01:00
parent df2c62aca0
commit 989303efc6
1 changed files with 10 additions and 7 deletions

View File

@ -1458,13 +1458,16 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
.setPriority(Notification.PRIORITY_MIN);
}
NotificationCompat.BigTextStyle notification = new NotificationCompat.BigTextStyle(builder);
notification.bigText(getString(R.string.msg_started));
if (Util.isPlayStoreInstall(this))
notification.setSummaryText(getString(R.string.msg_packages, allowed, blocked));
else
notification.setSummaryText(getString(R.string.msg_hosts, allowed, blocked, hosts));
return notification.build();
if (allowed > 0 || blocked > 0 || hosts > 0) {
NotificationCompat.BigTextStyle notification = new NotificationCompat.BigTextStyle(builder);
notification.bigText(getString(R.string.msg_started));
if (Util.isPlayStoreInstall(this))
notification.setSummaryText(getString(R.string.msg_packages, allowed, blocked));
else
notification.setSummaryText(getString(R.string.msg_hosts, allowed, blocked, hosts));
return notification.build();
} else
return builder.build();
}
private void updateEnforcingNotification(int allowed, int total) {