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: Last batch of review issues Created Aug. 24, 2014, 11:52 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..4e5e54f1e15cf4fbbc710238428557c47d20c1d3 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,20 @@ public class CrashHandler implements UncaughtExceptionHandler
{
// ignore - no valid port, it will be correctly processed later
}
- ProxySettings.setConnectionProxy(context, host, p, excl);
+
+ try
+ {
+ final LinkProperties linkProperties = LinkProperties.fromContext(this.context);
+ if (linkProperties != null && linkProperties.isValid())
+ {
+ linkProperties.setHttpProxy(new ProxyProperties(this.host, p, this.excl));
+ }
+ }
+ 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).
+ }
}
}
« no previous file with comments | « src/org/adblockplus/android/ConfigurationActivity.java ('k') | src/org/adblockplus/android/Preferences.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld