UpdateEngine: add WorkerThread annotation.

Add @WorkerThread to allocateSpace and cleanupAppliedPayload
because they take a non-trivial amount of time.

Bug: 148486809
Test: builds
Change-Id: Ib7daba9c662b9e141430df71401d069577221b8a
This commit is contained in:
Yifan Hong
2020-01-28 18:25:29 -08:00
parent e8380c9876
commit f64f31e7be
2 changed files with 5 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ package android.os;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.annotation.WorkerThread;
import android.content.res.AssetFileDescriptor;
import android.os.IUpdateEngine;
import android.os.IUpdateEngineCallback;
@@ -535,6 +536,7 @@ public class UpdateEngine {
* @return See {@link AllocateSpaceResult#getErrorCode} and
* {@link AllocateSpaceResult#getFreeSpaceRequired}.
*/
@WorkerThread
@NonNull
public AllocateSpaceResult allocateSpace(
@NonNull String payloadMetadataFilename,
@@ -585,6 +587,7 @@ public class UpdateEngine {
* @throws ServiceSpecificException if other transient errors has occurred.
* A reboot may or may not help resolving the issue.
*/
@WorkerThread
@ErrorCode
public int cleanupAppliedPayload() {
try {