If the app is started in some other manner than the launch activity (e.g. receives an Intent from a BroadcastReceiver and starts Tor), then there is no task removal to trigger exitProcess.
Application.ActivityLifecycleCallbacks must be registered upon initialiaztion of TorServiceConfig.Initializer in order to catch the first Activity.onCreate (before Application.onCreate finishes). In the event there is no Activity (i.e. headless mode), then when TorService.onDestroy executes it should register as not having a task associated with it and call exitProcess.
If the app is started in some other manner than the launch activity (e.g. receives an Intent from a
BroadcastReceiver
and starts Tor), then there is no task removal to triggerexitProcess
.Application.ActivityLifecycleCallbacks
must be registered upon initialiaztion ofTorServiceConfig.Initializer
in order to catch the firstActivity.onCreate
(beforeApplication.onCreate
finishes). In the event there is noActivity
(i.e. headless mode), then whenTorService.onDestroy
executes it should register as not having a task associated with it and callexitProcess
.Part of #423