Browse Source

Only the protocols, that were defined in the profile will be started

Alexander Brakowski 10 years ago
parent
commit
e3d8cb7411

+ 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 {