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

Commit bcb98911 authored by Amit Mahajan's avatar Amit Mahajan Committed by Michael Bestas
Browse files

Revert "Clean up getPhoneCount in PhoneFactory#makeDefaultPhone"

This reverts commit f0232275.

Reason for revert: b/141396302 - phone count should not be 0 internally at least for now; there should be a non-null default phone even if cellular is not supported.

Change-Id: Ic4114d7f0fa60881d489362db6fa3e55b417239f
(cherry picked from commit 96e6dbcc)
parent 01819305
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -150,9 +150,7 @@ 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 */
                TelephonyManager tm = (TelephonyManager) context.getSystemService(
                        Context.TELEPHONY_SERVICE);
                int numPhones = tm.getPhoneCount();
                int numPhones = TelephonyManager.getDefault().getPhoneCount();

                int[] networkModes = new int[numPhones];
                sPhones = new Phone[numPhones];
@@ -210,10 +208,8 @@ 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.