While trying to wrap whatsapp I am having the following problem:
Continuous call to handleOnStartOne() method inside ServcesManager for the same Service
will cause startId to grow each time by one. So when it is time for the service to stop properly (i.e. when calling to stopServiceToken(..., startId)), the code that handles the appropriate closure will be skipped:
handleOnUnbindOne(intent);
handleOnDestroyOne(info);
So if this Service needs to do some special arrangements when calling stopSelf(), it won't do it.
In the case of whatsapp the service name is VoiceService, and this phenomena is happening after trying to perform phone call so that onStartCommand() of this service will be called continuously as long as there is no Answer.
I can solve this specific problem by preventing from startId to grow, but I am afraid to do damage to other scenarios.
While trying to wrap whatsapp I am having the following problem: Continuous call to handleOnStartOne() method inside ServcesManager for the same Service will cause startId to grow each time by one. So when it is time for the service to stop properly (i.e. when calling to stopServiceToken(..., startId)), the code that handles the appropriate closure will be skipped: handleOnUnbindOne(intent); handleOnDestroyOne(info); So if this Service needs to do some special arrangements when calling stopSelf(), it won't do it.
In the case of whatsapp the service name is VoiceService, and this phenomena is happening after trying to perform phone call so that onStartCommand() of this service will be called continuously as long as there is no Answer.
I can solve this specific problem by preventing from startId to grow, but I am afraid to do damage to other scenarios.
Thanks Ackstein