Loading core/java/android/app/ActivityThread.java +1 −0 Original line number Diff line number Diff line Loading @@ -3567,6 +3567,7 @@ public final class ActivityThread { try { if (localLOGV) Slog.v(TAG, "Destroying service " + s); s.onDestroy(); s.detachAndCleanUp(); Context context = s.getBaseContext(); if (context instanceof ContextImpl) { final String who = s.getClassName(); Loading core/java/android/app/Service.java +9 −1 Original line number Diff line number Diff line Loading @@ -768,6 +768,14 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac < Build.VERSION_CODES.ECLAIR; } /** * @hide * Clean up any references to avoid leaks. */ public final void detachAndCleanUp() { mToken = null; } final String getClassName() { return mClassName; } Loading core/java/android/app/job/JobServiceEngine.java +1 −11 Original line number Diff line number Diff line Loading @@ -55,21 +55,12 @@ public abstract class JobServiceEngine { */ private static final int MSG_JOB_FINISHED = 2; /** * Context we are running in. */ private final Service mService; private final IJobService mBinder; /** Lock object for {@link #mHandler}. */ private final Object mHandlerLock = new Object(); /** * Handler we post jobs to. Responsible for calling into the client logic, and handling the * callback to the system. */ @GuardedBy("mHandlerLock") JobHandler mHandler; static final class JobInterface extends IJobService.Stub { Loading Loading @@ -189,9 +180,8 @@ public abstract class JobServiceEngine { * @param service The {@link Service} that is creating this engine and in which it will run. */ public JobServiceEngine(Service service) { mService = service; mBinder = new JobInterface(this); mHandler = new JobHandler(mService.getMainLooper()); mHandler = new JobHandler(service.getMainLooper()); } /** Loading Loading
core/java/android/app/ActivityThread.java +1 −0 Original line number Diff line number Diff line Loading @@ -3567,6 +3567,7 @@ public final class ActivityThread { try { if (localLOGV) Slog.v(TAG, "Destroying service " + s); s.onDestroy(); s.detachAndCleanUp(); Context context = s.getBaseContext(); if (context instanceof ContextImpl) { final String who = s.getClassName(); Loading
core/java/android/app/Service.java +9 −1 Original line number Diff line number Diff line Loading @@ -768,6 +768,14 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac < Build.VERSION_CODES.ECLAIR; } /** * @hide * Clean up any references to avoid leaks. */ public final void detachAndCleanUp() { mToken = null; } final String getClassName() { return mClassName; } Loading
core/java/android/app/job/JobServiceEngine.java +1 −11 Original line number Diff line number Diff line Loading @@ -55,21 +55,12 @@ public abstract class JobServiceEngine { */ private static final int MSG_JOB_FINISHED = 2; /** * Context we are running in. */ private final Service mService; private final IJobService mBinder; /** Lock object for {@link #mHandler}. */ private final Object mHandlerLock = new Object(); /** * Handler we post jobs to. Responsible for calling into the client logic, and handling the * callback to the system. */ @GuardedBy("mHandlerLock") JobHandler mHandler; static final class JobInterface extends IJobService.Stub { Loading Loading @@ -189,9 +180,8 @@ public abstract class JobServiceEngine { * @param service The {@link Service} that is creating this engine and in which it will run. */ public JobServiceEngine(Service service) { mService = service; mBinder = new JobInterface(this); mHandler = new JobHandler(mService.getMainLooper()); mHandler = new JobHandler(service.getMainLooper()); } /** Loading