Skip to content

fix: Proper CDMA support with correct SID/NID/BID handling#1029

Open
Huayra-hjy wants to merge 1 commit into
CellularPrivacy:developmentfrom
Huayra-hjy:fix/cdma-support
Open

fix: Proper CDMA support with correct SID/NID/BID handling#1029
Huayra-hjy wants to merge 1 commit into
CellularPrivacy:developmentfrom
Huayra-hjy:fix/cdma-support

Conversation

@Huayra-hjy

Copy link
Copy Markdown

Summary

Fix CDMA support by correcting parameter handling and adding proper CDMA/GSM differentiation.

Changes

Cell.java

  • Add isCdma() method to detect CDMA network types (1xRTT, EVDO, eHRPD)
  • Add getSid() method for CDMA System ID access
  • Fix toString() to show CDMA-specific labels (BID/NID/SID) vs GSM (CID/LAC/PSC)

Device.java

  • BUG FIX: MNC was incorrectly set to SID (System ID)
  • MCC/MNC should come from ro.cdma.home.operator.numeric, not CdmaCellLocation

DeviceApi18.java

  • BUG FIX: Remove incorrect MNC=SID assignment in CellInfoCdma handling

CellTracker.java

  • BUG FIX: Remove incorrect MNC=SID assignment in 2 places
  • Fix comments: BSID -> BID (Base Station ID)

CardItemData.java

  • Show CDMA-specific labels: BID instead of CID, NID instead of LAC
  • Show SID instead of PSC for CDMA cells

CDMA vs GSM Parameter Mapping

GSM CDMA Description
CID BID Cell/Base Station ID
LAC NID Location/Network Area
PSC SID Primary Scrambling/System ID
MCC MCC Mobile Country Code (same)
MNC MNC Mobile Network Code (same)

Testing

This fix corrects the MNC field which was being overwritten with SID on CDMA devices. The MCC/MNC values now correctly come from the system property ro.cdma.home.operator.numeric.

Fixes #489

## Changes

### Cell.java
- Add isCdma() method to detect CDMA network types (1xRTT, EVDO, eHRPD)
- Add getSid() method for CDMA System ID access
- Fix toString() to show CDMA-specific labels (BID/NID/SID) vs GSM (CID/LAC/PSC)

### Device.java
- Fix BUG: MNC was incorrectly set to SID (System ID)
- MCC/MNC should come from ro.cdma.home.operator.numeric, not CdmaCellLocation
- Add clarifying comments for CDMA parameters

### DeviceApi18.java
- Fix BUG: Remove incorrect MNC=SID assignment in CellInfoCdma handling
- Add comments explaining CDMA uses BID/NID/SID

### CellTracker.java
- Fix BUG: Remove incorrect MNC=SID assignment in 2 places
- Fix comments: BSID -> BID (Base Station ID)
- Add note that MCC/MNC comes from Device.refreshDeviceInfo()

### CardItemData.java
- Show CDMA-specific labels: BID instead of CID, NID instead of LAC
- Show SID instead of PSC for CDMA cells

## CDMA vs GSM Parameter Mapping
| GSM | CDMA | Description |
|-----|------|-------------|
| CID | BID  | Cell/Base Station ID |
| LAC | NID  | Location/Network Area |
| PSC | SID  | Primary Scrambling/System ID |
| MCC | MCC  | Mobile Country Code (same) |
| MNC | MNC  | Mobile Network Code (same) |

Fixes CellularPrivacy#489
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CDMA Support [$100]

1 participant