diff options
| -rw-r--r-- | core/res/res/values/config.xml | 3 | ||||
| -rw-r--r-- | core/res/res/values/symbols.xml | 4 | ||||
| -rw-r--r-- | services/core/java/com/android/server/net/NetworkPolicyManagerService.java | 20 |
3 files changed, 17 insertions, 10 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 2835c6f5fa0a..018072b0ea94 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2513,4 +2513,7 @@ Note: Also update appropriate overlay files. --> <string-array translatable="false" name="config_defaultFirstUserRestrictions"> </string-array> + + <string name="config_networkOverLimitComponent" translatable="false">com.android.systemui/com.android.systemui.net.NetworkOverLimitActivity</string> + <string name="config_dataUsageSummaryComponent" translatable="false">com.android.settings/com.android.settings.Settings$DataUsageSummaryActivity</string> </resources> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 2a40c0836ae5..e97ee8e8c4ea 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2646,6 +2646,10 @@ <!-- Colon separated list of package names that should be granted DND access --> <java-symbol type="string" name="config_defaultDndAccessPackages" /> + <!-- For NetworkPolicyManagerService --> + <java-symbol type="string" name="config_networkOverLimitComponent" /> + <java-symbol type="string" name="config_dataUsageSummaryComponent" /> + <java-symbol type="string" name="lockscreen_storage_locked" /> <!-- Used for MimeIconUtils. --> diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java index b22a08484b8a..d484628d5451 100644 --- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java @@ -1035,7 +1035,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { */ private void notifyOverLimitNL(NetworkTemplate template) { if (!mOverLimitNotified.contains(template)) { - mContext.startActivity(buildNetworkOverLimitIntent(template)); + mContext.startActivity(buildNetworkOverLimitIntent(mContext.getResources(), template)); mOverLimitNotified.add(template); } } @@ -1079,7 +1079,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { 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)); @@ -1115,7 +1115,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { 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; @@ -1150,7 +1150,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { 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; @@ -3519,19 +3519,19 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { 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; |