@@ -110,6 +110,7 @@ public class MainActivity extends AppCompatActivity implements ServiceConnection
110
110
private boolean _isConnecting = false ;
111
111
private boolean _isAppExit = false ;
112
112
private boolean _isAppRestart = false ;
113
+ private boolean _isRigCtlUsbConnected = false ;
113
114
114
115
private long _backPressedTimestamp ;
115
116
@@ -290,6 +291,7 @@ private void startTransportConnection() {
290
291
int resultCode = result .getResultCode ();
291
292
String transportType = _sharedPreferences .getString (PreferenceKeys .PORTS_TYPE , "loopback" );
292
293
if (transportType .equals ("sound_modem" )) {
294
+ _isRigCtlUsbConnected = resultCode == RESULT_OK ;
293
295
startAppService (TransportFactory .TransportType .SOUND_MODEM );
294
296
} else if (resultCode == RESULT_CANCELED ) {
295
297
_textConnInfo .setText (R .string .main_status_loopback_test );
@@ -303,6 +305,7 @@ private void startTransportConnection() {
303
305
304
306
protected void startUsbConnectActivity () {
305
307
_isConnecting = true ;
308
+ _isRigCtlUsbConnected = false ;
306
309
_usbActivityLauncher .launch (new Intent (this , UsbConnectActivity .class ));
307
310
}
308
311
@@ -465,7 +468,7 @@ private void updateStatusText(ProtocolFactory.ProtocolType protocolType) {
465
468
466
469
// rig CAT control
467
470
String rigName = _sharedPreferences .getString (PreferenceKeys .PORTS_SOUND_MODEM_RIG , "Disabled" );
468
- if (!rigName .equals ("Disabled" ) && UsbPortHandler . getPort () != null ) {
471
+ if (!rigName .equals ("Disabled" ) && _isRigCtlUsbConnected ) {
469
472
status += getString (R .string .ports_sound_modem_rig_label );
470
473
}
471
474
0 commit comments