Commit 42e93039 authored by Mygod's avatar Mygod

Output more information on failure of preparing VpnService

Fix #1424.
parent e0bf727b
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
<string name="stop">Stop</string> <string name="stop">Stop</string>
<string name="stopping">Shutting down…</string> <string name="stopping">Shutting down…</string>
<string name="vpn_error">%s</string> <string name="vpn_error">%s</string>
<string name="vpn_permission_denied">Permission denied to create a VPN service</string>
<string name="reboot_required">Failed to start VPN service. You might need to reboot your device.</string> <string name="reboot_required">Failed to start VPN service. You might need to reboot your device.</string>
<string name="profile_invalid_input">No valid profile data found.</string> <string name="profile_invalid_input">No valid profile data found.</string>
......
...@@ -167,7 +167,9 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe ...@@ -167,7 +167,9 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
override def onActivityResult(requestCode: Int, resultCode: Int, data: Intent): Unit = resultCode match { override def onActivityResult(requestCode: Int, resultCode: Int, data: Intent): Unit = resultCode match {
case Activity.RESULT_OK => Utils.startSsService(this) case Activity.RESULT_OK => Utils.startSsService(this)
case _ => Log.e(TAG, "Failed to start VpnService") case _ =>
Snackbar.make(findViewById(R.id.snackbar), R.string.vpn_permission_denied, Snackbar.LENGTH_LONG).show()
Log.e(TAG, "Failed to start VpnService: %s".formatLocal(Locale.ENGLISH, data.toString))
} }
override def onCreate(savedInstanceState: Bundle) { override def onCreate(savedInstanceState: Bundle) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment