Lines Matching defs:template

535             final NetworkTemplate template = intent.getParcelableExtra(EXTRA_NETWORK_TEMPLATE);
536 performSnooze(template, TYPE_WARNING);
554 final NetworkTemplate template = NetworkTemplate.buildTemplateWifi(
557 if (mNetworkPolicy.containsKey(template)) {
558 mNetworkPolicy.remove(template);
584 final NetworkTemplate template = NetworkTemplate.buildTemplateWifi(
587 NetworkPolicy policy = mNetworkPolicy.get(template);
591 policy = new NetworkPolicy(template, CYCLE_NONE, Time.TIMEZONE_UTC,
643 if (!isTemplateRelevant(policy.template)) continue;
648 final long totalBytes = getTotalBytes(policy.template, start, end);
655 notifyOverLimitLocked(policy.template);
659 notifyUnderLimitLocked(policy.template);
686 private boolean isTemplateRelevant(NetworkTemplate template) {
689 switch (template.getMatchRule()) {
696 return Objects.equal(tele.getSubscriberId(), template.getSubscriberId());
708 private void notifyOverLimitLocked(NetworkTemplate template) {
709 if (!mOverLimitNotified.contains(template)) {
710 mContext.startActivity(buildNetworkOverLimitIntent(template));
711 mOverLimitNotified.add(template);
715 private void notifyUnderLimitLocked(NetworkTemplate template) {
716 mOverLimitNotified.remove(template);
724 return TAG + ":" + policy.template.hashCode() + ":" + type;
748 final Intent snoozeIntent = buildSnoozeWarningIntent(policy.template);
752 final Intent viewIntent = buildViewDataUsageIntent(policy.template);
762 switch (policy.template.getMatchRule()) {
786 final Intent intent = buildNetworkOverLimitIntent(policy.template);
797 switch (policy.template.getMatchRule()) {
821 final Intent intent = buildViewDataUsageIntent(policy.template);
923 setNetworkTemplateEnabled(policy.template, true);
929 final long totalBytes = getTotalBytes(policy.template, start, end);
936 setNetworkTemplateEnabled(policy.template, networkEnabled);
944 private void setNetworkTemplateEnabled(NetworkTemplate template, boolean enabled) {
947 switch (template.getMatchRule()) {
954 && Objects.equal(tele.getSubscriberId(), template.getSubscriberId())) {
966 throw new IllegalArgumentException("unexpected template");
1003 // collect all active ifaces that match this template
1007 if (policy.template.matches(ident)) {
1032 totalBytes = getTotalBytes(policy.template, start, currentTime);
1117 if (policy.template.matches(probeIdent)) {
1136 final NetworkTemplate template = buildTemplateMobileAll(subscriberId);
1137 final NetworkPolicy policy = new NetworkPolicy(template, cycleDay, cycleTimezone,
1223 final NetworkTemplate template = new NetworkTemplate(
1225 mNetworkPolicy.put(template, new NetworkPolicy(template, cycleDay,
1298 final NetworkTemplate template = policy.template;
1301 writeIntAttribute(out, ATTR_NETWORK_TEMPLATE, template.getMatchRule());
1302 final String subscriberId = template.getSubscriberId();
1306 final String networkId = template.getNetworkId();
1447 mNetworkPolicy.put(policy.template, policy);
1458 mNetworkPolicy.put(policy.template, policy);
1477 public void snoozeLimit(NetworkTemplate template) {
1482 performSnooze(template, TYPE_LIMIT);
1488 private void performSnooze(NetworkTemplate template, int type) {
1493 final NetworkPolicy policy = mNetworkPolicy.get(template);
1495 throw new IllegalArgumentException("unable to find policy for " + template);
1543 if (policy.template.matches(ident)) {
1582 final long totalBytes = getTotalBytes(policy.template, start, end);
2001 private long getTotalBytes(NetworkTemplate template, long start, long end) {
2003 return mNetworkStats.getNetworkTotalBytes(template, start, end);
2042 private static Intent buildSnoozeWarningIntent(NetworkTemplate template) {
2044 intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
2048 private static Intent buildNetworkOverLimitIntent(NetworkTemplate template) {
2053 intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
2057 private static Intent buildViewDataUsageIntent(NetworkTemplate template) {
2062 intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);