NullPointerException in NetworkChangeNotifierAutoDetect.java |
||||||||
Issue descriptionUpon network change, we might encounter a NPE with the following stack trace. java.lang.NullPointerException: Attempt to invoke virtual method 'int android.net.NetworkInfo.getType()' on a null object reference at org.chromium.net.NetworkChangeNotifierAutoDetect$ConnectivityManagerDelegate.getNetworkState(NetworkChangeNotifierAutoDetect.java:97) at org.chromium.net.NetworkChangeNotifierAutoDetect$MyNetworkCallback.onCapabilitiesChanged(NetworkChangeNotifierAutoDetect.java:378) at android.net.ConnectivityManager$CallbackHandler.handleMessage(ConnectivityManager.java:2353) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61) ConnectivityManager.html#getNetworkInfo(android.net.Network) might return null when Network is invalid. There should be a null check on NetworkInfo before getType().
,
May 23 2016
This CL needs to be merged into M52, which was cut last Friday (05/19). I will request a merge once this passed through a Canary release.
,
May 23 2016
We really need this in the next Android Dev release (which will be cut tomorrow), can we have the merge approval?
,
May 23 2016
Your change meets the bar and is auto-approved for M52 (branch: 2743)
,
May 23 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/24e4f8db45cbc45aba6045ab48ccc30234ff2c91 commit 24e4f8db45cbc45aba6045ab48ccc30234ff2c91 Author: xunjieli <xunjieli@chromium.org> Date: Mon May 23 19:36:59 2016 Add a null check in ConnectivityManagerDelegate.getNetworkState ConnectivityManager.getNetworkInfo can return null if the Network is invalid. This CL adds a null check so we don't crash with a NullPointerException when invoking networkInfo.getType() BUG= 613599 TBR=mef@chromium.org,pauljensen@chromium.org NOTRY=true NOPRESUBMIT=true Review-Url: https://codereview.chromium.org/2003503003 Cr-Commit-Position: refs/heads/master@{#395375} (cherry picked from commit ff2ec75896222f8a2ddc6b9e1551276929a0b671) Review-Url: https://codereview.chromium.org/2003063003 Cr-Commit-Position: refs/branch-heads/2743@{#13} Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939} [modify] https://crrev.com/24e4f8db45cbc45aba6045ab48ccc30234ff2c91/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java [modify] https://crrev.com/24e4f8db45cbc45aba6045ab48ccc30234ff2c91/net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java
,
May 23 2016
,
May 24 2016
Internal bug b/28841033
,
May 26 2016
Per conversation on b/28841033 and chat with jouting@ we need to merge it into 2739 to address crash in the release version. Please note that this is request to merge into *2739* as it is already merged into 2743.
,
May 26 2016
Your change meets the bar and is auto-approved for M52 (branch: 2743)
,
May 26 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d95785fc583925674b97a54860e5fa46a168be6b commit d95785fc583925674b97a54860e5fa46a168be6b Author: Misha Efimov <mef@google.com> Date: Thu May 26 18:56:42 2016 Add a null check in ConnectivityManagerDelegate.getNetworkState ConnectivityManager.getNetworkInfo can return null if the Network is invalid. This CL adds a null check so we don't crash with a NullPointerException when invoking networkInfo.getType() BUG= 613599 Review-Url: https://codereview.chromium.org/2003503003 Cr-Commit-Position: refs/heads/master@{#395375} (cherry picked from commit ff2ec75896222f8a2ddc6b9e1551276929a0b671) R=xunjieli@chromium.org Review URL: https://codereview.chromium.org/2011123002 . Cr-Commit-Position: refs/branch-heads/2739@{#7} Cr-Branched-From: e63177a3d418d078a8777d83f817c11e30831d7b-refs/heads/master@{#393996} [modify] https://crrev.com/d95785fc583925674b97a54860e5fa46a168be6b/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java [modify] https://crrev.com/d95785fc583925674b97a54860e5fa46a168be6b/net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by bugdroid1@chromium.org
, May 23 2016