语言

OnDevicePersonalizationManager.Execute 方法

定义

在 OnDevicePersonalization 沙盒中执行。IsolatedService

[Android.Runtime.Register("execute", "(Landroid/content/ComponentName;Landroid/os/PersistableBundle;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetExecute_Landroid_content_ComponentName_Landroid_os_PersistableBundle_Ljava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=35)]
public virtual void Execute(Android.Content.ComponentName service, Android.OS.PersistableBundle params, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver receiver);
[<Android.Runtime.Register("execute", "(Landroid/content/ComponentName;Landroid/os/PersistableBundle;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetExecute_Landroid_content_ComponentName_Landroid_os_PersistableBundle_Ljava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=35)>]
abstract member Execute : Android.Content.ComponentName * Android.OS.PersistableBundle * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
override this.Execute : Android.Content.ComponentName * Android.OS.PersistableBundle * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit

参数

service
ComponentName

ComponentName的 IsolatedService。

params
PersistableBundle

从调用应用传递到的 PersistableBundle。IsolatedService 此参数的预期内容由此参数IsolatedService定义。 平台不解释此参数。

executor
IExecutor

调用 Executor 回调的依据。

receiver
IOutcomeReceiver

这会返回 ExecuteResult 成功或 Exception 失败时的对象。 IsolatedService如果返回的一个RenderingConfig要显示,ExecuteResult#getSurfacePackageToken()将返回非 nullSurfacePackageToken。 该 SurfacePackageToken 对象可在后续 #requestSurfacePackage(SurfacePackageToken, IBinder, int, int, int, Executor, OutcomeReceiver) 调用中使用,以在视图中显示结果。 返回 SurfacePackageToken 结果可能为 null,指示此请求不显示任何输出。 IsolatedService如果已返回任何输出数据,并且调用应用被允许从此服务接收数据,则将ExecuteResult#getOutputData()返回非 null 字节数组。 <p>如果出现错误,接收方将返回以下异常之一:如果处理程序包未安装或没有有效的 ODP 清单,则 android.content.pm.PackageManager.NameNotFoundException 返回一个。 如果未找到处理程序类,则返回 ClassNotFoundException 。 如果处理程序的执行失败,则返回一个 OnDevicePersonalizationException 。

特性

注解

在 OnDevicePersonalization 沙盒中执行。IsolatedService 平台绑定到独立进程中的指定 IsolatedService ,并使用调用方提供的参数进行调用 IsolatedWorker#onExecute(ExecuteInput, android.os.OutcomeReceiver) 。 IsolatedService完成执行后,平台将引用服务结果的令牌返回到调用方。 这些令牌随后可用于在 android.view.SurfaceView 调用应用中显示结果。

Java文档android.adservices.ondevicepersonalization.OnDevicePersonalizationManager.execute(android.content.ComponentName, android.os.PersistableBundle, java.util.concurrent.Executor, android.os.OutcomeReceiver<android.adservices.ondevicepersonalization.OnDevicePersonalizationManager.ExecuteResult, java.lang.Exception>)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于