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

@@ -6470,13 +6470,13 @@ package android.os {
public class UpdateEngine {
ctor public UpdateEngine();
method @NonNull public android.os.UpdateEngine.AllocateSpaceResult allocateSpace(@NonNull String, @NonNull String[]);
method @NonNull @WorkerThread public android.os.UpdateEngine.AllocateSpaceResult allocateSpace(@NonNull String, @NonNull String[]);
method public void applyPayload(String, long, long, String[]);
method public void applyPayload(@NonNull android.content.res.AssetFileDescriptor, @NonNull String[]);
method public boolean bind(android.os.UpdateEngineCallback, android.os.Handler);
method public boolean bind(android.os.UpdateEngineCallback);
method public void cancel();
method public int cleanupAppliedPayload();
method @WorkerThread public int cleanupAppliedPayload();
method public void resetStatus();
method public void resume();
method public void suspend();

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 {