diff options
author | Irfan Sheriff <isheriff@google.com> | 2012-08-27 11:59:16 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-08-27 11:59:16 -0700 |
commit | 63dc027be28762232335797a30449995c555ae10 (patch) | |
tree | 1ef49cf8d897ea68bcad8fb15202fa25bbc7b7bc /wifi | |
parent | 62e2709c3ff91760108c31e6f60fcf57c8c8da46 (diff) | |
parent | 35bbe27d58ccf01ffd170b0f617a568bc843a49e (diff) | |
download | frameworks_base-63dc027be28762232335797a30449995c555ae10.zip frameworks_base-63dc027be28762232335797a30449995c555ae10.tar.gz frameworks_base-63dc027be28762232335797a30449995c555ae10.tar.bz2 |
Merge "Fix permission issue on channel" into jb-mr1-dev
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/WifiManager.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index 3579b86..284bee8 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -1358,7 +1358,11 @@ public class WifiManager { private void init() { mWifiServiceMessenger = getWifiServiceMessenger(); - if (mWifiServiceMessenger == null) throw new RuntimeException("Failed to initialize"); + if (mWifiServiceMessenger == null) { + mAsyncChannel = null; + return; + } + HandlerThread t = new HandlerThread("WifiManager"); t.start(); mHandler = new ServiceHandler(t.getLooper()); @@ -1372,7 +1376,7 @@ public class WifiManager { private void validateChannel() { if (mAsyncChannel == null) throw new IllegalStateException( - "Bad WifiManager instance state, re-initialize"); + "No permission to access and change wifi or a bad initialization"); } /** @@ -1517,6 +1521,8 @@ public class WifiManager { return mService.getWifiServiceMessenger(); } catch (RemoteException e) { return null; + } catch (SecurityException e) { + return null; } } |