Commit 3c55eb1f authored by Ricki Hirner's avatar Ricki Hirner 🐑

Don't throw an unchecked exception when bindService fails

parent 30b8bc58
Pipeline #4987189 passed with stage
in 5 minutes and 25 seconds
......@@ -110,7 +110,7 @@ public class CustomCertManager implements X509TrustManager, Closeable {
this.service = service;
serviceConnection = null;
} else if (!context.bindService(new Intent(context, CustomCertService.class), serviceConnection, Context.BIND_AUTO_CREATE))
throw new IllegalArgumentException("Couldn't bind service to this context");
Constants.log.severe("Couldn't bind CustomCertService to context");
......@@ -153,6 +153,9 @@ public class CustomCertManager implements X509TrustManager, Closeable {
protected void checkCustomTrusted(X509Certificate cert) throws CertificateException {
Constants.log.fine("Querying custom certificate trustworthiness");
if (service == null)
throw new CertificateException("Custom certificate service not available");
Message msg = Message.obtain();
msg.what = CustomCertService.MSG_CHECK_TRUSTED;
int id = msg.arg1 = nextDecisionID.getAndIncrement();
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment