Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ControlRoom/Controllers/SimCtl+SubCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,34 @@ extension SimCtl {
case ltePlus = "lte+"
}

enum Carrier: String, CaseIterable {
case airtel = "Airtel"
case att = "AT&T"
case au = "au"
case bell = "Bell"
case bsnl = "BSNL"
case bouygues = "Bouygues"
case ee = "EE"
case free = "Free"
case jio = "Jio"
case ntt = "NTT Docomo"
case o2 = "O2"
case optus = "Optus"
case orange = "Orange"
case rakuten = "Rakuten"
case rogers = "Rogers"
case sfr = "SFR"
case softbank = "SoftBank"
case telstra = "Telstra"
case telus = "Telus"
case telekom = "Telekom"
case three = "Three"
case tmobile = "T-Mobile"
case verizon = "Verizon"
case vodafone = "Vodafone"
case vodafoneIdea = "Vodafone Idea"
}

enum WifiMode: String, CaseIterable {
case searching
case failed
Expand Down
4 changes: 2 additions & 2 deletions ControlRoom/Controllers/SimCtl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ enum SimCtl: CommandLineCommandExecuter {
_ simulator: String,
cellMode: StatusBar.CellularMode,
cellBars: StatusBar.CellularBars,
carrier: String
carrier: StatusBar.Carrier
) {
execute(.statusBar(deviceId: simulator, operation: .override([
.cellularMode(cellMode),
.cellularBars(cellBars),
.operatorName(carrier)
.operatorName(carrier.rawValue)
])))
}

Expand Down
7 changes: 6 additions & 1 deletion ControlRoom/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@
}
}
},
"Carrier" : {
"comment" : "A drop-down menu that lets you select a carrier.",
"isCommentAutoGenerated" : true
},
"Cellular bars:" : {
"localizations" : {
"ar" : {
Expand Down Expand Up @@ -1277,6 +1281,7 @@
}
},
"Operator" : {
"extractionState" : "stale",
"localizations" : {
"ar" : {
"stringUnit" : {
Expand Down Expand Up @@ -2143,5 +2148,5 @@
}
}
},
"version" : "1.0"
"version" : "1.1"
}
13 changes: 11 additions & 2 deletions ControlRoom/Simulator UI/ControlScreens/StatusBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ struct StatusBarView: View {
/// The current battery state of the device; must be "Charging", "Charged", or "Discharging"
/// Note: "Charged" looks the same as "Discharging", so it's not included in this screen.
@State private var batteryState: SimCtl.StatusBar.BatteryState = .charged

@State private var carrierSelection: SimCtl.StatusBar.Carrier = .jio

var body: some View {
ScrollView {
Expand All @@ -56,7 +58,14 @@ struct StatusBarView: View {
.frame(height: 40)

Section {
TextField("Operator", text: $carrierName, onCommit: updateCellularData)

Picker("Carrier", selection: $carrierSelection.onChange(updateCellularData)) {
ForEach(SimCtl.StatusBar.Carrier.allCases, id:\.self) { carreir in
Text(carreir.rawValue)
.tag(carreir)
}
}
.pickerStyle(.menu)

Picker("Network type:", selection: $dataNetwork.onChange(updateWiFiData)) {
ForEach(SimCtl.StatusBar.DataNetwork.allCases, id: \.self) { network in
Expand Down Expand Up @@ -182,7 +191,7 @@ struct StatusBarView: View {
simulator.udid,
cellMode: cellularMode,
cellBars: cellularBar,
carrier: carrierName
carrier: carrierSelection
)
}

Expand Down