Skip to content

Fix network name detection for multi-SIM devices - #74

Open
CodeName-Anti wants to merge 1 commit into
Windscribe:mainfrom
CodeName-Anti:fix/multisim-detection
Open

Fix network name detection for multi-SIM devices#74
CodeName-Anti wants to merge 1 commit into
Windscribe:mainfrom
CodeName-Anti:fix/multisim-detection

Conversation

@CodeName-Anti

Copy link
Copy Markdown

Fixes network name detection on multi-SIM devices by using the currently active data SIM instead of defaulting to the first available SIM.

Copilot AI lite review requested due to automatic review settings August 8, 2026 21:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates DeviceStateManager’s cellular network name detection to better support multi‑SIM devices by retrieving the operator name from the currently active data subscription rather than relying on the default TelephonyManager instance.

Changes:

  • Use SubscriptionManager to resolve the active/default data subscription ID.
  • Use a subscription-scoped TelephonyManager (createForSubscriptionId) to fetch networkOperatorName for the active data SIM.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +367 to +377
val dataSubId =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
SubscriptionManager.getActiveDataSubscriptionId()
} else {
@Suppress("DEPRECATION")
SubscriptionManager.getDefaultDataSubscriptionId()
}

val dataSimTelephonyManager =
telephonyManager?.createForSubscriptionId(dataSubId)
val operatorName = dataSimTelephonyManager?.networkOperatorName
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.

2 participants