Fix issue #11630188: Still seeing some processes not on LRU list errors

This happened:

android.util.Log$TerribleFailure: Adding dependent process ProcessRecord{43c7a120 0:com.google.android.gms/u0a7} not on LRU list: service connection ConnectionRecord{437c16e0 u0 CR ACT com.google.android.gms/.icing.impl.IndexService:@436ba7f8} from ProcessRecord{43c64208 4908:com.google.android.googlequicksearchbox:search/u0a19}
	at android.util.Log.wtf(Log.java:290)
	at android.util.Slog.wtf(Slog.java:82)
	at com.android.server.am.ActivityManagerService.updateLruProcessInternalLocked(ActivityManagerService.java:2290)
	at com.android.server.am.ActivityManagerService.updateLruProcessLocked(ActivityManagerService.java:2508)
	at com.android.server.am.ActiveServices.updateServiceClientActivitiesLocked(ActiveServices.java:636)
	at com.android.server.am.ActiveServices.removeConnectionLocked(ActiveServices.java:1656)
	at com.android.server.am.ActiveServices.unbindServiceLocked(ActiveServices.java:860)
	at com.android.server.am.ActivityManagerService.unbindService(ActivityManagerService.java:12773)
	at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:869)
	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2071)
	at android.os.Binder.execTransact(Binder.java:404)
	at dalvik.system.NativeStart.run(Native Method)

Because of this earlier:

11-09 18:02:19.126 W/ActivityManager(  809): Exception when starting service com.google.android.gms/.icing.impl.IndexService
11-09 18:02:19.126 W/ActivityManager(  809): android.os.DeadObjectException
11-09 18:02:19.126 W/ActivityManager(  809): 	at android.os.BinderProxy.transact(Native Method)
11-09 18:02:19.126 W/ActivityManager(  809): 	at android.app.ApplicationThreadProxy.scheduleCreateService(ApplicationThreadNative.java:850)
11-09 18:02:19.126 W/ActivityManager(  809): 	at com.android.server.am.ActiveServices.realStartServiceLocked(ActiveServices.java:1384)
11-09 18:02:19.126 W/ActivityManager(  809): 	at com.android.server.am.ActiveServices.bringUpServiceLocked(ActiveServices.java:1294)
11-09 18:02:19.126 W/ActivityManager(  809): 	at com.android.server.am.ActiveServices.bindServiceLocked(ActiveServices.java:755)
11-09 18:02:19.126 W/ActivityManager(  809): 	at com.android.server.am.ActivityManagerService.bindService(ActivityManagerService.java:12766)
11-09 18:02:19.126 W/ActivityManager(  809): 	at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:859)
11-09 18:02:19.126 W/ActivityManager(  809): 	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2071)
11-09 18:02:19.126 W/ActivityManager(  809): 	at android.os.Binder.execTransact(Binder.java:404)
11-09 18:02:19.126 W/ActivityManager(  809): 	at dalvik.system.NativeStart.run(Native Method)

Not clearing the service's app pointer.

Also fix this wtf where we were not clearing the started state of
a ServiceTracker when its process goes away.  (This was like this
because we used to want to leave the started state so that we can
know the process is trying to restart.  But now that have a new
explicit restarting strate, there is no need to leave it.)

android.util.Log$TerribleFailure: Service owner ServiceRecord{436f5168 u0 com.dirtywaterlabs.uberhype/com.dirtywaterlabs.musichype.MDService} cleared while started: pkg=com.dirtywaterlabs.uberhype service=com.dirtywaterlabs.musichype.MDService proc=ProcessState{42bf4bb8 com.dirtywaterlabs.uberhype:remote/10115 pkg=com.dirtywaterlabs.uberhype}
	at android.util.Log.wtf(Log.java:290)
	at android.util.Slog.wtfStack(Slog.java:86)
	at com.android.internal.app.ProcessStats$ServiceState.clearCurrentOwner(ProcessStats.java:2989)
	at com.android.server.am.ActiveServices.serviceDoneExecutingLocked(ActiveServices.java:1821)
	at com.android.server.am.ActiveServices.serviceProcessGoneLocked(ActiveServices.java:1779)
	at com.android.server.am.ActiveServices.removeConnectionLocked(ActiveServices.java:1693)
	at com.android.server.am.ActiveServices.killServicesLocked(ActiveServices.java:2028)
	at com.android.server.am.ActivityManagerService.cleanUpApplicationRecordLocked(ActivityManagerService.java:12424)
	at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:3605)
	at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:3750)
	at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1026)
	at android.os.BinderProxy.sendDeathNotice(Binder.java:493)
	at dalvik.system.NativeStart.run(Native Method)

Change-Id: I25a3fb678b5365254490cd5509b558348655b589
1 file changed