purge CMD_INIT/initialize() from TorService, an IntentService doesn't need it
when switching to an IntentService, a new Intent will always start the Service, and onCreate() can be used to initialize the Service.
This commit is contained in:
		
							parent
							
								
									f09379d86c
								
							
						
					
					
						commit
						ae83f011b2
					
				|  | @ -113,16 +113,6 @@ public class OrbotMainActivity extends Activity implements OrbotConstants, OnLon | |||
|   	   | ||||
| 		LocalBroadcastManager.getInstance(this).registerReceiver(mMessageReceiver, | ||||
| 			      new IntentFilter(TorServiceConstants.LOCAL_ACTION_LOG)); | ||||
| 
 | ||||
| 		mHandler.postDelayed(new Runnable () | ||||
| 		{ | ||||
| 		 | ||||
| 			public void run () | ||||
| 			{ | ||||
| 				startService(TorServiceConstants.CMD_INIT); | ||||
| 			} | ||||
| 		},INIT_DELAY); | ||||
| 		 | ||||
| 	} | ||||
| 	 | ||||
| 	 | ||||
|  |  | |||
|  | @ -20,13 +20,10 @@ public class OnBootReceiver extends BroadcastReceiver { | |||
| 		 | ||||
| 		if (startOnBoot) | ||||
| 		{ | ||||
| 			 | ||||
| 			startService(TorServiceConstants.CMD_INIT,context); | ||||
| 			startService(TorServiceConstants.CMD_START,context);		 | ||||
| 			 | ||||
| 			if (useVPN) | ||||
| 				startVpnService(context); | ||||
| 			 | ||||
| 		} | ||||
| 
 | ||||
| 	} | ||||
|  |  | |||
|  | @ -375,9 +375,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon | |||
|                             setTorProfile(STATUS_ON); | ||||
|                         }else if (action.equals(CMD_STOP)){ | ||||
|                             setTorProfile(STATUS_OFF); | ||||
|                         }else if (action.equals(CMD_INIT)){ | ||||
|                             initialize(); | ||||
|                             sendCallbackStatus(mCurrentStatus); | ||||
|                         }else if (action.equals(CMD_NEWNYM)){ | ||||
|                             newIdentity(); | ||||
|                         }else if (action.equals(CMD_FLUSH)){ | ||||
|  | @ -623,11 +620,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon | |||
|     @Override | ||||
|     public void onCreate() { | ||||
|         super.onCreate(); | ||||
|         initialize(); | ||||
|     } | ||||
|      | ||||
|     private void initialize() | ||||
|     { | ||||
|         try | ||||
|         { | ||||
|             mNumberFormat = NumberFormat.getInstance(Locale.getDefault()); //localized numbers! | ||||
|  |  | |||
|  | @ -87,7 +87,6 @@ public interface TorServiceConstants { | |||
|     public static final String CMD_STOP = "stop"; | ||||
|     public static final String CMD_FLUSH = "flush"; | ||||
|     public static final String CMD_NEWNYM = "newnym"; | ||||
|     public static final String CMD_INIT = "init"; | ||||
|     public static final String CMD_VPN = "vpn"; | ||||
|     public static final String CMD_VPN_CLEAR = "vpnclear"; | ||||
|     public static final String CMD_UPDATE = "update"; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue