*/
private void notifyOverLimitNL(NetworkTemplate template) {
if (!mOverLimitNotified.contains(template)) {
- mContext.startActivity(buildNetworkOverLimitIntent(template));
+ mContext.startActivity(buildNetworkOverLimitIntent(mContext.getResources(), template));
mOverLimitNotified.add(template);
}
}
builder.setDeleteIntent(PendingIntent.getBroadcast(
mContext, 0, snoozeIntent, PendingIntent.FLAG_UPDATE_CURRENT));
- final Intent viewIntent = buildViewDataUsageIntent(policy.template);
+ final Intent viewIntent = buildViewDataUsageIntent(res, policy.template);
builder.setContentIntent(PendingIntent.getActivity(
mContext, 0, viewIntent, PendingIntent.FLAG_UPDATE_CURRENT));
builder.setContentTitle(title);
builder.setContentText(body);
- final Intent intent = buildNetworkOverLimitIntent(policy.template);
+ final Intent intent = buildNetworkOverLimitIntent(res, policy.template);
builder.setContentIntent(PendingIntent.getActivity(
mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT));
break;
builder.setContentTitle(title);
builder.setContentText(body);
- final Intent intent = buildViewDataUsageIntent(policy.template);
+ final Intent intent = buildViewDataUsageIntent(res, policy.template);
builder.setContentIntent(PendingIntent.getActivity(
mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT));
break;
return intent;
}
- private static Intent buildNetworkOverLimitIntent(NetworkTemplate template) {
+ private static Intent buildNetworkOverLimitIntent(Resources res, NetworkTemplate template) {
final Intent intent = new Intent();
- intent.setComponent(new ComponentName(
- "com.android.systemui", "com.android.systemui.net.NetworkOverLimitActivity"));
+ intent.setComponent(ComponentName.unflattenFromString(
+ res.getString(R.string.config_networkOverLimitComponent)));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
return intent;
}
- private static Intent buildViewDataUsageIntent(NetworkTemplate template) {
+ private static Intent buildViewDataUsageIntent(Resources res, NetworkTemplate template) {
final Intent intent = new Intent();
- intent.setComponent(new ComponentName(
- "com.android.settings", "com.android.settings.Settings$DataUsageSummaryActivity"));
+ intent.setComponent(ComponentName.unflattenFromString(
+ res.getString(R.string.config_dataUsageSummaryComponent)));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
return intent;