Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3de9a724 authored by Aaron Huang's avatar Aaron Huang Committed by Gerrit Code Review
Browse files

Merge "Migrate Slog to Log used in connectivity service module"

parents 179419f8 7dd09ff2
Loading
Loading
Loading
Loading
+36 −33
Original line number Diff line number Diff line
@@ -171,7 +171,6 @@ import android.util.ArraySet;
import android.util.LocalLog;
import android.util.Log;
import android.util.Pair;
import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.util.Xml;
@@ -1973,7 +1972,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
    private void registerNetdEventCallback() {
        final IIpConnectivityMetrics ipConnectivityMetrics = mDeps.getIpConnectivityMetrics();
        if (ipConnectivityMetrics == null) {
            Slog.wtf(TAG, "Missing IIpConnectivityMetrics");
            Log.wtf(TAG, "Missing IIpConnectivityMetrics");
            return;
        }

@@ -2439,7 +2438,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
            if (VDBG || DDBG) log("Setting MTU size: " + iface + ", " + mtu);
            mNetd.interfaceSetMtu(iface, mtu);
        } catch (RemoteException | ServiceSpecificException e) {
            Slog.e(TAG, "exception in interfaceSetMtu()" + e);
            loge("exception in interfaceSetMtu()" + e);
        }
    }

@@ -2461,7 +2460,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
        if (tcpBufferSizes.equals(mCurrentTcpBufferSizes)) return;

        try {
            if (VDBG || DDBG) Slog.d(TAG, "Setting tx/rx TCP buffers to " + tcpBufferSizes);
            if (VDBG || DDBG) log("Setting tx/rx TCP buffers to " + tcpBufferSizes);

            String rmemValues = String.join(" ", values[0], values[1], values[2]);
            String wmemValues = String.join(" ", values[3], values[4], values[5]);
@@ -2762,7 +2761,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
                case NetworkAgent.EVENT_NETWORK_CAPABILITIES_CHANGED: {
                    NetworkCapabilities networkCapabilities = (NetworkCapabilities) msg.obj;
                    if (networkCapabilities.hasConnectivityManagedCapability()) {
                        Slog.wtf(TAG, "BUG: " + nai + " has CS-managed capability.");
                        Log.wtf(TAG, "BUG: " + nai + " has CS-managed capability.");
                    }
                    if (networkCapabilities.hasTransport(TRANSPORT_TEST)) {
                        // Make sure the original object is not mutated. NetworkAgent normally
@@ -3067,7 +3066,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
            // Legacy version of notifyNetworkTestedWithExtras.
            // Would only be called if the system has a NetworkStack module older than the
            // framework, which does not happen in practice.
            Slog.wtf(TAG, "Deprecated notifyNetworkTested called: no action taken");
            Log.wtf(TAG, "Deprecated notifyNetworkTested called: no action taken");
        }

        @Override
@@ -3544,7 +3543,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
                numRequests = nai.numForegroundNetworkRequests();
                break;
            default:
                Slog.wtf(TAG, "Invalid reason. Cannot happen.");
                Log.wtf(TAG, "Invalid reason. Cannot happen.");
                return true;
        }

@@ -3706,7 +3705,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
        synchronized (mUidToNetworkRequestCount) {
            final int requests = mUidToNetworkRequestCount.get(nri.mUid, 0);
            if (requests < 1) {
                Slog.wtf(TAG, "BUG: too small request count " + requests + " for UID " + nri.mUid);
                Log.wtf(TAG, "BUG: too small request count " + requests + " for UID " + nri.mUid);
            } else if (requests == 1) {
                mUidToNetworkRequestCount.removeAt(mUidToNetworkRequestCount.indexOfKey(nri.mUid));
            } else {
@@ -3751,7 +3750,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
        }

        if (!nai.networkAgentConfig.explicitlySelected) {
            Slog.wtf(TAG, "BUG: setAcceptUnvalidated non non-explicitly selected network");
            Log.wtf(TAG, "BUG: setAcceptUnvalidated non non-explicitly selected network");
        }

        if (accept != nai.networkAgentConfig.acceptUnvalidated) {
@@ -4021,7 +4020,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
                highPriority = nai.networkAgentConfig.explicitlySelected;
                break;
            default:
                Slog.wtf(TAG, "Unknown notification type " + type);
                Log.wtf(TAG, "Unknown notification type " + type);
                return;
        }

@@ -4343,7 +4342,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
        synchronized (this) {
            if (!mNetTransitionWakeLock.isHeld()) {
                mWakelockLogs.log(String.format("RELEASE: already released (%s)", event));
                Slog.w(TAG, "expected Net Transition WakeLock to be held");
                Log.w(TAG, "expected Net Transition WakeLock to be held");
                return;
            }
            mNetTransitionWakeLock.release();
@@ -4515,7 +4514,7 @@ public class ConnectivityService extends IConnectivityManager.Stub

        @Override
        public void onChange(boolean selfChange) {
            Slog.wtf(TAG, "Should never be reached.");
            Log.wtf(TAG, "Should never be reached.");
        }

        @Override
@@ -4530,15 +4529,19 @@ public class ConnectivityService extends IConnectivityManager.Stub
    }

    private static void log(String s) {
        Slog.d(TAG, s);
        Log.d(TAG, s);
    }

    private static void logw(String s) {
        Log.w(TAG, s);
    }

    private static void loge(String s) {
        Slog.e(TAG, s);
        Log.e(TAG, s);
    }

    private static void loge(String s, Throwable t) {
        Slog.e(TAG, s, t);
        Log.e(TAG, s, t);
    }

    /**
@@ -4825,7 +4828,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
    @Override
    public boolean updateLockdownVpn() {
        if (Binder.getCallingUid() != Process.SYSTEM_UID) {
            Slog.w(TAG, "Lockdown VPN only available to AID_SYSTEM");
            logw("Lockdown VPN only available to AID_SYSTEM");
            return false;
        }

@@ -4835,21 +4838,21 @@ public class ConnectivityService extends IConnectivityManager.Stub
            if (mLockdownEnabled) {
                byte[] profileTag = mKeyStore.get(Credentials.LOCKDOWN_VPN);
                if (profileTag == null) {
                    Slog.e(TAG, "Lockdown VPN configured but cannot be read from keystore");
                    loge("Lockdown VPN configured but cannot be read from keystore");
                    return false;
                }
                String profileName = new String(profileTag);
                final VpnProfile profile = VpnProfile.decode(
                        profileName, mKeyStore.get(Credentials.VPN + profileName));
                if (profile == null) {
                    Slog.e(TAG, "Lockdown VPN configured invalid profile " + profileName);
                    loge("Lockdown VPN configured invalid profile " + profileName);
                    setLockdownTracker(null);
                    return true;
                }
                int user = UserHandle.getUserId(Binder.getCallingUid());
                Vpn vpn = mVpns.get(user);
                if (vpn == null) {
                    Slog.w(TAG, "VPN for user " + user + " not ready yet. Skipping lockdown");
                    logw("VPN for user " + user + " not ready yet. Skipping lockdown");
                    return false;
                }
                setLockdownTracker(new LockdownVpnTracker(mContext, this, mHandler, vpn, profile));
@@ -4909,7 +4912,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
            if (vpn == null) {
                // Shouldn't happen as all code paths that point here should have checked the Vpn
                // exists already.
                Slog.wtf(TAG, "User " + userId + " has no Vpn configuration");
                Log.wtf(TAG, "User " + userId + " has no Vpn configuration");
                return false;
            }

@@ -4925,7 +4928,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
        synchronized (mVpns) {
            Vpn vpn = mVpns.get(userId);
            if (vpn == null) {
                Slog.w(TAG, "User " + userId + " has no Vpn configuration");
                logw("User " + userId + " has no Vpn configuration");
                return false;
            }
            return vpn.isAlwaysOnPackageSupported(packageName, mKeyStore);
@@ -4946,7 +4949,7 @@ public class ConnectivityService extends IConnectivityManager.Stub

            Vpn vpn = mVpns.get(userId);
            if (vpn == null) {
                Slog.w(TAG, "User " + userId + " has no Vpn configuration");
                logw("User " + userId + " has no Vpn configuration");
                return false;
            }
            if (!vpn.setAlwaysOnPackage(packageName, lockdown, lockdownWhitelist, mKeyStore)) {
@@ -4968,7 +4971,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
        synchronized (mVpns) {
            Vpn vpn = mVpns.get(userId);
            if (vpn == null) {
                Slog.w(TAG, "User " + userId + " has no Vpn configuration");
                logw("User " + userId + " has no Vpn configuration");
                return null;
            }
            return vpn.getAlwaysOnPackage();
@@ -4983,7 +4986,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
        synchronized (mVpns) {
            Vpn vpn = mVpns.get(userId);
            if (vpn == null) {
                Slog.w(TAG, "User " + userId + " has no Vpn configuration");
                logw("User " + userId + " has no Vpn configuration");
                return false;
            }
            return vpn.getLockdown();
@@ -4998,7 +5001,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
        synchronized (mVpns) {
            Vpn vpn = mVpns.get(userId);
            if (vpn == null) {
                Slog.w(TAG, "User " + userId + " has no Vpn configuration");
                logw("User " + userId + " has no Vpn configuration");
                return null;
            }
            return vpn.getLockdownAllowlist();
@@ -5183,7 +5186,7 @@ public class ConnectivityService extends IConnectivityManager.Stub

    private void onPackageReplaced(String packageName, int uid) {
        if (TextUtils.isEmpty(packageName) || uid < 0) {
            Slog.wtf(TAG, "Invalid package in onPackageReplaced: " + packageName + " | " + uid);
            Log.wtf(TAG, "Invalid package in onPackageReplaced: " + packageName + " | " + uid);
            return;
        }
        final int userId = UserHandle.getUserId(uid);
@@ -5194,7 +5197,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
            }
            // Legacy always-on VPN won't be affected since the package name is not set.
            if (TextUtils.equals(vpn.getAlwaysOnPackage(), packageName)) {
                Slog.d(TAG, "Restarting always-on VPN package " + packageName + " for user "
                log("Restarting always-on VPN package " + packageName + " for user "
                        + userId);
                vpn.startAlwaysOnVpn(mKeyStore);
            }
@@ -5203,7 +5206,7 @@ public class ConnectivityService extends IConnectivityManager.Stub

    private void onPackageRemoved(String packageName, int uid, boolean isReplacing) {
        if (TextUtils.isEmpty(packageName) || uid < 0) {
            Slog.wtf(TAG, "Invalid package in onPackageRemoved: " + packageName + " | " + uid);
            Log.wtf(TAG, "Invalid package in onPackageRemoved: " + packageName + " | " + uid);
            return;
        }

@@ -5215,7 +5218,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
            }
            // Legacy always-on VPN won't be affected since the package name is not set.
            if (TextUtils.equals(vpn.getAlwaysOnPackage(), packageName) && !isReplacing) {
                Slog.d(TAG, "Removing always-on VPN package " + packageName + " for user "
                log("Removing always-on VPN package " + packageName + " for user "
                        + userId);
                vpn.setAlwaysOnPackage(null, false, null, mKeyStore);
            }
@@ -5831,7 +5834,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
            // Avoid creating duplicates. even if an app makes a direct AIDL call.
            // This will never happen if an app calls ConnectivityManager#registerNetworkProvider,
            // as that will throw if a duplicate provider is registered.
            Slog.e(TAG, "Attempt to register existing NetworkProviderInfo "
            loge("Attempt to register existing NetworkProviderInfo "
                    + mNetworkProviderInfos.get(npi.messenger).name);
            return;
        }
@@ -6441,7 +6444,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
            // stop being matched by the updated agent.
            String diff = nai.networkCapabilities.describeImmutableDifferences(nc);
            if (!TextUtils.isEmpty(diff)) {
                Slog.wtf(TAG, "BUG: " + nai + " lost immutable capabilities:" + diff);
                Log.wtf(TAG, "BUG: " + nai + " lost immutable capabilities:" + diff);
            }
        }

@@ -7001,7 +7004,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
            }
            newSatisfier.unlingerRequest(nri.request);
            if (!newSatisfier.addRequest(nri.request)) {
                Slog.wtf(TAG, "BUG: " + newSatisfier.toShortString() + " already has "
                Log.wtf(TAG, "BUG: " + newSatisfier.toShortString() + " already has "
                        + nri.request);
            }
        } else {
@@ -7349,7 +7352,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
            networkAgent.everConnected = true;

            if (networkAgent.linkProperties == null) {
                Slog.wtf(TAG, networkAgent.toShortString() + " connected with null LinkProperties");
                Log.wtf(TAG, networkAgent.toShortString() + " connected with null LinkProperties");
            }

            // NetworkCapabilities need to be set before sending the private DNS config to
+11 −11
Original line number Diff line number Diff line
@@ -45,8 +45,8 @@ import android.os.ServiceSpecificException;
import android.os.UserHandle;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
import android.util.Slog;

import java.net.InetAddress;
import java.util.Arrays;
@@ -279,7 +279,7 @@ public class DnsManager {
    }

    public PrivateDnsConfig updatePrivateDns(Network network, PrivateDnsConfig cfg) {
        Slog.w(TAG, "updatePrivateDns(" + network + ", " + cfg + ")");
        Log.w(TAG, "updatePrivateDns(" + network + ", " + cfg + ")");
        return (cfg != null)
                ? mPrivateDnsMap.put(network.netId, cfg)
                : mPrivateDnsMap.remove(network.netId);
@@ -389,7 +389,7 @@ public class DnsManager {
            mPrivateDnsValidationMap.remove(netId);
        }

        Slog.d(TAG, String.format("sendDnsConfigurationForNetwork(%d, %s, %s, %d, %d, %d, %d, "
        Log.d(TAG, String.format("sendDnsConfigurationForNetwork(%d, %s, %s, %d, %d, %d, %d, "
                + "%d, %d, %s, %s)", paramsParcel.netId, Arrays.toString(paramsParcel.servers),
                Arrays.toString(paramsParcel.domains), paramsParcel.sampleValiditySeconds,
                paramsParcel.successThreshold, paramsParcel.minSamples,
@@ -400,7 +400,7 @@ public class DnsManager {
        try {
            mDnsResolver.setResolverConfiguration(paramsParcel);
        } catch (RemoteException | ServiceSpecificException e) {
            Slog.e(TAG, "Error setting DNS configuration: " + e);
            Log.e(TAG, "Error setting DNS configuration: " + e);
            return;
        }
    }
@@ -431,8 +431,8 @@ public class DnsManager {
                DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS,
                DNS_RESOLVER_DEFAULT_SAMPLE_VALIDITY_SECONDS);
        if (mSampleValidity < 0 || mSampleValidity > 65535) {
            Slog.w(TAG, "Invalid sampleValidity=" + mSampleValidity + ", using default=" +
                    DNS_RESOLVER_DEFAULT_SAMPLE_VALIDITY_SECONDS);
            Log.w(TAG, "Invalid sampleValidity=" + mSampleValidity + ", using default="
                    + DNS_RESOLVER_DEFAULT_SAMPLE_VALIDITY_SECONDS);
            mSampleValidity = DNS_RESOLVER_DEFAULT_SAMPLE_VALIDITY_SECONDS;
        }

@@ -440,17 +440,17 @@ public class DnsManager {
                DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT,
                DNS_RESOLVER_DEFAULT_SUCCESS_THRESHOLD_PERCENT);
        if (mSuccessThreshold < 0 || mSuccessThreshold > 100) {
            Slog.w(TAG, "Invalid successThreshold=" + mSuccessThreshold + ", using default=" +
                    DNS_RESOLVER_DEFAULT_SUCCESS_THRESHOLD_PERCENT);
            Log.w(TAG, "Invalid successThreshold=" + mSuccessThreshold + ", using default="
                    + DNS_RESOLVER_DEFAULT_SUCCESS_THRESHOLD_PERCENT);
            mSuccessThreshold = DNS_RESOLVER_DEFAULT_SUCCESS_THRESHOLD_PERCENT;
        }

        mMinSamples = getIntSetting(DNS_RESOLVER_MIN_SAMPLES, DNS_RESOLVER_DEFAULT_MIN_SAMPLES);
        mMaxSamples = getIntSetting(DNS_RESOLVER_MAX_SAMPLES, DNS_RESOLVER_DEFAULT_MAX_SAMPLES);
        if (mMinSamples < 0 || mMinSamples > mMaxSamples || mMaxSamples > 64) {
            Slog.w(TAG, "Invalid sample count (min, max)=(" + mMinSamples + ", " + mMaxSamples +
                    "), using default=(" + DNS_RESOLVER_DEFAULT_MIN_SAMPLES + ", " +
                    DNS_RESOLVER_DEFAULT_MAX_SAMPLES + ")");
            Log.w(TAG, "Invalid sample count (min, max)=(" + mMinSamples + ", " + mMaxSamples
                    + "), using default=(" + DNS_RESOLVER_DEFAULT_MIN_SAMPLES + ", "
                    + DNS_RESOLVER_DEFAULT_MAX_SAMPLES + ")");
            mMinSamples = DNS_RESOLVER_DEFAULT_MIN_SAMPLES;
            mMaxSamples = DNS_RESOLVER_DEFAULT_MAX_SAMPLES;
        }
+19 −18
Original line number Diff line number Diff line
@@ -60,8 +60,8 @@ import android.os.UserHandle;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.util.DebugUtils;
import android.util.Log;
import android.util.Range;
import android.util.Slog;

import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
@@ -230,7 +230,7 @@ public class MultipathPolicyTracker {
            mUsageCallback = new UsageCallback() {
                @Override
                public void onThresholdReached(int networkType, String subscriberId) {
                    if (DBG) Slog.d(TAG, "onThresholdReached for network " + network);
                    if (DBG) Log.d(TAG, "onThresholdReached for network " + network);
                    mMultipathBudget = 0;
                    updateMultipathBudget();
                }
@@ -252,7 +252,7 @@ public class MultipathPolicyTracker {
            final long bytes = getNetworkTotalBytes(
                    start.toInstant().toEpochMilli(),
                    end.toInstant().toEpochMilli());
            if (DBG) Slog.d(TAG, "Non-default data usage: " + bytes);
            if (DBG) Log.d(TAG, "Non-default data usage: " + bytes);
            return bytes;
        }

@@ -261,7 +261,7 @@ public class MultipathPolicyTracker {
                return LocalServices.getService(NetworkStatsManagerInternal.class)
                        .getNetworkTotalBytes(mNetworkTemplate, start, end);
            } catch (RuntimeException e) {
                Slog.w(TAG, "Failed to get data usage: " + e);
                Log.w(TAG, "Failed to get data usage: " + e);
                return -1;
            }
        }
@@ -326,17 +326,17 @@ public class MultipathPolicyTracker {
        void updateMultipathBudget() {
            long quota = LocalServices.getService(NetworkPolicyManagerInternal.class)
                    .getSubscriptionOpportunisticQuota(this.network, QUOTA_TYPE_MULTIPATH);
            if (DBG) Slog.d(TAG, "Opportunistic quota from data plan: " + quota + " bytes");
            if (DBG) Log.d(TAG, "Opportunistic quota from data plan: " + quota + " bytes");

            // Fallback to user settings-based quota if not available from phone plan
            if (quota == OPPORTUNISTIC_QUOTA_UNKNOWN) {
                quota = getUserPolicyOpportunisticQuotaBytes();
                if (DBG) Slog.d(TAG, "Opportunistic quota from user policy: " + quota + " bytes");
                if (DBG) Log.d(TAG, "Opportunistic quota from user policy: " + quota + " bytes");
            }

            if (quota == OPPORTUNISTIC_QUOTA_UNKNOWN) {
                quota = getDefaultDailyMultipathQuotaBytes();
                if (DBG) Slog.d(TAG, "Setting quota: " + quota + " bytes");
                if (DBG) Log.d(TAG, "Setting quota: " + quota + " bytes");
            }

            // TODO: re-register if day changed: budget may have run out but should be refreshed.
@@ -344,7 +344,7 @@ public class MultipathPolicyTracker {
                // If there is already a usage callback pending , there's no need to re-register it
                // if the quota hasn't changed. The callback will simply fire as expected when the
                // budget is spent.
                if (DBG) Slog.d(TAG, "Quota still " + quota + ", not updating.");
                if (DBG) Log.d(TAG, "Quota still " + quota + ", not updating.");
                return;
            }
            mQuota = quota;
@@ -364,8 +364,9 @@ public class MultipathPolicyTracker {
            // since last time, so even if this is called very often the budget will not snap to 0
            // as soon as there are less than 2MB left for today.
            if (budget > NetworkStatsManager.MIN_THRESHOLD_BYTES) {
                if (DBG) Slog.d(TAG, "Setting callback for " + budget +
                        " bytes on network " + network);
                if (DBG) {
                    Log.d(TAG, "Setting callback for " + budget + " bytes on network " + network);
                }
                registerUsageCallback(budget);
            } else {
                maybeUnregisterUsageCallback();
@@ -402,7 +403,7 @@ public class MultipathPolicyTracker {

        private void maybeUnregisterUsageCallback() {
            if (haveMultipathBudget()) {
                if (DBG) Slog.d(TAG, "Unregistering callback, budget was " + mMultipathBudget);
                if (DBG) Log.d(TAG, "Unregistering callback, budget was " + mMultipathBudget);
                mStatsManager.unregisterUsageCallback(mUsageCallback);
                mMultipathBudget = 0;
            }
@@ -467,9 +468,9 @@ public class MultipathPolicyTracker {
                try {
                    mMultipathTrackers.put(network, new MultipathTracker(network, nc));
                } catch (IllegalStateException e) {
                    Slog.e(TAG, "Can't track mobile network " + network + ": " + e.getMessage());
                    Log.e(TAG, "Can't track mobile network " + network + ": " + e.getMessage());
                }
                if (DBG) Slog.d(TAG, "Tracking mobile network " + network);
                if (DBG) Log.d(TAG, "Tracking mobile network " + network);
            }

            @Override
@@ -479,7 +480,7 @@ public class MultipathPolicyTracker {
                    existing.shutdown();
                    mMultipathTrackers.remove(network);
                }
                if (DBG) Slog.d(TAG, "No longer tracking mobile network " + network);
                if (DBG) Log.d(TAG, "No longer tracking mobile network " + network);
            }
        };

@@ -524,16 +525,16 @@ public class MultipathPolicyTracker {

        @Override
        public void onChange(boolean selfChange) {
            Slog.wtf(TAG, "Should never be reached.");
            Log.wtf(TAG, "Should never be reached.");
        }

        @Override
        public void onChange(boolean selfChange, Uri uri) {
            if (!Settings.Global.getUriFor(NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES)
                    .equals(uri)) {
                Slog.wtf(TAG, "Unexpected settings observation: " + uri);
                Log.wtf(TAG, "Unexpected settings observation: " + uri);
            }
            if (DBG) Slog.d(TAG, "Settings change: updating budgets.");
            if (DBG) Log.d(TAG, "Settings change: updating budgets.");
            updateAllMultipathBudgets();
        }
    }
@@ -541,7 +542,7 @@ public class MultipathPolicyTracker {
    private final class ConfigChangeReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (DBG) Slog.d(TAG, "Configuration change: updating budgets.");
            if (DBG) Log.d(TAG, "Configuration change: updating budgets.");
            updateAllMultipathBudgets();
        }
    }
+21 −21

File changed.

Preview size limit exceeded, changes collapsed.

+7 −7
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import android.os.UserHandle;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Slog;
import android.util.Log;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.widget.Toast;
@@ -175,7 +175,7 @@ public class NetworkNotificationManager {
        final int previousEventId = mNotificationTypeMap.get(id);
        final NotificationType previousNotifyType = NotificationType.getFromId(previousEventId);
        if (priority(previousNotifyType) > priority(notifyType)) {
            Slog.d(TAG, String.format(
            Log.d(TAG, String.format(
                    "ignoring notification %s for network %s with existing notification %s",
                    notifyType, id, previousNotifyType));
            return;
@@ -183,7 +183,7 @@ public class NetworkNotificationManager {
        clearNotification(id);

        if (DBG) {
            Slog.d(TAG, String.format(
            Log.d(TAG, String.format(
                    "showNotification tag=%s event=%s transport=%s name=%s highPriority=%s",
                    tag, nameOf(eventId), getTransportName(transportType), name, highPriority));
        }
@@ -253,7 +253,7 @@ public class NetworkNotificationManager {
            // are sent, but they are not implemented yet.
            return;
        } else {
            Slog.wtf(TAG, "Unknown notification type " + notifyType + " on network transport "
            Log.wtf(TAG, "Unknown notification type " + notifyType + " on network transport "
                    + getTransportName(transportType));
            return;
        }
@@ -294,7 +294,7 @@ public class NetworkNotificationManager {
        try {
            mNotificationManager.notify(tag, eventId, notification);
        } catch (NullPointerException npe) {
            Slog.d(TAG, "setNotificationVisible: visible notificationManager error", npe);
            Log.d(TAG, "setNotificationVisible: visible notificationManager error", npe);
        }
    }

@@ -317,13 +317,13 @@ public class NetworkNotificationManager {
        final String tag = tagFor(id);
        final int eventId = mNotificationTypeMap.get(id);
        if (DBG) {
            Slog.d(TAG, String.format("clearing notification tag=%s event=%s", tag,
            Log.d(TAG, String.format("clearing notification tag=%s event=%s", tag,
                   nameOf(eventId)));
        }
        try {
            mNotificationManager.cancel(tag, eventId);
        } catch (NullPointerException npe) {
            Slog.d(TAG, String.format(
            Log.d(TAG, String.format(
                    "failed to clear notification tag=%s event=%s", tag, nameOf(eventId)), npe);
        }
        mNotificationTypeMap.delete(id);
Loading