diff options
author | 2025-02-07 10:51:31 +0000 | |
---|---|---|
committer | 2025-02-07 12:10:29 +0000 | |
commit | a54aa305c48a53ba7e747491e1d3a436db8537a1 (patch) | |
tree | 9b73528db399c5fcdef32190c80c2e64772f6f42 /services/appfunctions/java | |
parent | 67e5e61c2a151a1c01f379816a89e31c8374310b (diff) |
Handle function not found Exception
Flag: android.app.appfunctions.flags.enable_app_function_manager
Test: atest CtsAppFunctionTests
Bug: 394571314
Change-Id: I9fef3f5cd20b49a687a1b35573c52da0fe43039c
Diffstat (limited to 'services/appfunctions/java')
-rw-r--r-- | services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java index 43764442e2cf..d0ee7af1bbfb 100644 --- a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java +++ b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java @@ -27,6 +27,7 @@ import android.annotation.WorkerThread; import android.app.appfunctions.AppFunctionException; import android.app.appfunctions.AppFunctionManager; import android.app.appfunctions.AppFunctionManagerHelper; +import android.app.appfunctions.AppFunctionManagerHelper.AppFunctionNotFoundException; import android.app.appfunctions.AppFunctionRuntimeMetadata; import android.app.appfunctions.AppFunctionStaticMetadataHelper; import android.app.appfunctions.ExecuteAppFunctionAidlRequest; @@ -513,7 +514,9 @@ public class AppFunctionManagerServiceImpl extends IAppFunctionManager.Stub { e = e.getCause(); } int resultCode = AppFunctionException.ERROR_SYSTEM_ERROR; - if (e instanceof AppSearchException appSearchException) { + if (e instanceof AppFunctionNotFoundException) { + resultCode = AppFunctionException.ERROR_FUNCTION_NOT_FOUND; + } else if (e instanceof AppSearchException appSearchException) { resultCode = mapAppSearchResultFailureCodeToExecuteAppFunctionResponse( appSearchException.getResultCode()); |