Skip to content
Merged
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
10 changes: 9 additions & 1 deletion packages/omamobile-modem-sit/lib/bringup.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,15 @@ def usim_ready():
provision_profiles(client, profiles)
lte = net.get('nr', 'off') == 'off'
nr_after_radio = False
if lte and not already_on and net.getboolean('nr_after_radio_on', False):
try:
after_on = net.getboolean('nr_after_radio_on', False)
except ValueError:
# A mistyped value keeps today's order rather than stopping the
# start after the attach settings were sent.
print(f"nr_after_radio_on = {net.get('nr_after_radio_on')!r} isn't yes or no; "
'the NR mode is set as by default', flush=True)
after_on = False
if lte and not already_on and after_on:
# [network] nr_after_radio_on = yes: never with the radio off. On a
# second Pixel 7 Pro this modem sometimes accepted SET_NR_MODE with
# the radio off (reading 0) instead of refusing it, put the mode back
Expand Down
8 changes: 8 additions & 0 deletions packages/omamobile-modem-sit/test/test_bringup.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ def test_nr_after_radio_on_never_sets_it_with_the_radio_off(self):
order, _ = self.run_start(1, settings)
self.assertEqual(order[:5], ['state', 'attach', 'profiles', 'nr', 'reg'])

def test_nr_after_radio_on_mistyped_keeps_the_default_order(self):
settings = paths.config('/nonexistent')
settings['network']['apn'] = 'internet.example'
settings['network']['nr_after_radio_on'] = 'ja'
order, lines = self.run_start(0, settings)
self.assertEqual(order[:6], ['state', 'attach', 'profiles', 'nr', 'on', 'reg'])
self.assertTrue(any("'ja' isn't yes or no" in l for l in lines))

def test_nr_on_leaves_the_nr_mode_alone(self):
settings = paths.config('/nonexistent')
settings['network']['apn'] = 'internet.example'
Expand Down
2 changes: 1 addition & 1 deletion packages/omamobile-modem-sit/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.40
0.3.41