Merge changes I67e5fa23,I223b207c am: 879f21b545

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1483969

Change-Id: I74209eccb2fd5473d65968f765f3eb54ee99954e
This commit is contained in:
Lucas Lin
2020-11-10 05:47:18 +00:00
committed by Automerger Merge Worker
2 changed files with 9 additions and 6 deletions

View File

@@ -6443,8 +6443,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
&& !nai.networkAgentConfig.allowBypass
&& nc.getOwnerUid() != Process.SYSTEM_UID
&& lp.getInterfaceName() != null
&& (lp.hasIPv4DefaultRoute() || lp.hasIpv4UnreachableDefaultRoute())
&& (lp.hasIPv6DefaultRoute() || lp.hasIpv6UnreachableDefaultRoute());
&& (lp.hasIpv4DefaultRoute() || lp.hasIpv4UnreachableDefaultRoute())
&& (lp.hasIpv6DefaultRoute() || lp.hasIpv6UnreachableDefaultRoute());
}
private void updateUids(NetworkAgentInfo nai, NetworkCapabilities prevNc,

View File

@@ -43,7 +43,6 @@ import android.widget.Toast;
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.internal.notification.SystemNotificationChannels;
public class NetworkNotificationManager {
@@ -74,7 +73,12 @@ public class NetworkNotificationManager {
private static final String TAG = NetworkNotificationManager.class.getSimpleName();
private static final boolean DBG = true;
private static final boolean VDBG = false;
// Notification channels used by ConnectivityService mainline module, it should be aligned with
// SystemNotificationChannels.
public static final String NOTIFICATION_NETWORK_STATUS = "NETWORK_STATUS";
public static final String NOTIFICATION_NETWORK_ALERTS = "NETWORK_ALERTS";
public static final String NOTIFICATION_VPN = "VPN";
// The context is for the current user (system server)
private final Context mContext;
@@ -259,8 +263,7 @@ public class NetworkNotificationManager {
// the tag.
final boolean hasPreviousNotification = previousNotifyType != null;
final String channelId = (highPriority && !hasPreviousNotification)
? SystemNotificationChannels.NETWORK_ALERTS
: SystemNotificationChannels.NETWORK_STATUS;
? NOTIFICATION_NETWORK_ALERTS : NOTIFICATION_NETWORK_STATUS;
Notification.Builder builder = new Notification.Builder(mContext, channelId)
.setWhen(System.currentTimeMillis())
.setShowWhen(notifyType == NotificationType.NETWORK_SWITCH)