int s = R.string.state_disabled;
if (error != ErrorState.NO_ERROR)
{
- s = R.string.state_error;
+ s = mService.getErrorText();
builder.setSmallIcon(R.drawable.ic_notification_warning);
builder.setColor(ContextCompat.getColor(this, R.color.error_text));
+ builder.setContentText(getString(R.string.tap_for_details));
}
else
{
PendingIntent.FLAG_UPDATE_CURRENT);
builder.addAction(R.drawable.ic_notification_disconnect, getString(R.string.disconnect), pending);
}
- builder.setContentText(name);
+ if (error == ErrorState.NO_ERROR)
+ {
+ builder.setContentText(name);
+ }
builder.setPublicVersion(buildNotification(true));
}
import android.os.Handler;
import android.os.IBinder;
+import org.strongswan.android.R;
import org.strongswan.android.data.VpnProfile;
import org.strongswan.android.logic.imc.ImcState;
import org.strongswan.android.logic.imc.RemediationInstruction;
return mError;
}
+ /**
+ * Get a description of the current error, if any.
+ *
+ * @return error description text id
+ */
+ public int getErrorText()
+ {
+ switch (mError)
+ {
+ case AUTH_FAILED:
+ if (mImcState == ImcState.BLOCK)
+ {
+ return R.string.error_assessment_failed;
+ }
+ else
+ {
+ return R.string.error_auth_failed;
+ }
+ case PEER_AUTH_FAILED:
+ return R.string.error_peer_auth_failed;
+ case LOOKUP_FAILED:
+ return R.string.error_lookup_failed;
+ case UNREACHABLE:
+ return R.string.error_unreachable;
+ default:
+ return R.string.error_generic;
+ }
+ }
+
/**
* Get the current IMC state, if any.
*
enableActionButton(null);
mStateView.setText(R.string.state_error);
mStateView.setTextColor(mColorStateError);
- switch (error)
- {
- case AUTH_FAILED:
- if (imcState == ImcState.BLOCK)
- {
- showError(R.string.error_assessment_failed);
- }
- else
- {
- showError(R.string.error_auth_failed);
- }
- break;
- case PEER_AUTH_FAILED:
- showError(R.string.error_peer_auth_failed);
- break;
- case LOOKUP_FAILED:
- showError(R.string.error_lookup_failed);
- break;
- case UNREACHABLE:
- showError(R.string.error_unreachable);
- break;
- default:
- showError(R.string.error_generic);
- break;
- }
+ showError(mService.getErrorText());
return true;
}
<string name="strongswan_shortcut">strongSwan-Verknüpfung</string>
<string name="permanent_notification_name">VPN Verbindungsstatus</string>
<string name="permanent_notification_description">Zeigt Informationen zum Verbindungsstatus der VPN Verbindung und dient als permanente Notification dazu, den VPN Dienst im Hintergrund am Laufen zu halten.</string>
+ <string name="tap_for_details">Antippen für Details.</string>
<!-- Settings -->
<string name="pref_title">Einstellungen</string>
<string name="strongswan_shortcut">Skrót strongSwan</string>
<string name="permanent_notification_name">VPN connection state</string>
<string name="permanent_notification_description">Provides information about the VPN connection state and serves as permanent notification to keep the VPN service running in the background.</string>
+ <string name="tap_for_details">Tap for details.</string>
<!-- Settings -->
<string name="pref_title">Settings</string>
<string name="strongswan_shortcut">Ссылка на strongSwan</string>
<string name="permanent_notification_name">VPN connection state</string>
<string name="permanent_notification_description">Provides information about the VPN connection state and serves as permanent notification to keep the VPN service running in the background.</string>
+ <string name="tap_for_details">Tap for details.</string>
<!-- Settings -->
<string name="pref_title">Settings</string>
<string name="strongswan_shortcut">strongSwan посилання</string>
<string name="permanent_notification_name">VPN connection state</string>
<string name="permanent_notification_description">Provides information about the VPN connection state and serves as permanent notification to keep the VPN service running in the background.</string>
+ <string name="tap_for_details">Tap for details.</string>
<!-- Settings -->
<string name="pref_title">Settings</string>
<string name="strongswan_shortcut">strongSwan快捷方式</string>
<string name="permanent_notification_name">VPN connection state</string>
<string name="permanent_notification_description">Provides information about the VPN connection state and serves as permanent notification to keep the VPN service running in the background.</string>
+ <string name="tap_for_details">Tap for details.</string>
<!-- Settings -->
<string name="pref_title">Settings</string>
<string name="strongswan_shortcut">strongSwan快速選單</string>
<string name="permanent_notification_name">VPN connection state</string>
<string name="permanent_notification_description">Provides information about the VPN connection state and serves as permanent notification to keep the VPN service running in the background.</string>
+ <string name="tap_for_details">Tap for details.</string>
<!-- Settings -->
<string name="pref_title">Settings</string>
<string name="strongswan_shortcut">strongSwan shortcut</string>
<string name="permanent_notification_name">VPN connection state</string>
<string name="permanent_notification_description">Provides information about the VPN connection state and serves as permanent notification to keep the VPN service running in the background.</string>
+ <string name="tap_for_details">Tap for details.</string>
<!-- Settings -->
<string name="pref_title">Settings</string>