Lines Matching defs:template

594             final NetworkTemplate template = intent.getParcelableExtra(EXTRA_NETWORK_TEMPLATE);
595 performSnooze(template, TYPE_WARNING);
613 final NetworkTemplate template = NetworkTemplate.buildTemplateWifi(config.SSID);
615 if (mNetworkPolicy.containsKey(template)) {
616 mNetworkPolicy.remove(template);
642 final NetworkTemplate template = NetworkTemplate.buildTemplateWifi(info.getSSID());
644 NetworkPolicy policy = mNetworkPolicy.get(template);
648 policy = new NetworkPolicy(template, CYCLE_NONE, Time.TIMEZONE_UTC,
700 if (!isTemplateRelevant(policy.template)) continue;
705 final long totalBytes = getTotalBytes(policy.template, start, end);
712 notifyOverLimitLocked(policy.template);
716 notifyUnderLimitLocked(policy.template);
744 private boolean isTemplateRelevant(NetworkTemplate template) {
745 if (template.isMatchRuleMobile()) {
749 // Mobile template is relevant when any active subscriber matches
755 if (template.matches(probeIdent)) {
769 private void notifyOverLimitLocked(NetworkTemplate template) {
770 if (!mOverLimitNotified.contains(template)) {
771 mContext.startActivity(buildNetworkOverLimitIntent(template));
772 mOverLimitNotified.add(template);
776 private void notifyUnderLimitLocked(NetworkTemplate template) {
777 mOverLimitNotified.remove(template);
785 return TAG + ":" + policy.template.hashCode() + ":" + type;
811 final Intent snoozeIntent = buildSnoozeWarningIntent(policy.template);
815 final Intent viewIntent = buildViewDataUsageIntent(policy.template);
826 switch (policy.template.getMatchRule()) {
851 final Intent intent = buildNetworkOverLimitIntent(policy.template);
862 switch (policy.template.getMatchRule()) {
886 final Intent intent = buildViewDataUsageIntent(policy.template);
992 setNetworkTemplateEnabled(policy.template, true);
998 final long totalBytes = getTotalBytes(policy.template, start, end);
1005 setNetworkTemplateEnabled(policy.template, networkEnabled);
1013 private void setNetworkTemplateEnabled(NetworkTemplate template, boolean enabled) {
1081 if (policy.template.matches(ident.second)) {
1106 totalBytes = getTotalBytes(policy.template, start, currentTime);
1205 final NetworkTemplate template = mNetworkPolicy.keyAt(i);
1206 if (template.matches(probeIdent)) {
1208 Slog.d(TAG, "Found template " + template + " which matches subscriber "
1228 final NetworkTemplate template = buildTemplateMobileAll(subscriberId);
1229 final NetworkPolicy policy = new NetworkPolicy(template, cycleDay, cycleTimezone,
1314 final NetworkTemplate template = new NetworkTemplate(networkTemplate,
1316 mNetworkPolicy.put(template, new NetworkPolicy(template, cycleDay,
1390 final NetworkTemplate template = policy.template;
1393 writeIntAttribute(out, ATTR_NETWORK_TEMPLATE, template.getMatchRule());
1394 final String subscriberId = template.getSubscriberId();
1398 final String networkId = template.getNetworkId();
1627 policy.template = NetworkTemplate.normalize(policy.template, merged);
1628 final NetworkPolicy existing = mNetworkPolicy.get(policy.template);
1633 mNetworkPolicy.put(policy.template, policy);
1639 public void snoozeLimit(NetworkTemplate template) {
1644 performSnooze(template, TYPE_LIMIT);
1650 void performSnooze(NetworkTemplate template, int type) {
1655 final NetworkPolicy policy = mNetworkPolicy.get(template);
1657 throw new IllegalArgumentException("unable to find policy for " + template);
1707 if (policy.template.matches(ident)) {
1746 final long totalBytes = getTotalBytes(policy.template, start, end);
2179 private long getTotalBytes(NetworkTemplate template, long start, long end) {
2181 return mNetworkStats.getNetworkTotalBytes(template, start, end);
2220 private static Intent buildSnoozeWarningIntent(NetworkTemplate template) {
2222 intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
2226 private static Intent buildNetworkOverLimitIntent(NetworkTemplate template) {
2231 intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
2235 private static Intent buildViewDataUsageIntent(NetworkTemplate template) {
2240 intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);