mirror of https://github.com/M66B/NetGuard.git
parent
84db324612
commit
bab4790ef7
|
@ -1938,13 +1938,17 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
getTheme().resolveAttribute(R.attr.colorPrimary, tv, true);
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
|
||||
.setSmallIcon(R.drawable.ic_security_white_24dp)
|
||||
.setContentTitle(getString(R.string.app_name))
|
||||
.setContentText(getString(R.string.msg_started))
|
||||
.setContentIntent(pi)
|
||||
.setColor(tv.data)
|
||||
.setOngoing(true)
|
||||
.setAutoCancel(false);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
builder.setContentTitle(getString(R.string.msg_started));
|
||||
else
|
||||
builder.setContentTitle(getString(R.string.app_name))
|
||||
.setContentText(getString(R.string.msg_started));
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
builder.setCategory(Notification.CATEGORY_STATUS)
|
||||
.setVisibility(Notification.VISIBILITY_SECRET)
|
||||
|
@ -1952,13 +1956,21 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
}
|
||||
|
||||
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();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
if (Util.isPlayStoreInstall(this))
|
||||
builder.setContentText(getString(R.string.msg_packages, allowed, blocked));
|
||||
else
|
||||
builder.setContentText(getString(R.string.msg_hosts, allowed, blocked, hosts));
|
||||
return builder.build();
|
||||
} else {
|
||||
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();
|
||||
}
|
||||
|
@ -1978,13 +1990,17 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
getTheme().resolveAttribute(R.attr.colorPrimary, tv, true);
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
|
||||
.setSmallIcon(R.drawable.ic_security_white_24dp)
|
||||
.setContentTitle(getString(R.string.app_name))
|
||||
.setContentText(getString(R.string.msg_waiting))
|
||||
.setContentIntent(pi)
|
||||
.setColor(tv.data)
|
||||
.setOngoing(true)
|
||||
.setAutoCancel(false);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
builder.setContentTitle(getString(R.string.msg_waiting));
|
||||
else
|
||||
builder.setContentTitle(getString(R.string.app_name))
|
||||
.setContentText(getString(R.string.msg_waiting));
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
builder.setCategory(Notification.CATEGORY_STATUS)
|
||||
.setVisibility(Notification.VISIBILITY_SECRET)
|
||||
|
|
Loading…
Reference in New Issue