Use a different string for vpn summary.

- for legacy vpn config, we do not get the vpn name to show in the
preference summary, and we used to simply show "Connected" as the summary
text. However, the string was changed to include the connected device
name as the parameter. Change to use connected summary string that does
not requires any parameter.

Change-Id: Ia6191eb315f5f23e0e6bf8da2a9537c211e8188e
Fixes: 77618408
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2018-04-12 14:04:10 -07:00
parent e6750d6c2d
commit 0a66946d6b
2 changed files with 19 additions and 2 deletions

View File

@@ -159,9 +159,10 @@ public class VpnPreferenceController extends AbstractPreferenceController
ThreadUtils.postOnMainThread(() -> mPreference.setSummary(summary));
}
private String getNameForVpnConfig(VpnConfig cfg, UserHandle user) {
@VisibleForTesting
String getNameForVpnConfig(VpnConfig cfg, UserHandle user) {
if (cfg.legacy) {
return mContext.getString(R.string.bluetooth_connected);
return mContext.getString(R.string.wifi_display_status_connected);
}
// The package name for an active VPN is stored in the 'user' field of its VpnConfig
final String vpnPackage = cfg.user;