From ae78431560d32230dc2bf3eb9774c6025f86f42c Mon Sep 17 00:00:00 2001 From: Utkarsh Nigam Date: Thu, 3 Oct 2024 14:07:54 +0000 Subject: 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 --- .../android/appfunctions/sidecar/AppFunctionService.java | 9 +++++++-- .../appfunctions/sidecar/ExecuteAppFunctionResponse.java | 12 +++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'libs/appfunctions/java') 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 callback); + @NonNull Consumer 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) -- cgit v1.2.3-59-g8ed1b