title: Cannot detect CellInfo NR on Samsung S20
body: <p>I am trying to detect 5G Nr cell info on Samsung S20 (T-Mobile) using Android API</p>
  <p>CellIdentityNr
  <a href="https://developer.android.com/reference/android/telephony/CellIdentityNr.html" rel="nofollow noreferrer">https://developer.android.com/reference/android/telephony/CellIdentityNr.html</a>
  and</p>
  <p>CellSignalStrengthNr
  <a href="https://developer.android.com/reference/android/telephony/CellSignalStrengthNr" rel="nofollow noreferrer">https://developer.android.com/reference/android/telephony/CellSignalStrengthNr</a></p>
  <p>Here is my code which detects the cell info:</p>
  <pre><code>try {
              if (cellInfo instanceof CellInfoGsm) {
                  CellInfoGsm cellInfoGsm = (CellInfoGsm) cellInfo;
                  logGSMCellInfo(cellInfoGsm, allCellInfoProps);
              } else if (cellInfo instanceof CellInfoLte) {
                  CellInfoLte cellInfoLte = (CellInfoLte) cellInfo;
                  logLTECellInfo(cellInfoLte, allCellInfoProps);
              } else if (cellInfo instanceof CellInfoCdma) {
                  CellInfoCdma cellInfoCdma = (CellInfoCdma) cellInfo;
                  logCDMACellInfo(cellInfoCdma, allCellInfoProps);
              } else if (cellInfo instanceof CellInfoWcdma) {
                  CellInfoWcdma cellInfoWcdma = (CellInfoWcdma) cellInfo;
                  logWCDMACellInfo(cellInfoWcdma, allCellInfoProps);
              } else if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.Q) {
                  if (cellInfo instanceof CellInfoTdscdma) {
                      CellInfoTdscdma cellInfoTdscdma = (CellInfoTdscdma) cellInfo;
                      logTDSCDMACellInfo(cellInfoTdscdma, allCellInfoProps);
                  } else if (cellInfo instanceof CellInfoNr) {
                      CellInfoNr cellInfoNr = (CellInfoNr) cellInfo;
                      logNrCellInfo(cellInfoNr, allCellInfoProps);
                  }
              }
              collectionOfCellInfo.add(allCellInfoProps);
          } catch (Exception e) {
              Log.e(TAG, &quot;getLatestCellInfoAsCollection: Exception=&quot; + e.getMessage());
              e.printStackTrace();
          }
  </code></pre>
  <p>The problem is that even when the phone is showing 5G in the top bar indicating 5G connection I am getting WCDMA cell info when I should be getting Nr.</p>
  <p>From this link, I gathered that the CellInfoNr object is only collected on NR-SA devices, which would explain why I can't get Nr info on other phones. But why am I not getting it on Samsung S20?
  <a href="https://stackoverflow.com/questions/62332475/detect-5g-nr-sa-nsa-in-my-android-application/62424201#62424201">Detect 5G NR (SA/NSA) in my Android Application</a></p>
  <p>Is there something wrong with the code, or is this problem caused due to available 5G network mode?</p>
  <p>Also how to confirm that my S20 is in 'Standalone (5G)' mode?</p>