diff options
author | Glen Kuhne <kuh@google.com> | 2017-05-03 23:06:02 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-03 23:06:02 +0000 |
commit | d8d5bd3feb9f34cfface31cd3a26cba6964db2a1 (patch) | |
tree | 66ff073098842721332f0177acd97176a3cdc239 /service | |
parent | 7b05f07824221a960e62f9aebf8bf9caef1a879d (diff) | |
parent | 192d6f87beca307313dcaf1f4abab417afe0c31f (diff) |
Merge "Fix potential NPE in WifiService dump" into oc-dev am: 1e9f3c08bf
am: 192d6f87be
Change-Id: I57ca3f9c1c1b657639d8c21702b311ea3341d0a9
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiMetrics.java | 2 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiServiceImpl.java | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index 411d7d7e1..bea806484 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -999,7 +999,7 @@ public class WifiMetrics { */ public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { synchronized (mLock) { - if (args.length > 0 && PROTO_DUMP_ARG.equals(args[0])) { + if (args != null && args.length > 0 && PROTO_DUMP_ARG.equals(args[0])) { // Dump serialized WifiLog proto consolidateProto(true); for (ConnectionEvent event : mConnectionEventList) { diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 7ae8ee049..a018e5a44 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -1867,16 +1867,17 @@ public class WifiServiceImpl extends IWifiManager.Stub { + ", uid=" + Binder.getCallingUid()); return; } - if (args.length > 0 && WifiMetrics.PROTO_DUMP_ARG.equals(args[0])) { + if (args != null && args.length > 0 && WifiMetrics.PROTO_DUMP_ARG.equals(args[0])) { // WifiMetrics proto bytes were requested. Dump only these. mWifiStateMachine.updateWifiMetrics(); mWifiMetrics.dump(fd, pw, args); - } else if (args.length > 0 && IpManager.DUMP_ARG.equals(args[0])) { + } else if (args != null && args.length > 0 && IpManager.DUMP_ARG.equals(args[0])) { // IpManager dump was requested. Pass it along and take no further action. String[] ipManagerArgs = new String[args.length - 1]; System.arraycopy(args, 1, ipManagerArgs, 0, ipManagerArgs.length); mWifiStateMachine.dumpIpManager(fd, pw, ipManagerArgs); - } else if (args.length > 0 && DUMP_ARG_SET_IPREACH_DISCONNECT.equals(args[0])) { + } else if (args != null && args.length > 0 + && DUMP_ARG_SET_IPREACH_DISCONNECT.equals(args[0])) { if (args.length > 1) { if (DUMP_ARG_SET_IPREACH_DISCONNECT_ENABLED.equals(args[1])) { mWifiStateMachine.setIpReachabilityDisconnectEnabled(true); @@ -1890,8 +1891,8 @@ public class WifiServiceImpl extends IWifiManager.Stub { } else { pw.println("Wi-Fi is " + mWifiStateMachine.syncGetWifiStateByName()); pw.println("Stay-awake conditions: " + - Settings.Global.getInt(mContext.getContentResolver(), - Settings.Global.STAY_ON_WHILE_PLUGGED_IN, 0)); + mFacade.getIntegerSetting(mContext, + Settings.Global.STAY_ON_WHILE_PLUGGED_IN, 0)); pw.println("mInIdleMode " + mInIdleMode); pw.println("mScanPending " + mScanPending); mWifiController.dump(fd, pw, args); |