solve PR issues

This commit is contained in:
CiufudeanDani 2022-05-03 10:44:37 +03:00
parent 6fda464ed8
commit b17ba94950
3 changed files with 218 additions and 451 deletions

View File

@ -102,10 +102,8 @@ public class TCPService extends Service {
/** Stop TCP Connection */ /** Stop TCP Connection */
public void stopTCPConnection() public void stopTCPConnection() {
{ if(tcp != null) {
if(tcp != null)
{
tcp.Stop(); tcp.Stop();
tcp = null; tcp = null;
} }

View File

@ -593,18 +593,10 @@ public class TabLayoutActivity extends AbstractSDParentActivity {
// network available // network available
Log.v(TAG, "network available"); Log.v(TAG, "network available");
Log.v(TAG, "tcp: " + (tcp != null)); Log.v(TAG, "tcp: " + (tcp != null));
// if (tcp == null)
// getApplicationContext().bindService(new Intent(context, TCPService.class), serviceConnection, Context.BIND_AUTO_CREATE);
// if (myService != null)
// tcp = myService.getTCPConnection();
if (tcp != null) { if (tcp != null) {
if (tcp.isConnectionUP) { if (tcp.isConnectionUP)
tcp.isConnectionUP = false; tcp.isConnectionUP = false;
tcp.Stop();
}
// tcp = null;
uiHandler.post(() -> { uiHandler.post(() -> {
Log.v(TAG, "myService: " + (myService != null)); Log.v(TAG, "myService: " + (myService != null));
@ -614,7 +606,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity {
getApplicationContext().bindService(new Intent(context, TCPService.class), serviceConnection, Context.BIND_AUTO_CREATE); getApplicationContext().bindService(new Intent(context, TCPService.class), serviceConnection, Context.BIND_AUTO_CREATE);
if (getRadioActivity() != null) if (getRadioActivity() != null)
getRadioActivity().onCreate(getRadioActivity().savedInstanceState); getRadioActivity().onCreate(getRadioActivity().getSavedInstanceState());
if (getMessageActivity() != null) if (getMessageActivity() != null)
getMessageActivity().onCreate(getMessageActivity().getSavedInstanceState()); getMessageActivity().onCreate(getMessageActivity().getSavedInstanceState());
if (getRecordingsActivity() != null) if (getRecordingsActivity() != null)
@ -817,7 +809,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity {
if (getHistoryActivity() != null) if (getHistoryActivity() != null)
getHistoryActivity().setLanguage(); getHistoryActivity().setLanguage();
if (getRadioActivity() != null) if (getRadioActivity() != null)
getRadioActivity().onCreate(getRadioActivity().savedInstanceState); getRadioActivity().onCreate(getRadioActivity().getSavedInstanceState());
if (getMessageActivity() != null) if (getMessageActivity() != null)
getMessageActivity().onCreate(getMessageActivity().getSavedInstanceState()); getMessageActivity().onCreate(getMessageActivity().getSavedInstanceState());
if (getRecordingsActivity() != null) if (getRecordingsActivity() != null)
@ -2136,7 +2128,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity {
getApplicationContext().bindService(new Intent(context, TCPService.class), serviceConnection, Context.BIND_AUTO_CREATE); getApplicationContext().bindService(new Intent(context, TCPService.class), serviceConnection, Context.BIND_AUTO_CREATE);
if (getRadioActivity() != null) if (getRadioActivity() != null)
getRadioActivity().onCreate(getRadioActivity().savedInstanceState); getRadioActivity().onCreate(getRadioActivity().getSavedInstanceState());
if (getMessageActivity() != null) if (getMessageActivity() != null)
getMessageActivity().onCreate(getMessageActivity().getSavedInstanceState()); getMessageActivity().onCreate(getMessageActivity().getSavedInstanceState());
if (getRecordingsActivity() != null) if (getRecordingsActivity() != null)