Handle security exception when starting VPN

This commit is contained in:
M66B 2016-03-20 20:20:20 +01:00
parent 0522715e21
commit 6ea9b2a934
1 changed files with 3 additions and 1 deletions

View File

@ -932,9 +932,11 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private ParcelFileDescriptor startVPN(Builder builder) {
private ParcelFileDescriptor startVPN(Builder builder) throws SecurityException {
try {
return builder.establish();
} catch (SecurityException ex) {
throw ex;
} catch (Throwable ex) {
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
return null;