Browse Source

Merge branch 'master' of https://git.tk.informatik.tu-darmstadt.de/scm-ssi-student-hostagev2

Daniel Lazar 10 years ago
parent
commit
b5fe064afe

+ 8 - 2
src/de/tudarmstadt/informatik/hostage/ui2/fragment/HomeFragment.java

@@ -270,8 +270,14 @@ public class HomeFragment extends Fragment {
 					    setStateNotConnected();
 				    } else {
 					    if(isChecked){
-						    for(String protocol: getResources().getStringArray(R.array.protocols)){
-							    if(!MainActivity.getInstance().getHoneyService().isRunning(protocol)) MainActivity.getInstance().getHoneyService().startListener(protocol);
+						    if(ProfileManager.getInstance().getCurrentActivatedProfile() == null){
+							    for(String protocol: getResources().getStringArray(R.array.protocols)){
+								    if(!MainActivity.getInstance().getHoneyService().isRunning(protocol)) MainActivity.getInstance().getHoneyService().startListener(protocol);
+							    }
+						    } else {
+							    for(String protocol: ProfileManager.getInstance().getCurrentActivatedProfile().getActiveProtocols()){
+								    if(!MainActivity.getInstance().getHoneyService().isRunning(protocol)) MainActivity.getInstance().getHoneyService().startListener(protocol);
+							    }
 						    }
 						    setStateActive();
 					    } else {