diff options
author | 2024-10-03 14:07:54 +0000 | |
---|---|---|
committer | 2024-10-03 14:07:54 +0000 | |
commit | ae78431560d32230dc2bf3eb9774c6025f86f42c (patch) | |
tree | cb22c746792cd6222e2a22c74f904497d3e99c12 /libs/appfunctions/java | |
parent | 5495a2b568d683f8747f6fca90797ec25b57cd5a (diff) |
Make onExecuteAppFunction non-abstract and remove timeout results.
This is required so g3 usages can stop overriding this deprecated method and the timeout logic was removed in ag/29477656
Change-Id: Icd07685ea296403b48f4c3cbd74c2e7c3ad28430
Flag: android.app.appfunctions.flags.enable_app_function_manager
Test: atest CtsAppFunctionTestCases -c
Bug: 360864791
Diffstat (limited to 'libs/appfunctions/java')
2 files changed, 14 insertions, 7 deletions
diff --git a/libs/appfunctions/java/com/google/android/appfunctions/sidecar/AppFunctionService.java b/libs/appfunctions/java/com/google/android/appfunctions/sidecar/AppFunctionService.java index 6023c977bd76..6e91de6bbcf2 100644 --- a/libs/appfunctions/java/com/google/android/appfunctions/sidecar/AppFunctionService.java +++ b/libs/appfunctions/java/com/google/android/appfunctions/sidecar/AppFunctionService.java @@ -26,6 +26,7 @@ import android.content.Intent; import android.os.Binder; import android.os.IBinder; import android.os.CancellationSignal; +import android.util.Log; import java.util.function.Consumer; @@ -143,7 +144,11 @@ public abstract class AppFunctionService extends Service { */ @MainThread @Deprecated - public abstract void onExecuteFunction( + public void onExecuteFunction( @NonNull ExecuteAppFunctionRequest request, - @NonNull Consumer<ExecuteAppFunctionResponse> callback); + @NonNull Consumer<ExecuteAppFunctionResponse> callback) { + Log.w( + "AppFunctionService", + "Calling deprecated default implementation of onExecuteFunction"); + } } diff --git a/libs/appfunctions/java/com/google/android/appfunctions/sidecar/ExecuteAppFunctionResponse.java b/libs/appfunctions/java/com/google/android/appfunctions/sidecar/ExecuteAppFunctionResponse.java index c7ce95bab7a5..d87fec7985e9 100644 --- a/libs/appfunctions/java/com/google/android/appfunctions/sidecar/ExecuteAppFunctionResponse.java +++ b/libs/appfunctions/java/com/google/android/appfunctions/sidecar/ExecuteAppFunctionResponse.java @@ -73,11 +73,14 @@ public final class ExecuteAppFunctionResponse { */ public static final int RESULT_INVALID_ARGUMENT = 4; - /** The operation was timed out. */ - public static final int RESULT_TIMED_OUT = 5; - /** The caller tried to execute a disabled app function. */ - public static final int RESULT_DISABLED = 6; + public static final int RESULT_DISABLED = 5; + + /** + * The operation was cancelled. Use this error code to report that a cancellation is done after + * receiving a cancellation signal. + */ + public static final int RESULT_CANCELLED = 6; /** The result code of the app function execution. */ @ResultCode private final int mResultCode; @@ -236,7 +239,6 @@ public final class ExecuteAppFunctionResponse { RESULT_APP_UNKNOWN_ERROR, RESULT_INTERNAL_ERROR, RESULT_INVALID_ARGUMENT, - RESULT_TIMED_OUT, RESULT_DISABLED }) @Retention(RetentionPolicy.SOURCE) |