Snap for 4615953 from 61b44dca6e002389fd75b36d0d04e99294dc1f4a to pi-release

Change-Id: Ice53dcc93d82e4aff6812bf2515db95e757a611b
This commit is contained in:
android-build-team Robot
2018-02-22 08:21:26 +00:00

View File

@@ -152,7 +152,8 @@ import java.util.List;
*/ */
public class NetworkStatsService extends INetworkStatsService.Stub { public class NetworkStatsService extends INetworkStatsService.Stub {
static final String TAG = "NetworkStats"; static final String TAG = "NetworkStats";
static final boolean LOGV = false; static final boolean LOGD = Log.isLoggable(TAG, Log.DEBUG);
static final boolean LOGV = Log.isLoggable(TAG, Log.VERBOSE);
private static final int MSG_PERFORM_POLL = 1; private static final int MSG_PERFORM_POLL = 1;
private static final int MSG_UPDATE_IFACES = 2; private static final int MSG_UPDATE_IFACES = 2;
@@ -641,14 +642,14 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
if ((flags & NetworkStatsManager.FLAG_AUGMENT_WITH_SUBSCRIPTION_PLAN) != 0 if ((flags & NetworkStatsManager.FLAG_AUGMENT_WITH_SUBSCRIPTION_PLAN) != 0
&& (template.getMatchRule() == NetworkTemplate.MATCH_MOBILE_ALL) && (template.getMatchRule() == NetworkTemplate.MATCH_MOBILE_ALL)
&& mSettings.getAugmentEnabled()) { && mSettings.getAugmentEnabled()) {
Slog.d(TAG, "Resolving plan for " + template); if (LOGD) Slog.d(TAG, "Resolving plan for " + template);
final long token = Binder.clearCallingIdentity(); final long token = Binder.clearCallingIdentity();
try { try {
final SubscriptionManager sm = mContext.getSystemService(SubscriptionManager.class); final SubscriptionManager sm = mContext.getSystemService(SubscriptionManager.class);
final TelephonyManager tm = mContext.getSystemService(TelephonyManager.class); final TelephonyManager tm = mContext.getSystemService(TelephonyManager.class);
for (int subId : sm.getActiveSubscriptionIdList()) { for (int subId : sm.getActiveSubscriptionIdList()) {
if (template.matchesSubscriberId(tm.getSubscriberId(subId))) { if (template.matchesSubscriberId(tm.getSubscriberId(subId))) {
Slog.d(TAG, "Found active matching subId " + subId); if (LOGD) Slog.d(TAG, "Found active matching subId " + subId);
final List<SubscriptionPlan> plans = sm.getSubscriptionPlans(subId); final List<SubscriptionPlan> plans = sm.getSubscriptionPlans(subId);
if (!plans.isEmpty()) { if (!plans.isEmpty()) {
plan = plans.get(0); plan = plans.get(0);
@@ -658,7 +659,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
} finally { } finally {
Binder.restoreCallingIdentity(token); Binder.restoreCallingIdentity(token);
} }
Slog.d(TAG, "Resolved to plan " + plan); if (LOGD) Slog.d(TAG, "Resolved to plan " + plan);
} }
return plan; return plan;
} }