diff options
author | Wink Saville <wink@google.com> | 2013-08-10 11:22:31 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2013-08-10 11:22:31 -0700 |
commit | a48ad8bd858d6ffe77838a282dbf71e01967957c (patch) | |
tree | 4208c106ef374a1d4260c8c225d9b56da810cd8d /services/java/com/android/server/connectivity/PacManager.java | |
parent | 7a7c35e2abf0b4984c711614c8b9347b4c06aea3 (diff) |
PROXY_SERVICE may be missing and its reference null.
Protect ourselves from when PROXY_SERVICE is missing
and mProxyService is null.
Bug: 10267814
Change-Id: Ia329376218e246cdde3d70b578c18466d48a6383
Diffstat (limited to 'services/java/com/android/server/connectivity/PacManager.java')
-rw-r--r-- | services/java/com/android/server/connectivity/PacManager.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/services/java/com/android/server/connectivity/PacManager.java b/services/java/com/android/server/connectivity/PacManager.java index 189c6261c39a..defe9f075147 100644 --- a/services/java/com/android/server/connectivity/PacManager.java +++ b/services/java/com/android/server/connectivity/PacManager.java @@ -83,6 +83,12 @@ public class PacManager implements Runnable { mContext = context; mProxyService = IProxyService.Stub.asInterface( ServiceManager.getService(PROXY_SERVICE)); + if (mProxyService == null) { + // Added because of b10267814 where mako is restarting. + Log.e(TAG, "PacManager: no proxy service"); + } else { + Log.d(TAG, "PacManager: mProxyService available"); + } mPacRefreshIntent = PendingIntent.getBroadcast( context, 0, new Intent(ACTION_PAC_REFRESH), 0); @@ -98,6 +104,10 @@ public class PacManager implements Runnable { } public void setCurrentProxyScriptUrl(ProxyProperties proxy) { + if (mProxyService == null) { + Log.e(TAG, "setCurrentProxyScriptUrl: no proxy service"); + return; + } if (!TextUtils.isEmpty(proxy.getPacFileUrl())) { try { mProxyService.startPacSystem(); @@ -212,6 +222,10 @@ public class PacManager implements Runnable { } private boolean setCurrentProxyScript(String script) { + if (mProxyService == null) { + Log.e(TAG, "setCurrentProxyScript: no proxy service"); + return false; + } try { if (mProxyService.setPacFile(script) != NO_ERROR) { Log.e(TAG, "Unable to parse proxy script."); |