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: Removed command bridge Created Aug. 21, 2014, 7:48 a.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);
Felix Dahlke 2014/08/24 11:51:19 We can move this closer to its usage, i.e. into th
René Jeschke 2014/08/24 11:54:14 Done.
+ 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