<!-- Menu item to delete a VPN profile. [CHAR LIMIT=40] -->
<string name="vpn_menu_delete">Delete profile</string>
+ <!-- Toast message when there is no network connection to start VPN. [CHAR LIMIT=100] -->
+ <string name="vpn_no_network">There is no network connection. Please try again later.</string>
+ <!-- Toast message when a certificate is missing. [CHAR LIMIT=100] -->
+ <string name="vpn_missing_cert">A certificate is missing. Please edit the profile.</string>
+
<!-- Tab label for built-in system CA certificates. -->
<string name="trusted_credentials_system_tab">System</string>
<!-- Tab label for user added CA certificates. -->
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView.AdapterContextMenuInfo;
+import android.widget.Toast;
import com.android.internal.net.LegacyVpnInfo;
import com.android.internal.net.VpnConfig;
private String[] getDefaultNetwork() throws Exception {
LinkProperties network = mService.getActiveLinkProperties();
if (network == null) {
+ Toast.makeText(getActivity(), R.string.vpn_no_network, Toast.LENGTH_LONG).show();
throw new IllegalStateException("Network is not available");
}
String interfaze = network.getInterfaceName();
if (interfaze == null) {
+ Toast.makeText(getActivity(), R.string.vpn_no_network, Toast.LENGTH_LONG).show();
throw new IllegalStateException("Cannot get the default interface");
}
String gateway = null;
}
}
if (gateway == null) {
+ Toast.makeText(getActivity(), R.string.vpn_no_network, Toast.LENGTH_LONG).show();
throw new IllegalStateException("Cannot get the default gateway");
}
return new String[] {interfaze, gateway};
serverCert = (value == null) ? null : new String(value, Charsets.UTF_8);
}
if (privateKey == null || userCert == null || caCert == null || serverCert == null) {
- // TODO: find out a proper way to handle this. Delete these keys?
+ Toast.makeText(getActivity(), R.string.vpn_missing_cert, Toast.LENGTH_LONG).show();
throw new IllegalStateException("Cannot load credentials");
}