@@ -45,19 +45,19 @@ public String getName() {
4545 PackageManager packageManager = this .reactContext .getPackageManager ();
4646 String packageName = this .reactContext .getPackageName ();
4747
48- TelephonyManager telManager = (TelephonyManager ) context .getSystemService (Context .TELEPHONY_SERVICE );
48+ TelephonyManager telManager = (TelephonyManager ) this . reactContext .getSystemService (Context .TELEPHONY_SERVICE );
4949
50- int phoneCount = 0 ;
50+ int phoneCount = telManager . getPhoneCount () ;
5151 int activeSubscriptionInfoCount = 0 ;
5252 int activeSubscriptionInfoCountMax = 0 ;
5353
5454 try {
55- SubscriptionManager manager = (SubscriptionManager ) context .getSystemService (Context .TELEPHONY_SUBSCRIPTION_SERVICE );
56- phoneCount = manager .getPhoneCount ();
55+ SubscriptionManager manager = (SubscriptionManager ) this .reactContext .getSystemService (Context .TELEPHONY_SUBSCRIPTION_SERVICE );
5756 activeSubscriptionInfoCount = manager .getActiveSubscriptionInfoCount ();
5857 activeSubscriptionInfoCountMax = manager .getActiveSubscriptionInfoCountMax ();
5958
6059 List <SubscriptionInfo > subscriptionInfos = manager .getActiveSubscriptionInfoList ();
60+
6161 int sub = 1 ;
6262 for (SubscriptionInfo subInfo : subscriptionInfos ) {
6363 sub ++;
@@ -71,7 +71,7 @@ public String getName() {
7171 String number = subInfo .getNumber ();
7272 int simSlotIndex = subInfo .getSimSlotIndex ();
7373 int subscriptionId = subInfo .getSubscriptionId ();
74- boolean networkRoaming = telManager .isNetworkRoaming (simSlotIndex );
74+ boolean networkRoaming = telManager .isNetworkRoaming ();
7575 String deviceId = telManager .getDeviceId (simSlotIndex );
7676
7777 constants .put ("carrierName" + sub , carrierName .toString ());
0 commit comments