diff options
author | wangqi <wangqi@google.com> | 2017-08-23 14:26:40 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-30 21:28:40 +0000 |
commit | 3be5b2f9c2ae5d8a5c2fd6c3a0ec1800c278d3a5 (patch) | |
tree | ed1e7d32d79e2e056b379a7d039b44b50bbfb91d /java/com/android/voicemail/impl/scheduling | |
parent | 9941f9595c16f1b890578fa4698e93c6af7630e6 (diff) |
Fix some potential memory leaks.
These are detected by Android Studio lint.
Bug: 64342472
Test: none
PiperOrigin-RevId: 166254633
Change-Id: Ib1daf673ef7139e0e6713e62e5ea07e3747a2d8b
Diffstat (limited to 'java/com/android/voicemail/impl/scheduling')
-rw-r--r-- | java/com/android/voicemail/impl/scheduling/TaskExecutor.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/java/com/android/voicemail/impl/scheduling/TaskExecutor.java b/java/com/android/voicemail/impl/scheduling/TaskExecutor.java index e3b718e50..afa77c58c 100644 --- a/java/com/android/voicemail/impl/scheduling/TaskExecutor.java +++ b/java/com/android/voicemail/impl/scheduling/TaskExecutor.java @@ -129,7 +129,7 @@ final class TaskExecutor { private final MainThreadHandler mainThreadHandler; - private final Context context; + private final Context appContext; /** Main thread only, access through {@link #getTasks()} */ private final TaskQueue tasks = new TaskQueue(); @@ -179,7 +179,7 @@ final class TaskExecutor { VvmLog.i("JobFinishedPoller.run", "Job finished"); if (!getTasks().isEmpty()) { TaskSchedulerJobService.scheduleJob( - context, serializePendingTasks(), delayMillis, isNewJob); + appContext, serializePendingTasks(), delayMillis, isNewJob); tasks.clear(); } terminate(); @@ -259,7 +259,7 @@ final class TaskExecutor { } private TaskExecutor(Context context) { - this.context = context; + this.appContext = context.getApplicationContext(); HandlerThread thread = new HandlerThread("VvmTaskExecutor"); thread.start(); @@ -274,7 +274,7 @@ final class TaskExecutor { job = null; workerThreadHandler.getLooper().quit(); instance = null; - TaskReceiver.resendDeferredBroadcasts(context); + TaskReceiver.resendDeferredBroadcasts(appContext); } @MainThread @@ -391,7 +391,7 @@ final class TaskExecutor { public void onStartJob(Job job, List<Bundle> pendingTasks) { VvmLog.i(TAG, "onStartJob"); this.job = job; - tasks.fromBundles(context, pendingTasks); + tasks.fromBundles(appContext, pendingTasks); maybeRunNextTask(); } |