From d6aa1078f682dcf9775159a41da4483fbb3da95c Mon Sep 17 00:00:00 2001 From: rupendraa <39113656+rupendraa@users.noreply.github.com> Date: Wed, 7 Oct 2020 18:50:38 +0530 Subject: [PATCH 01/10] Update for Android 10 (Q) getDeviceId: The user "10039" does not meet the requirements to access device identifiers Update for Android 10 (Q) getDeviceId: The user "10039" does not meet the requirements to access device identifiers --- src/android/com/pbakondy/Sim.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/android/com/pbakondy/Sim.java b/src/android/com/pbakondy/Sim.java index df3542f..d107b04 100644 --- a/src/android/com/pbakondy/Sim.java +++ b/src/android/com/pbakondy/Sim.java @@ -110,7 +110,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo String deviceId = null; // TelephonyManager.getDeviceId(slotId) requires API 23 - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.Q) { deviceId = manager.getDeviceId(simSlotIndex); } @@ -161,8 +161,15 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo boolean isNetworkRoaming = manager.isNetworkRoaming(); if (simPermissionGranted(Manifest.permission.READ_PHONE_STATE)) { - phoneNumber = manager.getLine1Number(); - deviceId = manager.getDeviceId(); + phoneNumber = manager.getLine1Number + + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) { + deviceId = Settings.Secure.getString( + getContentResolver(), + Settings.Secure.ANDROID_ID); + }else{ + deviceId = manager.getDeviceId(); + } deviceSoftwareVersion = manager.getDeviceSoftwareVersion(); simSerialNumber = manager.getSimSerialNumber(); subscriberId = manager.getSubscriberId(); From b7662e76c2416409a6263b528eccae4feaaa2854 Mon Sep 17 00:00:00 2001 From: rupendraa <39113656+rupendraa@users.noreply.github.com> Date: Thu, 8 Oct 2020 11:09:06 +0530 Subject: [PATCH 02/10] Errro Solved android 10 --- src/android/com/pbakondy/Sim.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/android/com/pbakondy/Sim.java b/src/android/com/pbakondy/Sim.java index d107b04..bbbc1da 100644 --- a/src/android/com/pbakondy/Sim.java +++ b/src/android/com/pbakondy/Sim.java @@ -39,6 +39,7 @@ import android.annotation.SuppressLint; import android.content.Context; import android.content.pm.PackageManager; +import android.provider.Settings.Secure; import android.os.Build; import android.Manifest; @@ -161,12 +162,10 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo boolean isNetworkRoaming = manager.isNetworkRoaming(); if (simPermissionGranted(Manifest.permission.READ_PHONE_STATE)) { - phoneNumber = manager.getLine1Number + phoneNumber = manager.getLine1Number(); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) { - deviceId = Settings.Secure.getString( - getContentResolver(), - Settings.Secure.ANDROID_ID); + deviceId = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID); }else{ deviceId = manager.getDeviceId(); } From d53d15cc1a4b51b4f7a00db88751bac909c5f085 Mon Sep 17 00:00:00 2001 From: rupendraa <39113656+rupendraa@users.noreply.github.com> Date: Thu, 8 Oct 2020 11:17:02 +0530 Subject: [PATCH 03/10] Error Fix iccid getIccSerialNumber --- src/android/com/pbakondy/Sim.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/android/com/pbakondy/Sim.java b/src/android/com/pbakondy/Sim.java index bbbc1da..8408b3d 100644 --- a/src/android/com/pbakondy/Sim.java +++ b/src/android/com/pbakondy/Sim.java @@ -100,12 +100,19 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo String countryIso = subscriptionInfo.getCountryIso(); int dataRoaming = subscriptionInfo.getDataRoaming(); // 1 is enabled ; 0 is disabled CharSequence displayName = subscriptionInfo.getDisplayName(); - String iccId = subscriptionInfo.getIccId(); + String iccId = ""; + + if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.Q) { + iccId = subscriptionInfo.getIccId(); + } + int mcc = subscriptionInfo.getMcc(); int mnc = subscriptionInfo.getMnc(); String number = subscriptionInfo.getNumber(); int simSlotIndex = subscriptionInfo.getSimSlotIndex(); - int subscriptionId = subscriptionInfo.getSubscriptionId(); + int sub if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.Q) { + deviceId = manager.getDeviceId(simSlotIndex); + }scriptionId = subscriptionInfo.getSubscriptionId(); boolean networkRoaming = subscriptionManager.isNetworkRoaming(simSlotIndex); From 7230bc0131c4105944b39242f730b15edfc9ded8 Mon Sep 17 00:00:00 2001 From: rupendraa <39113656+rupendraa@users.noreply.github.com> Date: Thu, 8 Oct 2020 11:24:02 +0530 Subject: [PATCH 04/10] Update Sim.java --- src/android/com/pbakondy/Sim.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/android/com/pbakondy/Sim.java b/src/android/com/pbakondy/Sim.java index 8408b3d..7108138 100644 --- a/src/android/com/pbakondy/Sim.java +++ b/src/android/com/pbakondy/Sim.java @@ -110,9 +110,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo int mnc = subscriptionInfo.getMnc(); String number = subscriptionInfo.getNumber(); int simSlotIndex = subscriptionInfo.getSimSlotIndex(); - int sub if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.Q) { - deviceId = manager.getDeviceId(simSlotIndex); - }scriptionId = subscriptionInfo.getSubscriptionId(); + int subscriptionId = subscriptionInfo.getSubscriptionId(); boolean networkRoaming = subscriptionManager.isNetworkRoaming(simSlotIndex); From d50f9966ed95301cb03d818a0f067bae99598a0f Mon Sep 17 00:00:00 2001 From: rupendraa <39113656+rupendraa@users.noreply.github.com> Date: Thu, 8 Oct 2020 13:27:57 +0530 Subject: [PATCH 05/10] Update Sim.java --- src/android/com/pbakondy/Sim.java | 52 ++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/src/android/com/pbakondy/Sim.java b/src/android/com/pbakondy/Sim.java index 7108138..b359fa7 100644 --- a/src/android/com/pbakondy/Sim.java +++ b/src/android/com/pbakondy/Sim.java @@ -76,23 +76,24 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo Integer phoneCount = null; Integer activeSubscriptionInfoCount = null; Integer activeSubscriptionInfoCountMax = null; - + LOG.d(LOG_TAG, "rupendra-1"); + try { // TelephonyManager.getPhoneCount() requires API 23 if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { phoneCount = manager.getPhoneCount(); } - + LOG.d(LOG_TAG, "rupendra-2"); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP_MR1) { - + LOG.d(LOG_TAG, "rupendra-3"); if (simPermissionGranted(Manifest.permission.READ_PHONE_STATE)) { - + LOG.d(LOG_TAG, "rupendra-4"); SubscriptionManager subscriptionManager = (SubscriptionManager) context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE); activeSubscriptionInfoCount = subscriptionManager.getActiveSubscriptionInfoCount(); activeSubscriptionInfoCountMax = subscriptionManager.getActiveSubscriptionInfoCountMax(); sims = new JSONArray(); - + LOG.d(LOG_TAG, "rupendra-5"); List subscriptionInfos = subscriptionManager.getActiveSubscriptionInfoList(); for (SubscriptionInfo subscriptionInfo : subscriptionInfos) { @@ -113,7 +114,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo int subscriptionId = subscriptionInfo.getSubscriptionId(); boolean networkRoaming = subscriptionManager.isNetworkRoaming(simSlotIndex); - + LOG.d(LOG_TAG, "rupendra-6"); String deviceId = null; // TelephonyManager.getDeviceId(slotId) requires API 23 if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.Q) { @@ -121,7 +122,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo } JSONObject simData = new JSONObject(); - + LOG.d(LOG_TAG, "rupendra-7); simData.put("carrierName", carrierName.toString()); simData.put("displayName", displayName.toString()); simData.put("countryCode", countryIso); @@ -136,7 +137,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo } simData.put("simSerialNumber", iccId); simData.put("subscriptionId", subscriptionId); - + LOG.d(LOG_TAG, "rupendra-8"); sims.put(simData); } @@ -157,28 +158,40 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo String deviceSoftwareVersion = null; String simSerialNumber = null; String subscriberId = null; - + LOG.d(LOG_TAG, "rupendra-9"); int callState = manager.getCallState(); + LOG.d(LOG_TAG, "rupendra-9-1"); int dataActivity = manager.getDataActivity(); + LOG.d(LOG_TAG, "rupendra-9-2"); int networkType = manager.getNetworkType(); + LOG.d(LOG_TAG, "rupendra-9-3"); int phoneType = manager.getPhoneType(); + LOG.d(LOG_TAG, "rupendra-9-4"); int simState = manager.getSimState(); + LOG.d(LOG_TAG, "rupendra-9-5"); boolean isNetworkRoaming = manager.isNetworkRoaming(); - +LOG.d(LOG_TAG, "rupendra-9-6"); if (simPermissionGranted(Manifest.permission.READ_PHONE_STATE)) { + LOG.d(LOG_TAG, "rupendra-9-7"); phoneNumber = manager.getLine1Number(); - + LOG.d(LOG_TAG, "rupendra-9-8"); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) { + LOG.d(LOG_TAG, "rupendra-9-9"); deviceId = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID); }else{ + LOG.d(LOG_TAG, "rupendra-9-10"); deviceId = manager.getDeviceId(); } + LOG.d(LOG_TAG, "rupendra-9-11"); deviceSoftwareVersion = manager.getDeviceSoftwareVersion(); + LOG.d(LOG_TAG, "rupendra-9-12"); simSerialNumber = manager.getSimSerialNumber(); + LOG.d(LOG_TAG, "rupendra-9-13"); subscriberId = manager.getSubscriberId(); + LOG.d(LOG_TAG, "rupendra-9-14"); } - + LOG.d(LOG_TAG, "rupendra-10"); String mcc = ""; String mnc = ""; @@ -193,13 +206,13 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo result.put("countryCode", countryCode); result.put("mcc", mcc); result.put("mnc", mnc); - + LOG.d(LOG_TAG, "rupendra-11"); result.put("callState", callState); result.put("dataActivity", dataActivity); result.put("networkType", networkType); result.put("phoneType", phoneType); result.put("simState", simState); - + LOG.d(LOG_TAG, "rupendra-12"); result.put("isNetworkRoaming", isNetworkRoaming); if (phoneCount != null) { @@ -211,7 +224,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo if (activeSubscriptionInfoCountMax != null) { result.put("activeSubscriptionInfoCountMax", (int)activeSubscriptionInfoCountMax); } - + LOG.d(LOG_TAG, "rupendra-13"); if (simPermissionGranted(Manifest.permission.READ_PHONE_STATE)) { result.put("phoneNumber", phoneNumber); result.put("deviceId", deviceId); @@ -219,21 +232,24 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo result.put("simSerialNumber", simSerialNumber); result.put("subscriberId", subscriberId); } - + LOG.d(LOG_TAG, "rupendra-14"); if (sims != null && sims.length() != 0) { result.put("cards", sims); } - + LOG.d(LOG_TAG, "rupendra-15"); callbackContext.success(result); - + LOG.d(LOG_TAG, "rupendra-16"); return true; } else if (HAS_READ_PERMISSION.equals(action)) { + LOG.d(LOG_TAG, "rupendra-17"); hasReadPermission(); return true; } else if (REQUEST_READ_PERMISSION.equals(action)) { + LOG.d(LOG_TAG, "rupendra-18"); requestReadPermission(); return true; } else { + LOG.d(LOG_TAG, "rupendra-19"); return false; } } From a399e6dbd05d9206b9cdf6337c5b436379e4ced4 Mon Sep 17 00:00:00 2001 From: rupendraa <39113656+rupendraa@users.noreply.github.com> Date: Thu, 8 Oct 2020 13:31:00 +0530 Subject: [PATCH 06/10] Update Sim.java --- src/android/com/pbakondy/Sim.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/com/pbakondy/Sim.java b/src/android/com/pbakondy/Sim.java index b359fa7..7e52c20 100644 --- a/src/android/com/pbakondy/Sim.java +++ b/src/android/com/pbakondy/Sim.java @@ -122,7 +122,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo } JSONObject simData = new JSONObject(); - LOG.d(LOG_TAG, "rupendra-7); + LOG.d(LOG_TAG, "rupendra-7"); simData.put("carrierName", carrierName.toString()); simData.put("displayName", displayName.toString()); simData.put("countryCode", countryIso); From d478eb7059880eedefdc013bae681f8bfeaee8c1 Mon Sep 17 00:00:00 2001 From: rupendraa <39113656+rupendraa@users.noreply.github.com> Date: Thu, 8 Oct 2020 13:55:08 +0530 Subject: [PATCH 07/10] Update Sim.java --- src/android/com/pbakondy/Sim.java | 66 +++++++++++++++---------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/android/com/pbakondy/Sim.java b/src/android/com/pbakondy/Sim.java index 7e52c20..9621958 100644 --- a/src/android/com/pbakondy/Sim.java +++ b/src/android/com/pbakondy/Sim.java @@ -76,24 +76,24 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo Integer phoneCount = null; Integer activeSubscriptionInfoCount = null; Integer activeSubscriptionInfoCountMax = null; - LOG.d(LOG_TAG, "rupendra-1"); + Log.i(LOG_TAG, "rupendra-1"); try { // TelephonyManager.getPhoneCount() requires API 23 if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { phoneCount = manager.getPhoneCount(); } - LOG.d(LOG_TAG, "rupendra-2"); + Log.i(LOG_TAG, "rupendra-2"); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP_MR1) { - LOG.d(LOG_TAG, "rupendra-3"); + Log.i(LOG_TAG, "rupendra-3"); if (simPermissionGranted(Manifest.permission.READ_PHONE_STATE)) { - LOG.d(LOG_TAG, "rupendra-4"); + Log.i(LOG_TAG, "rupendra-4"); SubscriptionManager subscriptionManager = (SubscriptionManager) context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE); activeSubscriptionInfoCount = subscriptionManager.getActiveSubscriptionInfoCount(); activeSubscriptionInfoCountMax = subscriptionManager.getActiveSubscriptionInfoCountMax(); sims = new JSONArray(); - LOG.d(LOG_TAG, "rupendra-5"); + Log.i(LOG_TAG, "rupendra-5"); List subscriptionInfos = subscriptionManager.getActiveSubscriptionInfoList(); for (SubscriptionInfo subscriptionInfo : subscriptionInfos) { @@ -114,7 +114,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo int subscriptionId = subscriptionInfo.getSubscriptionId(); boolean networkRoaming = subscriptionManager.isNetworkRoaming(simSlotIndex); - LOG.d(LOG_TAG, "rupendra-6"); + Log.i(LOG_TAG, "rupendra-6"); String deviceId = null; // TelephonyManager.getDeviceId(slotId) requires API 23 if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.Q) { @@ -122,7 +122,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo } JSONObject simData = new JSONObject(); - LOG.d(LOG_TAG, "rupendra-7"); + Log.i(LOG_TAG, "rupendra-7"); simData.put("carrierName", carrierName.toString()); simData.put("displayName", displayName.toString()); simData.put("countryCode", countryIso); @@ -137,7 +137,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo } simData.put("simSerialNumber", iccId); simData.put("subscriptionId", subscriptionId); - LOG.d(LOG_TAG, "rupendra-8"); + Log.i(LOG_TAG, "rupendra-8"); sims.put(simData); } @@ -158,40 +158,40 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo String deviceSoftwareVersion = null; String simSerialNumber = null; String subscriberId = null; - LOG.d(LOG_TAG, "rupendra-9"); + Log.i(LOG_TAG, "rupendra-9"); int callState = manager.getCallState(); - LOG.d(LOG_TAG, "rupendra-9-1"); + Log.i(LOG_TAG, "rupendra-9-1"); int dataActivity = manager.getDataActivity(); - LOG.d(LOG_TAG, "rupendra-9-2"); + Log.i(LOG_TAG, "rupendra-9-2"); int networkType = manager.getNetworkType(); - LOG.d(LOG_TAG, "rupendra-9-3"); + Log.i(LOG_TAG, "rupendra-9-3"); int phoneType = manager.getPhoneType(); - LOG.d(LOG_TAG, "rupendra-9-4"); + Log.i(LOG_TAG, "rupendra-9-4"); int simState = manager.getSimState(); - LOG.d(LOG_TAG, "rupendra-9-5"); + Log.i(LOG_TAG, "rupendra-9-5"); boolean isNetworkRoaming = manager.isNetworkRoaming(); -LOG.d(LOG_TAG, "rupendra-9-6"); +Log.i(LOG_TAG, "rupendra-9-6"); if (simPermissionGranted(Manifest.permission.READ_PHONE_STATE)) { - LOG.d(LOG_TAG, "rupendra-9-7"); + Log.i(LOG_TAG, "rupendra-9-7"); phoneNumber = manager.getLine1Number(); - LOG.d(LOG_TAG, "rupendra-9-8"); + Log.i(LOG_TAG, "rupendra-9-8"); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) { - LOG.d(LOG_TAG, "rupendra-9-9"); + Log.i(LOG_TAG, "rupendra-9-9"); deviceId = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID); }else{ - LOG.d(LOG_TAG, "rupendra-9-10"); + Log.i(LOG_TAG, "rupendra-9-10"); deviceId = manager.getDeviceId(); } - LOG.d(LOG_TAG, "rupendra-9-11"); + Log.i(LOG_TAG, "rupendra-9-11"); deviceSoftwareVersion = manager.getDeviceSoftwareVersion(); - LOG.d(LOG_TAG, "rupendra-9-12"); + Log.i(LOG_TAG, "rupendra-9-12"); simSerialNumber = manager.getSimSerialNumber(); - LOG.d(LOG_TAG, "rupendra-9-13"); + Log.i(LOG_TAG, "rupendra-9-13"); subscriberId = manager.getSubscriberId(); - LOG.d(LOG_TAG, "rupendra-9-14"); + Log.i(LOG_TAG, "rupendra-9-14"); } - LOG.d(LOG_TAG, "rupendra-10"); + Log.i(LOG_TAG, "rupendra-10"); String mcc = ""; String mnc = ""; @@ -206,13 +206,13 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo result.put("countryCode", countryCode); result.put("mcc", mcc); result.put("mnc", mnc); - LOG.d(LOG_TAG, "rupendra-11"); + Log.i(LOG_TAG, "rupendra-11"); result.put("callState", callState); result.put("dataActivity", dataActivity); result.put("networkType", networkType); result.put("phoneType", phoneType); result.put("simState", simState); - LOG.d(LOG_TAG, "rupendra-12"); + Log.i(LOG_TAG, "rupendra-12"); result.put("isNetworkRoaming", isNetworkRoaming); if (phoneCount != null) { @@ -224,7 +224,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo if (activeSubscriptionInfoCountMax != null) { result.put("activeSubscriptionInfoCountMax", (int)activeSubscriptionInfoCountMax); } - LOG.d(LOG_TAG, "rupendra-13"); + Log.i(LOG_TAG, "rupendra-13"); if (simPermissionGranted(Manifest.permission.READ_PHONE_STATE)) { result.put("phoneNumber", phoneNumber); result.put("deviceId", deviceId); @@ -232,24 +232,24 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo result.put("simSerialNumber", simSerialNumber); result.put("subscriberId", subscriberId); } - LOG.d(LOG_TAG, "rupendra-14"); + Log.i(LOG_TAG, "rupendra-14"); if (sims != null && sims.length() != 0) { result.put("cards", sims); } - LOG.d(LOG_TAG, "rupendra-15"); + Log.i(LOG_TAG, "rupendra-15"); callbackContext.success(result); - LOG.d(LOG_TAG, "rupendra-16"); + Log.i(LOG_TAG, "rupendra-16"); return true; } else if (HAS_READ_PERMISSION.equals(action)) { - LOG.d(LOG_TAG, "rupendra-17"); + Log.i(LOG_TAG, "rupendra-17"); hasReadPermission(); return true; } else if (REQUEST_READ_PERMISSION.equals(action)) { - LOG.d(LOG_TAG, "rupendra-18"); + Log.i(LOG_TAG, "rupendra-18"); requestReadPermission(); return true; } else { - LOG.d(LOG_TAG, "rupendra-19"); + Log.i(LOG_TAG, "rupendra-19"); return false; } } From 3d75dbbd266657d3194454d229640a264a2220c2 Mon Sep 17 00:00:00 2001 From: rupendraa <39113656+rupendraa@users.noreply.github.com> Date: Thu, 8 Oct 2020 14:00:31 +0530 Subject: [PATCH 08/10] Update Sim.java --- src/android/com/pbakondy/Sim.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/android/com/pbakondy/Sim.java b/src/android/com/pbakondy/Sim.java index 9621958..334ba94 100644 --- a/src/android/com/pbakondy/Sim.java +++ b/src/android/com/pbakondy/Sim.java @@ -31,6 +31,8 @@ import org.apache.cordova.CordovaPlugin; import org.apache.cordova.PluginResult; import org.apache.cordova.LOG; +import android.util.Log; + import org.json.JSONObject; import org.json.JSONArray; From cc814b8afeabc9e8ba4617059b357e59ee4aa2d0 Mon Sep 17 00:00:00 2001 From: rupendraa <39113656+rupendraa@users.noreply.github.com> Date: Thu, 8 Oct 2020 14:07:09 +0530 Subject: [PATCH 09/10] Update Sim.java --- src/android/com/pbakondy/Sim.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/android/com/pbakondy/Sim.java b/src/android/com/pbakondy/Sim.java index 334ba94..0cf688b 100644 --- a/src/android/com/pbakondy/Sim.java +++ b/src/android/com/pbakondy/Sim.java @@ -188,7 +188,9 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo Log.i(LOG_TAG, "rupendra-9-11"); deviceSoftwareVersion = manager.getDeviceSoftwareVersion(); Log.i(LOG_TAG, "rupendra-9-12"); - simSerialNumber = manager.getSimSerialNumber(); + if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.Q) { + simSerialNumber = manager.getSimSerialNumber(); + } Log.i(LOG_TAG, "rupendra-9-13"); subscriberId = manager.getSubscriberId(); Log.i(LOG_TAG, "rupendra-9-14"); From 111c40e41ea487395ba32e1a97d7714e20c4f229 Mon Sep 17 00:00:00 2001 From: rupendraa <39113656+rupendraa@users.noreply.github.com> Date: Thu, 8 Oct 2020 14:13:55 +0530 Subject: [PATCH 10/10] Update Sim.java --- src/android/com/pbakondy/Sim.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/android/com/pbakondy/Sim.java b/src/android/com/pbakondy/Sim.java index 0cf688b..1e473dc 100644 --- a/src/android/com/pbakondy/Sim.java +++ b/src/android/com/pbakondy/Sim.java @@ -190,9 +190,10 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo Log.i(LOG_TAG, "rupendra-9-12"); if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.Q) { simSerialNumber = manager.getSimSerialNumber(); - } - Log.i(LOG_TAG, "rupendra-9-13"); + Log.i(LOG_TAG, "rupendra-9-13"); subscriberId = manager.getSubscriberId(); + } + Log.i(LOG_TAG, "rupendra-9-14"); } Log.i(LOG_TAG, "rupendra-10");