From 394a29333ef34bde01abbce3b1c76c4c5cc8e7d9 Mon Sep 17 00:00:00 2001 From: Geoffrey Borggaard Date: Thu, 20 Nov 2014 14:35:32 -0500 Subject: [PATCH] Fix null handling in proxies. ProxyInfo.getPacFileUrl() can not be null. It will be equal to Uri.EMPTY. Checking for null was causing global proxies to never be disabled. Or more accurately, global proxies would be disabled, but would reappear after a reboot. ProxyInfo.getExclusionListByString() can be null. If no exclusion list was specified, the proxy settings would not be successfully saved, they would disappear after reboot. Bug: 18453223 Change-Id: I1c27e5dca5b9664bb7468ea909bff489fa110a07 --- .../core/java/com/android/server/net/IpConfigStore.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/net/IpConfigStore.java b/services/core/java/com/android/server/net/IpConfigStore.java index 857b9e90a0..b5a450dc8b 100644 --- a/services/core/java/com/android/server/net/IpConfigStore.java +++ b/services/core/java/com/android/server/net/IpConfigStore.java @@ -122,8 +122,10 @@ public class IpConfigStore { out.writeUTF(proxyProperties.getHost()); out.writeUTF(PROXY_PORT_KEY); out.writeInt(proxyProperties.getPort()); - out.writeUTF(EXCLUSION_LIST_KEY); - out.writeUTF(exclusionList); + if (exclusionList != null) { + out.writeUTF(EXCLUSION_LIST_KEY); + out.writeUTF(exclusionList); + } written = true; break; case PAC: