Lines Matching defs:template

532             final NetworkTemplate template = intent.getParcelableExtra(EXTRA_NETWORK_TEMPLATE);
533 performSnooze(template, TYPE_WARNING);
551 final NetworkTemplate template = NetworkTemplate.buildTemplateWifi(config.SSID);
553 if (mNetworkPolicy.containsKey(template)) {
554 mNetworkPolicy.remove(template);
580 final NetworkTemplate template = NetworkTemplate.buildTemplateWifi(info.getSSID());
582 NetworkPolicy policy = mNetworkPolicy.get(template);
586 policy = new NetworkPolicy(template, CYCLE_NONE, Time.TIMEZONE_UTC,
638 if (!isTemplateRelevant(policy.template)) continue;
643 final long totalBytes = getTotalBytes(policy.template, start, end);
650 notifyOverLimitLocked(policy.template);
654 notifyUnderLimitLocked(policy.template);
681 private boolean isTemplateRelevant(NetworkTemplate template) {
684 switch (template.getMatchRule()) {
691 return Objects.equal(tele.getSubscriberId(), template.getSubscriberId());
703 private void notifyOverLimitLocked(NetworkTemplate template) {
704 if (!mOverLimitNotified.contains(template)) {
705 mContext.startActivity(buildNetworkOverLimitIntent(template));
706 mOverLimitNotified.add(template);
710 private void notifyUnderLimitLocked(NetworkTemplate template) {
711 mOverLimitNotified.remove(template);
719 return TAG + ":" + policy.template.hashCode() + ":" + type;
743 final Intent snoozeIntent = buildSnoozeWarningIntent(policy.template);
747 final Intent viewIntent = buildViewDataUsageIntent(policy.template);
757 switch (policy.template.getMatchRule()) {
781 final Intent intent = buildNetworkOverLimitIntent(policy.template);
792 switch (policy.template.getMatchRule()) {
816 final Intent intent = buildViewDataUsageIntent(policy.template);
918 setNetworkTemplateEnabled(policy.template, true);
924 final long totalBytes = getTotalBytes(policy.template, start, end);
931 setNetworkTemplateEnabled(policy.template, networkEnabled);
939 private void setNetworkTemplateEnabled(NetworkTemplate template, boolean enabled) {
942 switch (template.getMatchRule()) {
949 && Objects.equal(tele.getSubscriberId(), template.getSubscriberId())) {
961 throw new IllegalArgumentException("unexpected template");
998 // collect all active ifaces that match this template
1002 if (policy.template.matches(ident)) {
1027 totalBytes = getTotalBytes(policy.template, start, currentTime);
1112 if (policy.template.matches(probeIdent)) {
1131 final NetworkTemplate template = buildTemplateMobileAll(subscriberId);
1132 final NetworkPolicy policy = new NetworkPolicy(template, cycleDay, cycleTimezone,
1218 final NetworkTemplate template = new NetworkTemplate(
1220 mNetworkPolicy.put(template, new NetworkPolicy(template, cycleDay,
1293 final NetworkTemplate template = policy.template;
1296 writeIntAttribute(out, ATTR_NETWORK_TEMPLATE, template.getMatchRule());
1297 final String subscriberId = template.getSubscriberId();
1301 final String networkId = template.getNetworkId();
1442 mNetworkPolicy.put(policy.template, policy);
1453 mNetworkPolicy.put(policy.template, policy);
1472 public void snoozeLimit(NetworkTemplate template) {
1477 performSnooze(template, TYPE_LIMIT);
1483 private void performSnooze(NetworkTemplate template, int type) {
1488 final NetworkPolicy policy = mNetworkPolicy.get(template);
1490 throw new IllegalArgumentException("unable to find policy for " + template);
1538 if (policy.template.matches(ident)) {
1577 final long totalBytes = getTotalBytes(policy.template, start, end);
1996 private long getTotalBytes(NetworkTemplate template, long start, long end) {
1998 return mNetworkStats.getNetworkTotalBytes(template, start, end);
2037 private static Intent buildSnoozeWarningIntent(NetworkTemplate template) {
2039 intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
2043 private static Intent buildNetworkOverLimitIntent(NetworkTemplate template) {
2048 intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
2052 private static Intent buildViewDataUsageIntent(NetworkTemplate template) {
2057 intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);