I've been playing around with User's activity recognition and the Fused location provider and noticed that even after I uninstalled the sample app, activity recognition requests / location requests are still being fired as I'm seeing the following every couple of seconds :
05-20 23:20:22.569: W/ActivityManager(389): Unable to start service Intent { cmp=com.example.android.activityrecognition/.ActivityRecognitionIntentService (has extras) } U=0: not found
The exception obviously coming from the fact that my service is gone (app uninstalled).
I'm seeing the same thing with the location provider.
As a consequence, if a pending intent was used like this
Intent intent = new Intent(Constants.INTENT_ACTION_LOCATION_UPDATED);
PendingIntent pendingIntent = PendingIntent.getService(BasicMapActivity.this, LOCATION_INTENT_CODE, intent, 0);
LocationRequest locationRequest = LocationRequest.create().setInterval(5000).setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
locationClient.requestLocationUpdates(locationRequest, pendingIntent);
This could leave the GPS polling for a location all the time in the event the app is uninstalled or the app has crashed and no proper "user-cleanup" took place.
Is this normal behavior ? I would imagine some cleanup on PendingIntents would be done when the app is removed .
Is this related to the fact that these request are flowing through the Google Play Services process ?
How should we deal with this ?
EDIT : Posted an issue in the Android tracker but was told this is not the correct place for reporting issues with Google Apps. Posted it on the Google Mobile Help Forum