Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01a579d0 authored by James Mattis's avatar James Mattis Committed by android-build-merger
Browse files

Merge "SUMMARY Only going to access the sPhones array for an index that exists."

am: ed26975f

Change-Id: Ie9f8ebc8c0df1d0dfb5016f219c2cd7dc951bf12
parents ca0915ac ed26975f
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -308,13 +308,16 @@ public class PhoneFactory {
                throw new IllegalStateException("Default phones haven't been made yet!");
                // CAF_MSIM FIXME need to introduce default phone id ?
            } else if (phoneId == SubscriptionManager.DEFAULT_PHONE_INDEX) {
                if (DBG) dbgInfo = "phoneId == DEFAULT_PHONE_ID return sPhone";
                if (DBG) {
                    dbgInfo = "phoneId == DEFAULT_PHONE_ID return sPhone";
                }
                phone = sPhone;
            } else {
                if (DBG) dbgInfo = "phoneId != DEFAULT_PHONE_ID return sPhones[phoneId]";
                phone = (((phoneId >= 0)
                                && (phoneId < TelephonyManager.getDefault().getPhoneCount()))
                        ? sPhones[phoneId] : null);
                if (DBG) {
                    dbgInfo = "phoneId != DEFAULT_PHONE_ID return sPhones[phoneId]";
                }
                phone = (phoneId >= 0 && phoneId < sPhones.length)
                            ? sPhones[phoneId] : null;
            }
            if (DBG) {
                Rlog.d(LOG_TAG, "getPhone:- " + dbgInfo + " phoneId=" + phoneId +