Loading packages/SystemUI/src/com/android/systemui/util/concurrency/PendingTasksContainer.kt +2 −9 Original line number Original line Diff line number Diff line Loading @@ -37,19 +37,13 @@ class PendingTasksContainer { */ */ fun registerTask(name: String): Runnable { fun registerTask(name: String): Runnable { pendingTasksCount.incrementAndGet() pendingTasksCount.incrementAndGet() if (ENABLE_TRACE) { Trace.beginAsyncSection("PendingTasksContainer#$name", 0) Trace.beginAsyncSection("PendingTasksContainer#$name", 0) } return Runnable { return Runnable { Trace.endAsyncSection("PendingTasksContainer#$name", 0) if (pendingTasksCount.decrementAndGet() == 0) { if (pendingTasksCount.decrementAndGet() == 0) { val onComplete = completionCallback.getAndSet(null) val onComplete = completionCallback.getAndSet(null) onComplete?.run() onComplete?.run() if (ENABLE_TRACE) { Trace.endAsyncSection("PendingTasksContainer#$name", 0) } } } } } } } Loading Loading @@ -82,4 +76,3 @@ class PendingTasksContainer { fun getPendingCount(): Int = pendingTasksCount.get() fun getPendingCount(): Int = pendingTasksCount.get() } } private const val ENABLE_TRACE = false Loading
packages/SystemUI/src/com/android/systemui/util/concurrency/PendingTasksContainer.kt +2 −9 Original line number Original line Diff line number Diff line Loading @@ -37,19 +37,13 @@ class PendingTasksContainer { */ */ fun registerTask(name: String): Runnable { fun registerTask(name: String): Runnable { pendingTasksCount.incrementAndGet() pendingTasksCount.incrementAndGet() if (ENABLE_TRACE) { Trace.beginAsyncSection("PendingTasksContainer#$name", 0) Trace.beginAsyncSection("PendingTasksContainer#$name", 0) } return Runnable { return Runnable { Trace.endAsyncSection("PendingTasksContainer#$name", 0) if (pendingTasksCount.decrementAndGet() == 0) { if (pendingTasksCount.decrementAndGet() == 0) { val onComplete = completionCallback.getAndSet(null) val onComplete = completionCallback.getAndSet(null) onComplete?.run() onComplete?.run() if (ENABLE_TRACE) { Trace.endAsyncSection("PendingTasksContainer#$name", 0) } } } } } } } Loading Loading @@ -82,4 +76,3 @@ class PendingTasksContainer { fun getPendingCount(): Int = pendingTasksCount.get() fun getPendingCount(): Int = pendingTasksCount.get() } } private const val ENABLE_TRACE = false