PhoneSwitcher: Fix ArrayIndexOutOfBoundsException in isPhoneActive()
On HiKey960 (and likely also on other devboards w/o a modem), we are seeing a lot of the following crashes since commit f544a5ec ("Remove unecessary member variables of PhoneSwitcher."): FATAL EXCEPTION: main Process: com.android.phone, PID: 11848 java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 at com.android.internal.telephony.PhoneSwitcher.isPhoneActive(PhoneSwitcher.java:1113) at com.android.internal.telephony.PhoneSwitcher.shouldApplyNetworkRequest(PhoneSwitcher.java:1096) at com.android.internal.telephony.dataconnection.TelephonyNetworkFactory.onNeedNetworkFor(TelephonyNetworkFactory.java:290) ... While I suspect there is a more optimal fix, adding a test to ensure the phoneId isn't greater or equal to the mActiveModemCount seems to avoid the problem Fixes: f544a5ec ("Remove unecessary member variables of PhoneSwitcher.") Change-Id: I586f56e3571de173939f5a87ecfaf44339e8d591 Signed-off-by:John Stultz <john.stultz@linaro.org>
Loading
Please register or sign in to comment