Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/org/adblockplus/android/CrashHandler.java

Issue 4705284891082752: Proxy configurators (Closed)
Patch Set: valueOf Created Aug. 19, 2014, 1:24 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/org/adblockplus/android/CrashHandler.java
diff --git a/src/org/adblockplus/android/CrashHandler.java b/src/org/adblockplus/android/CrashHandler.java
index 250c48b2ed58631abdcc1ca51fa5a3582a463426..e43c7c8ad4fc0098c740ab8d83d954eff601148a 100644
--- a/src/org/adblockplus/android/CrashHandler.java
+++ b/src/org/adblockplus/android/CrashHandler.java
@@ -20,6 +20,9 @@ package org.adblockplus.android;
import java.io.PrintWriter;
import java.lang.Thread.UncaughtExceptionHandler;
+import org.adblockplus.android.compat.LinkProperties;
+import org.adblockplus.android.compat.ProxyProperties;
+
import android.annotation.SuppressLint;
import android.app.NotificationManager;
import android.content.Context;
@@ -170,6 +173,21 @@ public class CrashHandler implements UncaughtExceptionHandler
{
// ignore - no valid port, it will be correctly processed later
}
- ProxySettings.setConnectionProxy(context, host, p, excl);
+
+ try
+ {
+ final ProxyProperties proxyProperties = new ProxyProperties(this.host, p, this.excl);
+ final LinkProperties linkProperties = LinkProperties.fromContext(this.context);
+ if (linkProperties != null && linkProperties.isValid())
+ {
+ linkProperties.setHttpProxy(proxyProperties);
+ }
+ }
+ catch (final Throwable t)
+ {
+ // This method here must not throw any exceptions to make sure it does not kill anything else.
+ // And it's safe to ignore this exception here, because if resetting the proxy fails, then it fails ... and we don't get a second chance to
+ // clear it again (because we're most likely currently crashing).
+ }
}
}

Powered by Google App Engine
This is Rietveld