Catch UnsupportedOperationException of startLegacyVpn
startLegacyVpn may throw UnsupportedOperationException. Instead of crashing Settings, catch the exception and show a Toast. Bug: 161776767 Test: Manual test, connect legacy vpn profile and observe Toast. Change-Id: I5947f2043aa68478f659b34531202f225eab4568
This commit is contained in:
@@ -207,6 +207,10 @@ public class ConfigDialogFragment extends InstrumentedDialogFragment implements
|
||||
mService.startLegacyVpn(profile);
|
||||
} catch (IllegalStateException e) {
|
||||
Toast.makeText(mContext, R.string.vpn_no_network, Toast.LENGTH_LONG).show();
|
||||
} catch (UnsupportedOperationException e) {
|
||||
Log.e(TAG, "Attempted to start an unsupported VPN type.");
|
||||
Toast.makeText(mContext, R.string.vpn_insecure_dialog_subtitle, Toast.LENGTH_LONG)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user