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

Commit 1e5db488 authored by Shuo Qian's avatar Shuo Qian Committed by android-build-merger
Browse files

Merge "Clean up getPhoneCount in PhoneFactory#makeDefaultPhone" am: d85d78df

am: a2191e6f

Change-Id: I13d80251c554565c03e0b35cb432550016edc879
parents 6935afb3 a2191e6f
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -148,7 +148,9 @@ public class PhoneFactory {
                /* In case of multi SIM mode two instances of Phone, RIL are created,
                   where as in single SIM mode only instance. isMultiSimEnabled() function checks
                   whether it is single SIM or multi SIM mode */
                int numPhones = TelephonyManager.getDefault().getPhoneCount();
                TelephonyManager tm = (TelephonyManager) context.getSystemService(
                        Context.TELEPHONY_SERVICE);
                int numPhones = tm.getPhoneCount();

                int[] networkModes = new int[numPhones];
                sPhones = new Phone[numPhones];
@@ -199,8 +201,10 @@ public class PhoneFactory {
                // Set the default phone in base class.
                // FIXME: This is a first best guess at what the defaults will be. It
                // FIXME: needs to be done in a more controlled manner in the future.
                if (numPhones > 0) {
                    sPhone = sPhones[0];
                    sCommandsInterface = sCommandsInterfaces[0];
                }

                // Ensure that we have a default SMS app. Requesting the app with
                // updateIfNeeded set to true is enough to configure a default SMS app.