diff options
author | xin He <xinhe@google.com> | 2015-07-23 17:18:15 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-23 17:18:15 +0000 |
commit | fbd35be2ee76cb2f8090f563c8f2666ce0dee607 (patch) | |
tree | bce7cbfd3d109faba153ea4e7587086c2819dab8 | |
parent | 7278b8ad40ab62383229e458be962d28321158ed (diff) | |
parent | 127f7244183786e6ccae09e81eeccdac31973e69 (diff) | |
download | wifi-fbd35be2ee76cb2f8090f563c8f2666ce0dee607.tar.gz |
Merge "Restart loop on MRA16G: Abort message:" into mnc-dev
-rw-r--r-- | service/java/com/android/server/wifi/WifiNative.java | 8 | ||||
-rw-r--r-- | service/jni/jni_helper.cpp | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java index c33b23248..d554c1859 100644 --- a/service/java/com/android/server/wifi/WifiNative.java +++ b/service/java/com/android/server/wifi/WifiNative.java @@ -1402,19 +1402,18 @@ public class WifiNative { int num = 0; if (bytes == null) return; if (dbg == null) dbg = ""; - for (int i = 0; i < bytes.length; ) { + for (int i = 0; i < bytes.length - 1; ) { int type = bytes[i] & 0xFF; int len = bytes[i + 1] & 0xFF; - if (i + len + 2 > bytes.length) { Log.w(TAG, dbg + "bad length " + len + " of IE " + type + " from " + result.BSSID); Log.w(TAG, dbg + "ignoring the rest of the IEs"); break; } num++; - i += len + 2; if (DBG) Log.i(TAG, dbg + "bytes[" + i + "] = [" + type + ", " + len + "]" + ", " + - "next = " + i); + "next = " + (i + len + 2)); + i += len + 2; } int secondChanelOffset = 0; @@ -2131,6 +2130,7 @@ public class WifiNative { (buffer == null ? 0 : buffer.length)); } } + private static native boolean getFwMemoryDumpNative(int iface); synchronized public static byte[] getFwMemoryDump() { synchronized (mLock) { diff --git a/service/jni/jni_helper.cpp b/service/jni/jni_helper.cpp index e3965137d..93d24146e 100644 --- a/service/jni/jni_helper.cpp +++ b/service/jni/jni_helper.cpp @@ -442,6 +442,10 @@ void reportEvent(JNIEnv *env, jclass cls, const char *method, const char *signat } env->CallStaticVoidMethodV(cls, methodID, params); + if (env->ExceptionCheck()) { + env->ExceptionDescribe(); + env->ExceptionClear(); + } va_end(params); } @@ -459,7 +463,7 @@ jobject createObject(JNIEnv *env, const char *className) return NULL; } jobject obj = env->NewObject(cls, constructor); - if (constructor == NULL) { + if (obj == NULL) { ALOGE("Could not create new object of %s", className); return NULL; } |