{"id":99770,"date":"2026-09-03T09:01:37","date_gmt":"2026-09-03T01:01:37","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/99770.html"},"modified":"2026-09-03T09:01:37","modified_gmt":"2026-09-03T01:01:37","slug":"%e7%ac%ac-51-%e7%ab%a0%ef%bc%9aai%e3%80%81appfunctions-%e4%b8%8e%e8%ae%a1%e7%ae%97%e6%9c%ba%e6%8e%a7%e5%88%b6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/99770.html","title":{"rendered":"\u7b2c 51 \u7ae0\uff1aAI\u3001AppFunctions \u4e0e\u8ba1\u7b97\u673a\u63a7\u5236"},"content":{"rendered":"<p>Android \u5df2\u7ecf\u4ece\u4e00\u4e2a\u4ec5\u80fd\u8fd0\u884c\u5e94\u7528\u7684\u5e73\u53f0\uff0c\u6f14\u8fdb\u4e3a\u80fd\u591f\u7406\u89e3\u5e94\u7528\u884c\u4e3a\u7684\u5e73\u53f0\u3002\u4e00\u7cfb\u5217\u7aef\u4fa7\u667a\u80fd\u670d\u52a1\u5c06\u7528\u6237\u610f\u56fe\u4e0e\u5e94\u7528\u884c\u4e3a\u5173\u8054\u8d77\u6765\uff1aAppFunctions \u6846\u67b6\u5141\u8bb8\u52a9\u624b\u901a\u8fc7\u5f3a\u7c7b\u578b RPC \u5951\u7ea6\u8c03\u7528\u5e94\u7528\u7684\u4efb\u610f\u529f\u80fd\uff1b\u8ba1\u7b97\u673a\u63a7\u5236\uff08Computer Control\uff09\u4e3a AI \u4ee3\u7406\u63d0\u4f9b\u865a\u62df\u663e\u793a\u5668\uff0c\u53ef\u5728\u5176\u4e0a\u5b8c\u6210\u70b9\u51fb\u3001\u6ed1\u52a8\u3001\u622a\u56fe\u64cd\u4f5c\uff1bOnDeviceIntelligence \u5728\u9694\u79bb\u6c99\u7bb1\u4e2d\u8fd0\u884c\u5927\u673a\u5668\u5b66\u4e60\u6a21\u578b \u2014\u2014 \u5927\u8bed\u8a00\u6a21\u578b\u4ee5\u53ca\u5176\u4ed6\u751f\u6210\u5f0f\u6216\u5927\u89c4\u6a21\u63a8\u7406\u8d1f\u8f7d\uff1bNNAPI \u5411\u6240\u6709\u539f\u751f\u5de5\u4f5c\u8d1f\u8f7d\u66b4\u9732\u786c\u4ef6\u52a0\u901f\u5668\u3002\u7ed3\u5408 AppSearch\u3001\u5185\u5bb9\u6355\u83b7\uff08Content Capture\uff09\u3001AdServices \u4ee5\u53ca\u8054\u90a6\u5b66\u4e60\uff0c\u8fd9\u4e9b\u5b50\u7cfb\u7edf\u5171\u540c\u6784\u6210\u4e86 Android \u7684 AI \u795e\u7ecf\u4f53\u7cfb\u3002<\/p>\n<p>\u672c\u7ae0\u9010\u5c42\u68b3\u7406\u5b8c\u6574\u8c03\u7528\u94fe\u8def\uff1a\u4ece\u516c\u5f00 SDK \u7c7b\uff0c\u7ecf\u7531 AIDL \u63a5\u53e3\u3001system_server \u670d\u52a1\u5b9e\u73b0\uff0c\u4e00\u76f4\u5230\u53e6\u4e00\u7aef\u6c99\u7bb1\u8fdb\u7a0b\u6216 HAL \u8fdb\u7a0b\u3002\u6bcf\u4e00\u6761\u4ee3\u7801\u8def\u5f84\u5747\u5bf9\u5e94\u5f53\u524d AOSP \u6e90\u7801\u6811\u4e2d\u7684\u771f\u5b9e\u6e90\u6587\u4ef6\u3002<\/p>\n<h3>51.1 AOSP AI \u5168\u666f\u6982\u89c8<\/h3>\n<p>\u5728\u6df1\u5165\u4efb\u4e00\u6846\u67b6\u7ec6\u8282\u4e4b\u524d\uff0c\u5148\u6574\u4f53\u6d4f\u89c8 AOSP \u5168\u90e8 AI\/ML \u76f8\u5173\u7ec4\u4ef6\u3002\u4e0b\u56fe\u5217\u51fa\u4e3b\u8981\u5b50\u7cfb\u7edf\u3001\u8de8\u8fdb\u7a0b\u8fb9\u754c\u4ee5\u53ca\u7ec4\u4ef6\u4e4b\u95f4\u7684\u6570\u636e\u6d41\u3002<\/p>\n<p>Mainline \u6a21\u5757 HAL \/ \u9a71\u52a8\u8fdb\u7a0b \u9694\u79bb \/ \u6c99\u7bb1\u8fdb\u7a0b \u76ee\u6807\u5e94\u7528\u8fdb\u7a0b system_server \u5e94\u7528\u8fdb\u7a0b Binder IPC bindService Binder IPC \u9694\u79bb bind \u8c03\u7528 Binder IPC Binder IPC Binder IPC Binder IPC Binder IPC<\/p>\n<p>\u7b2c\u4e09\u65b9 \/ \u7cfb\u7edf\u5e94\u7528 AppFunctionManager OnDeviceIntelligenceManager NNAPI C API ComputerControlExtensions AppSearchManager TextClassifierManager ContentCaptureManager AppPredictionManager TopicsManager<\/p>\n<p>AppFunctionManagerServiceImpl OnDeviceIntelligenceManagerService VirtualDeviceManager ComputerControlSession Service ContentCaptureManagerService TextClassificationManagerService AppPredictionManagerService<\/p>\n<p>AppFunctionService OnDeviceSandboxedInferenceService IsolatedTrainingService NNAPI HAL (IDevice) GPU \/ DSP \/ NPU<\/p>\n<p>AppSearch \u6a21\u5757 NeuralNetworks \u6a21\u5757 OnDevicePersonalization \u6a21\u5757 AdServices \u6a21\u5757<\/p>\n<h4>51.1.1 AOSP \u667a\u80fd\u5b50\u7cfb\u7edf\u5206\u7c7b\u8868<\/h4>\n<table>\n<tr>\n   \u5b50\u7cfb\u7edf<br \/>\n   API \u7b49\u7ea7<br \/>\n   \u662f\u5426 Mainline \u6a21\u5757<br \/>\n   \u7528\u9014<br \/>\n  <\/tr>\n<tbody>\n<tr>\n<td>AppFunctions<\/td>\n<td>16\uff08\u5f15\u5165\uff09\uff0cAndroid 17 \u8d8b\u4e8e\u6210\u719f<\/td>\n<td>\u5426\uff08\u6846\u67b6\u5185\u7f6e\uff09<\/td>\n<td>\u5f3a\u7c7b\u578b\u8de8\u5e94\u7528\u51fd\u6570\u8c03\u7528\uff0c\u652f\u6301\u8fd0\u884c\u65f6\u6ce8\u518c\u4e0e\u72b6\u6001\u89c2\u6d4b<\/td>\n<\/tr>\n<tr>\n<td>Computer Control<\/td>\n<td>16\uff08Android 16\uff09<\/td>\n<td>\u5426\uff08\u6846\u67b6 + \u6269\u5c55\u5e93\uff09<\/td>\n<td>\u57fa\u4e8e\u865a\u62df\u663e\u793a\u5668\u5b9e\u73b0 AI \u9a71\u52a8\u7684 UI \u81ea\u52a8\u5316<\/td>\n<\/tr>\n<tr>\n<td>OnDeviceIntelligence<\/td>\n<td>15 \u53ca\u4ee5\u4e0a<\/td>\n<td>NeuralNetworks \u6a21\u5757<\/td>\n<td>\u6c99\u7bb1\u5316\u7684\u5927\u8bed\u8a00\u6a21\u578b \/ \u673a\u5668\u5b66\u4e60\u63a8\u7406<\/td>\n<\/tr>\n<tr>\n<td>NNAPI<\/td>\n<td>8.1 \u53ca\u4ee5\u4e0a<\/td>\n<td>NeuralNetworks \u6a21\u5757<\/td>\n<td>\u795e\u7ecf\u7f51\u7edc\u63a8\u7406\u786c\u4ef6\u52a0\u901f<\/td>\n<\/tr>\n<tr>\n<td>AppSearch<\/td>\n<td>12 \u53ca\u4ee5\u4e0a<\/td>\n<td>AppSearch \u6a21\u5757<\/td>\n<td>\u7aef\u4fa7\u5168\u6587\u68c0\u7d22\u4e0e\u7d22\u5f15<\/td>\n<\/tr>\n<tr>\n<td>Content Capture<\/td>\n<td>10 \u53ca\u4ee5\u4e0a<\/td>\n<td>\u5426\uff08\u6846\u67b6\u5185\u7f6e\uff09<\/td>\n<td>\u4e3a\u667a\u80fd\u670d\u52a1\u5b9e\u65f6\u6355\u83b7 UI \u7ed3\u6784<\/td>\n<\/tr>\n<tr>\n<td>TextClassifier<\/td>\n<td>8.0 \u53ca\u4ee5\u4e0a<\/td>\n<td>\u5426\uff08\u6846\u67b6\u5185\u7f6e\uff09<\/td>\n<td>\u5b9e\u4f53\u8bc6\u522b\u3001\u8bed\u8a00\u68c0\u6d4b<\/td>\n<\/tr>\n<tr>\n<td>AppPrediction<\/td>\n<td>10 \u53ca\u4ee5\u4e0a<\/td>\n<td>\u5426\uff08\u6846\u67b6\u5185\u7f6e\uff09<\/td>\n<td>\u57fa\u4e8e\u4f7f\u7528\u884c\u4e3a\u7684\u5e94\u7528\u6392\u5e8f<\/td>\n<\/tr>\n<tr>\n<td>OnDevicePersonalization<\/td>\n<td>14 \u53ca\u4ee5\u4e0a<\/td>\n<td>ODP \u6a21\u5757<\/td>\n<td>\u8054\u90a6\u8ba1\u7b97\u3001\u9694\u79bb\u8bad\u7ec3<\/td>\n<\/tr>\n<tr>\n<td>AdServices<\/td>\n<td>13 \u53ca\u4ee5\u4e0a<\/td>\n<td>AdServices \u6a21\u5757<\/td>\n<td>\u9690\u79c1\u4fdd\u62a4\u5e7f\u544a\u5b9a\u5411\uff08Topics\u3001FLEDGE\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>51.1.2 \u8de8\u5b50\u7cfb\u7edf\u901a\u7528\u8bbe\u8ba1\u601d\u8def<\/h4>\n<p>\u6240\u6709 AI \u5b50\u7cfb\u7edf\u90fd\u590d\u7528\u82e5\u5e72\u67b6\u6784\u8bbe\u8ba1\u8303\u5f0f\uff1a<\/p>\n<p>\u8fdb\u7a0b\u9694\u79bb \u667a\u80fd\u670d\u52a1\u8fd0\u884c\u5728\u9694\u79bb\u6216\u6c99\u7bb1\u8fdb\u7a0b\u3002OnDeviceSandboxedInferenceService\u8bbe\u7f6eandroid:isolatedProcess=\\&#8221;true\\&#8221;\u3002IsolatedTrainingService\u5728\u72ec\u7acb\u8fdb\u7a0b\u52a0\u8f7d TFLite\u3002\u5373\u4f7f ComputerControlSession \u4e5f\u57fa\u4e8e\u4e0e\u4e3b\u663e\u793a\u5668\u9694\u79bb\u7684\u865a\u62df\u663e\u793a\u5668\u5de5\u4f5c\u3002<\/p>\n<p>\u4f18\u5148\u4f7f\u7528\u5f3a\u7c7b\u578b\u5951\u7ea6\uff0c\u800c\u975e\u65e0\u7ea6\u675f Bundle AppFunctions \u4f7f\u7528 AppSearch \u63d0\u4f9b\u7684GenericDocument\u4f5c\u4e3a\u53c2\u6570\u5e8f\u5217\u5316\u683c\u5f0f\u3002ODI \u4f7f\u7528PersistableBundle\u627f\u8f7d\u7279\u6027\u4e0e\u8bf7\u6c42\u5143\u6570\u636e\u3002\u4e8c\u8005\u5747\u9f13\u52b1 SDK \u5c42\u5c01\u88c5\u5f3a\u7c7b\u578b\u5305\u88c5\u7c7b\u3002<\/p>\n<p>AppSearch \u4f5c\u4e3a\u901a\u7528\u5143\u6570\u636e\u5b58\u50a8 AppFunction \u5143\u6570\u636e\u3001\u5e94\u7528\u9884\u6d4b\u6570\u636e\u3001\u5185\u5bb9\u6355\u83b7\u667a\u80fd\u6570\u636e\uff0c\u5168\u90e8\u6c47\u805a\u5230 AppSearch \u5b8c\u6210\u7d22\u5f15\u4e0e\u68c0\u7d22\u3002<\/p>\n<p>\u6743\u9650\u7ba1\u63a7 + \u767d\u540d\u5355\u673a\u5236 AppFunctions \u6267\u884c\u53d7EXECUTE_APP_FUNCTIONS\uff08\u6216EXECUTE_APP_FUNCTIONS_SYSTEM\uff09\u6743\u9650\u7ea6\u675f\uff0c\u540c\u65f6\u914d\u5408\u5e73\u53f0AllowlistManager\u7ef4\u62a4\u7b7e\u540d\u4ee3\u7406\u767d\u540d\u5355\u3002Computer Control \u9700\u8981ACCESS_COMPUTER_CONTROL\u6743\u9650\u3002ODI \u9700\u8981USE_ON_DEVICE_INTELLIGENCE\u3002AdServices \u9700\u8981ACCESS_ADSERVICES_TOPICS\u3002<\/p>\n<p>\u652f\u6301\u53d6\u6d88\u4fe1\u53f7\u4f20\u9012 \u51e0\u4e4e\u5168\u90e8\u5f02\u6b65 API \u90fd\u4f1a\u8de8 Binder \u4f20\u9012ICancellationSignal\uff0c\u8c03\u7528\u65b9\u53ef\u7ec8\u6b62\u957f\u65f6\u95f4\u63a8\u7406\u6216\u51fd\u6570\u6267\u884c\u3002<\/p>\n<h3>51.2 AppFunctions \u6846\u67b6<\/h3>\n<p>AppFunctions \u6846\u67b6\u5728 Android 16 \u4ee5 Beta \u7279\u6027\u9762\u4e16\uff0cAndroid 17 \u6b63\u5f0f\u5e7f\u6cdb\u53ef\u7528\u3002\u5b83\u63d0\u4f9b\u4e00\u5957\u6807\u51c6\u5316\u673a\u5236\uff0c\u8ba9 AI \u52a9\u624b\uff08\u4ee3\u7406\uff09\u53ef\u4ee5\u53d1\u73b0\u5e76\u8c03\u7528\u4efb\u610f\u76ee\u6807\u5e94\u7528\u66b4\u9732\u7684\u529f\u80fd\u3002\u4f8b\u5982\u52a9\u624b\u6536\u5230\u6307\u4ee4 \u201c\u628a XYZ \u4fdd\u5b58\u5230\u6211\u7684\u7b14\u8bb0\u201d\uff0c\u6846\u67b6\u4f1a\u5c06\u8bf7\u6c42\u8def\u7531\u81f3\u5bf9\u5e94\u7684AppFunctionService\u5b9e\u73b0\uff0c\u52a9\u624b\u65e0\u9700\u5728\u7f16\u8bd1\u671f\u4f9d\u8d56\u7b14\u8bb0\u5e94\u7528\u3002<\/p>\n<p>Android 17 \u5bf9\u8be5\u6846\u67b6\u505a\u4e86\u5927\u5e45\u589e\u5f3a\uff0c\u4e0d\u518d\u5c40\u9650\u4e8e\u6700\u521d\u4ec5\u901a\u8fc7 Manifest \u9759\u6001\u58f0\u660e\u7684\u6a21\u5f0f\u3002\u672c\u7ae0\u540e\u7eed\u4f1a\u8be6\u7ec6\u4ecb\u7ecd\u4ee5\u4e0b\u6838\u5fc3\u65b0\u589e\u80fd\u529b\uff1a<\/p>\n<li>\u8fd0\u884c\u65f6\uff08\u52a8\u6001\uff09\u51fd\u6570\u6ce8\u518c\uff1a\u5e94\u7528\u53ef\u5728 Activity \u6216 Service \u4e2d\u8fd0\u884c\u65f6\u6ce8\u518c AppFunction \u56de\u8c03\uff0c\u4e0d\u518d\u5fc5\u987b\u58f0\u660e\u72ec\u7acbAppFunctionService\u7ec4\u4ef6\uff08registerAppFunction\uff0c\u53d7FLAG_ENABLE_DYNAMIC_APP_FUNCTIONS\u6807\u8bb0\u63a7\u5236\uff09\u3002<\/li>\n<li>\u5b8c\u5907\u7684\u53d1\u73b0\u3001\u72b6\u6001\u4e0e\u89c2\u6d4b API\uff0c\u65b0\u589e\u81f3AppFunctionManager\uff1asearchAppFunctions\u3001getAppFunctionStates\u3001getAppFunctionActivityStates\u3001observeAppFunctions\u3002<\/li>\n<li>\u8bbf\u95ee\u7ba1\u7406\u6846\u67b6\uff1a\u7ef4\u62a4\uff08\u4ee3\u7406\uff0c\u76ee\u6807\u5e94\u7528\uff09\u4e8c\u5143\u7ec4\u8bbf\u95ee\u72b6\u6001\u4e0e\u6807\u5fd7\u4f4d\uff1b\u63d0\u4f9b\u9762\u5411\u7528\u6237\u7684\u7ba1\u7406 UI\uff1b\u4ee3\u7406\u767d\u540d\u5355\u4ea4\u7531\u5e73\u53f0AllowlistManager\u7ef4\u62a4\uff0c\u4e0d\u518d\u4f7f\u7528 DeviceConfig \u5b57\u7b26\u4e32\u3002<\/li>\n<li>\u65b0\u589e\u6743\u9650\uff1aDISCOVER_APP_FUNCTIONS\uff08\u4ec5\u53d1\u73b0\uff0c\u4e0d\u53ef\u6267\u884c\uff09\u3001EXECUTE_APP_FUNCTIONS_SYSTEM\uff08\u7279\u6743\u7cfb\u7edf\u4ee3\u7406\uff0c\u7ed5\u8fc7\u767d\u540d\u5355\u6821\u9a8c\uff09\uff0c\u4fdd\u7559\u539f\u6709EXECUTE_APP_FUNCTIONS\u3002<\/li>\n<p>Android 17 \u6e90\u7801\u76ee\u5f55\u6982\u89c8\uff1a<\/p>\n<p>frameworks\/base\/core\/java\/android\/app\/appfunctions\/<br \/>\n    AppFunctionManager.java              &#8212; \u5ba2\u6237\u7aef\u7cfb\u7edf\u670d\u52a1\u5165\u53e3<br \/>\n    AppFunctionService.java              &#8212; \u9759\u6001\u76ee\u6807\u5e94\u7528\u62bd\u8c61\u57fa\u7c7b<br \/>\n    AppFunction.java                     &#8212; \u8fd0\u884c\u65f6\u51fd\u6570\u56de\u8c03\u63a5\u53e3<br \/>\n    RegisterAppFunctionRequest.java      &#8212; \u8fd0\u884c\u65f6\u6ce8\u518c\u8bf7\u6c42Parcelable<br \/>\n    ExecuteAppFunctionRequest.java       &#8212; \u6267\u884c\u8bf7\u6c42Parcelable<br \/>\n    ExecuteAppFunctionResponse.java      &#8212; \u6267\u884c\u54cd\u5e94Parcelable<br \/>\n    AppFunctionException.java            &#8212; \u5206\u5c42\u5f02\u5e38\u9519\u8bef\u4f53\u7cfb<br \/>\n    AppFunctionMetadata.java             &#8212; \u9759\u6001+\u8fd0\u884c\u65f6\u51fd\u6570\u5143\u6570\u636e<br \/>\n    AppFunctionName.java                 &#8212; (\u5305\u540d,\u6807\u8bc6\u7b26)\u51fd\u6570\u552f\u4e00\u6807\u8bc6<br \/>\n    AppFunctionState.java                &#8212; \u8fd0\u884c\u65f6\u542f\u7528\/\u53ef\u89c1\u72b6\u6001<br \/>\n    AppFunctionActivityId.java           &#8212; Activity\u4f5c\u7528\u57df\u51fd\u6570\u952e\u503c<br \/>\n    AppFunctionSearchSpec.java           &#8212; \u68c0\u7d22\u67e5\u8be2\u6761\u4ef6<br \/>\n    AppFunctionObserver.java             &#8212; \u53d8\u66f4\u89c2\u6d4b\u56de\u8c03<br \/>\n    AppFunctionAccessServiceInterface.java &#8212; \u8bbf\u95ee\u6821\u9a8c\u672c\u5730\u670d\u52a1<br \/>\n    IAppFunctionManager.aidl             &#8212; system_server AIDL\u63a5\u53e3<br \/>\n    IAppFunctionService.aidl             &#8212; \u9759\u6001\u76ee\u6807\u5e94\u7528AIDL\uff08oneway\uff09<br \/>\n    IAppFunctionExecutor.aidl            &#8212; \u52a8\u6001\u6ce8\u518c\u6267\u884c\u5668AIDL<br \/>\n    IExecuteAppFunctionCallback.aidl     &#8212; \u5f02\u6b65\u7ed3\u679c\u56de\u8c03AIDL<br \/>\n    ICancellationCallback.aidl           &#8212; \u53d6\u6d88\u4fe1\u53f7\u4f20\u8f93AIDL<br \/>\n    &#8230;<br \/>\nframeworks\/base\/services\/appfunctions\/<br \/>\n    java\/com\/android\/server\/appfunctions\/<br \/>\n        AppFunctionManagerService.java                &#8212; SystemService\u5c01\u88c5<br \/>\n        AppFunctionManagerServiceImpl.java            &#8212; IAppFunctionManager.Stub\u5b9e\u73b0<br \/>\n        RemoteServiceCallerImpl.java                  &#8212; Service\u7ed1\u5b9a\u903b\u8f91<br \/>\n        CallerValidatorImpl.java                      &#8212; \u6743\u9650+\u767d\u540d\u5355\u6821\u9a8c<br \/>\n        MetadataSyncAdapter.java                      &#8212; AppSearch\u5143\u6570\u636e\u540c\u6b65<br \/>\n        AppFunctionsLoggerWrapper.java                &#8212; statsd\u57cb\u70b9\u65e5\u5fd7<br \/>\n        allowlist\/SystemAppFunctionAllowlistReader.java  &#8212; AllowlistManager\u767d\u540d\u5355\u8bfb\u53d6<br \/>\n        dynamic\/MultiUserDynamicAppFunctionRegistry.java &#8212; \u8fd0\u884c\u65f6\u6ce8\u518c\u7ba1\u7406<br \/>\n        reader\/AppFunctionMetadataReader.java         &#8212; \u9759\u6001\/\u52a8\u6001\u5143\u6570\u636e\u8bfb\u53d6<br \/>\n        observer\/AppFunctionMetadataObserver.java     &#8212; AppSearch\u53d8\u66f4\u89c2\u6d4b\u5668<br \/>\n        &#8230;<br \/>\nframeworks\/base\/services\/permission\/java\/com\/android\/server\/permission\/access\/appfunction\/<br \/>\n    AppFunctionAccessService.kt                       &#8212; \u6301\u4e45\u5316(\u4ee3\u7406,\u76ee\u6807)\u8bbf\u95ee\u72b6\u6001<\/p>\n<h4>51.2.1 \u67b6\u6784\u6982\u89c8<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"637\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260903010136-6a98c6f005acb.png\" width=\"1833\"><\/p>\n<h4>51.2.2 \u5ba2\u6237\u7aef\uff1aAppFunctionManager<\/h4>\n<p>AppFunctionManager\u4ee5\u7cfb\u7edf\u670d\u52a1\u6ce8\u518c\uff0c\u670d\u52a1\u540d\u79f0Context.APP_FUNCTION_SERVICE\u3002<\/p>\n<p>@FlaggedApi(FLAG_ENABLE_APP_FUNCTION_MANAGER)<br \/>\n@SystemService(Context.APP_FUNCTION_SERVICE)<br \/>\npublic final class AppFunctionManager {<\/p>\n<p>\u6838\u5fc3 API \u4e3aexecuteAppFunction()\uff0c\u63a5\u6536\u56db\u4e2a\u5165\u53c2\u3002Android17 \u8981\u6c42\u8c03\u7528\u65b9\u5177\u5907\u4e24\u9879\u6267\u884c\u6743\u9650\u4e4b\u4e00\uff1b\u5e94\u7528\u8c03\u7528\u81ea\u8eab\u66b4\u9732\u7684\u51fd\u6570\u65e0\u9700\u6743\u9650\u3002<\/p>\n<p>@FlaggedApi(FLAG_ENABLE_APP_FUNCTION_PERMISSION_V2)<br \/>\n@RequiresPermission(<br \/>\n        anyOf = {<br \/>\n            Manifest.permission.EXECUTE_APP_FUNCTIONS,<br \/>\n            Manifest.permission.EXECUTE_APP_FUNCTIONS_SYSTEM<br \/>\n        },<br \/>\n        conditional = true)<br \/>\n@UserHandleAware<br \/>\npublic void executeAppFunction(<br \/>\n        @NonNull ExecuteAppFunctionRequest request,<br \/>\n        @NonNull @CallbackExecutor Executor executor,<br \/>\n        @NonNull CancellationSignal cancellationSignal,<br \/>\n        @NonNull OutcomeReceiver&lt;ExecuteAppFunctionResponse, AppFunctionException&gt; callback) {<\/p>\n<p>\u5185\u90e8\u5b9e\u73b0\u4f1a\u5c06\u4e0a\u5c42\u8bf7\u6c42\u5c01\u88c5\u4e3aExecuteAppFunctionAidlRequest\uff0c\u8865\u5145\u8c03\u7528\u8005\u8eab\u4efd\u3001\u65f6\u95f4\u6233\u4fe1\u606f\u3002<\/p>\n<p>ExecuteAppFunctionAidlRequest aidlRequest =<br \/>\n        new ExecuteAppFunctionAidlRequest(<br \/>\n                request,<br \/>\n                mContext.getUser(),<br \/>\n                mContext.getPackageName(),<br \/>\n                \/* requestTime= *\/ SystemClock.elapsedRealtime(),<br \/>\n                \/* requestWallTime= *\/ System.currentTimeMillis());<\/p>\n<p>Binder \u8c03\u7528\u8fd4\u56deICancellationSignal\u4f20\u8f93\u5bf9\u8c61\uff0c\u7ed1\u5b9a\u81f3\u5ba2\u6237\u7aefCancellationSignal\uff0c\u5b9e\u73b0\u8de8\u8fdb\u7a0b\u53d6\u6d88\u3002<\/p>\n<p>ICancellationSignal cancellationTransport =<br \/>\n        mService.executeAppFunction(<br \/>\n                aidlRequest,<br \/>\n                new IExecuteAppFunctionCallback.Stub() {<br \/>\n                    @Override<br \/>\n                    public void onSuccess(ExecuteAppFunctionResponse result) {<br \/>\n                        executor.execute(() -&gt; callback.onResult(result));<br \/>\n                    }<br \/>\n                    @Override<br \/>\n                    public void onError(AppFunctionException exception) {<br \/>\n                        executor.execute(() -&gt; callback.onError(exception));<br \/>\n                    }<br \/>\n                });<br \/>\nif (cancellationTransport != null) {<br \/>\n    cancellationSignal.setRemote(cancellationTransport);<br \/>\n}<\/p>\n<h4>51.2.3 \u542f\u7528\u72b6\u6001\u7ba1\u7406<\/h4>\n<p>\u6bcf\u4e2a AppFunction \u5177\u5907\u4e09\u6001\u751f\u547d\u5468\u671f\uff1a<\/p>\n<table>\n<tr>\n   \u5e38\u91cf<br \/>\n   \u6570\u503c<br \/>\n   \u542b\u4e49<br \/>\n  <\/tr>\n<tbody>\n<tr>\n<td>APP_FUNCTION_STATE_DEFAULT<\/td>\n<td>0<\/td>\n<td>\u6062\u590d\u9ed8\u8ba4\u72b6\u6001\uff08\u901a\u5e38\u4e3a\u542f\u7528\uff09<\/td>\n<\/tr>\n<tr>\n<td>APP_FUNCTION_STATE_ENABLED<\/td>\n<td>1<\/td>\n<td>\u663e\u5f0f\u542f\u7528<\/td>\n<\/tr>\n<tr>\n<td>APP_FUNCTION_STATE_DISABLED<\/td>\n<td>2<\/td>\n<td>\u663e\u5f0f\u7981\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5e94\u7528\u901a\u8fc7setAppFunctionEnabled()\u63a7\u5236\u81ea\u8eab\u51fd\u6570\u72b6\u6001\u3002<\/p>\n<p>@UserHandleAware<br \/>\npublic void setAppFunctionEnabled(<br \/>\n        @NonNull String functionIdentifier,<br \/>\n        @EnabledState int newEnabledState,<br \/>\n        @NonNull Executor executor,<br \/>\n        @NonNull OutcomeReceiver&lt;Void, Exception&gt; callback) {<\/p>\n<p>\u542f\u7528\u72b6\u6001\u4ee5AppFunctionRuntimeMetadata\u6587\u6863\u6301\u4e45\u5316\u5728 AppSearch\uff0c\u4e0e\u63cf\u8ff0\u51fd\u6570 Schema \u7684AppFunctionStaticMetadata\u76f8\u4e92\u72ec\u7acb\u3002<\/p>\n<p>setAppFunctionEnabled()\u4ec5\u5bf9\u9759\u6001AppFunctionService\u5bf9\u5e94\u7684\u51fd\u6570\u751f\u6548\u3002\u901a\u8fc7registerAppFunction\u6ce8\u518c\u7684\u8fd0\u884c\u65f6\u51fd\u6570\uff0c\u751f\u547d\u5468\u671f\u4e0e\u6ce8\u518c\u4f1a\u8bdd\u7ed1\u5b9a\uff0c\u542f\u7528\u72b6\u6001\u7531registerAppFunction\/AppFunctionRegistration.unregister\u63a7\u5236\uff1b\u5bf9\u52a8\u6001\u51fd\u6570\u8c03\u7528\u672c\u65b9\u6cd5\u4f1a\u629b\u51faIllegalArgumentException\u3002<\/p>\n<p>Android17 \u5b8c\u6574\u5bf9\u5916\u66b4\u9732\u8fd0\u884c\u65f6\u72b6\u6001\uff0c\u4e0d\u4ec5\u4ec5\u662f\u542f\u7528\u4f4d\u3002AppFunctionState Parcelable \u5305\u542bAppFunctionName\u3001\u542f\u7528\u6807\u8bb0\u3001\u53ef\u89c1\u6027\uff1b\u53ef\u901a\u8fc7AppFunctionManager.getAppFunctionStates(&#8230;)\u6279\u91cf\u8bfb\u53d6\u3002<\/p>\n<h4>51.2.4 \u8bbf\u95ee\u63a7\u5236\u6a21\u578b<\/h4>\n<p>AppFunctions \u8bbf\u95ee\u6a21\u578b\u5206\u4e3a\u4e09\u5c42\u6821\u9a8c\uff1a<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1131\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260903010136-6a98c6f06e32c.png\" width=\"642\"><\/p>\n<p>\u8bbf\u95ee\u6807\u5fd7\u4f4d\u662f\u4ee5\uff08\u4ee3\u7406\uff0c\u76ee\u6807\u5e94\u7528\uff09\u4e3a\u5355\u4f4d\u5b58\u50a8\u7684\u4f4d\u63a9\u7801\uff0c\u5e38\u91cf\u5b9a\u4e49\u5728AppFunctionManager\u3002<\/p>\n<table>\n<tr>\n   \u6807\u5fd7\u4f4d<br \/>\n   \u6570\u503c<br \/>\n   \u542b\u4e49<br \/>\n  <\/tr>\n<tbody>\n<tr>\n<td>ACCESS_FLAG_PREGRANTED<\/td>\n<td>1<\/td>\n<td>\u7cfb\u7edf\u9884\u6388\u6743\u8bbf\u95ee<\/td>\n<\/tr>\n<tr>\n<td>ACCESS_FLAG_UPGRADE_GRANTED<\/td>\n<td>1 &lt;&lt; 1<\/td>\n<td>\u7cfb\u7edf\u7248\u672c\u5347\u7ea7\u65f6\u6388\u4e88<\/td>\n<\/tr>\n<tr>\n<td>ACCESS_FLAG_USER_GRANTED<\/td>\n<td>1 &lt;&lt; 2<\/td>\n<td>\u7528\u6237\u901a\u8fc7 UI \u663e\u5f0f\u6388\u6743<\/td>\n<\/tr>\n<tr>\n<td>ACCESS_FLAG_USER_DENIED<\/td>\n<td>1 &lt;&lt; 3<\/td>\n<td>\u7528\u6237\u901a\u8fc7 UI \u663e\u5f0f\u62d2\u7edd\uff08\u4f18\u5148\u7ea7\u9ad8\u4e8e PREGRANTED\uff09<\/td>\n<\/tr>\n<tr>\n<td>ACCESS_FLAG_OTHER_GRANTED<\/td>\n<td>1 &lt;&lt; 4<\/td>\n<td>ADB \u6216\u5176\u4ed6\u65b9\u5f0f\u6388\u6743<\/td>\n<\/tr>\n<tr>\n<td>ACCESS_FLAG_OTHER_DENIED<\/td>\n<td>1 &lt;&lt; 5<\/td>\n<td>ADB \u6216\u4e3b\u52a8\u64a4\u9500\u62d2\u7edd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Android17 \u4ee3\u7406\u767d\u540d\u5355\u4e0d\u518d\u4f7f\u7528 DeviceConfig \u5b57\u7b26\u4e32\uff0c\u6539\u4e3a\u5e73\u53f0AllowlistManager\u3002\u5b83\u4ee5SignedPackage\uff08\u5305\u540d + \u8bc1\u4e66\u6458\u8981\uff09\u4e3a Key\uff0c\u8bb0\u5f55\u8be5\u4ee3\u7406\u5141\u8bb8\u8bbf\u95ee\u7684\u76ee\u6807\u5305\u96c6\u5408\uff0c\u652f\u6301\u901a\u914d\u7b26\u4ee3\u8868\u5168\u90e8\u76ee\u6807\u5305\u3002AppFunctions \u670d\u52a1\u901a\u8fc7SystemAppFunctionAllowlistReader\u8bfb\u53d6\uff0c\u5185\u90e8\u4f7f\u7528 LruCache \u6309\u4ee3\u7406\u7f13\u5b58\u7ed3\u679c\u3002<\/p>\n<p>public class SystemAppFunctionAllowlistReader implements AppFunctionAllowlistReader {<br \/>\n    private final LruCache&lt;SignedPackage, ArraySet&lt;String&gt;&gt; mCache;<br \/>\n    private final AllowlistManager mAllowlistManager;<\/p>\n<p>    @Override<br \/>\n    public CompletableFuture&lt;Boolean&gt; isAllowlisted(<br \/>\n            String agentPackage, String targetPackageName, int userId) { &#8230; }<br \/>\n}<\/p>\n<p>CallerValidatorImpl\u6267\u884c\u524d\u540c\u65f6\u6821\u9a8c\u8fd0\u884c\u65f6\u6743\u9650\u4e0e\u767d\u540d\u5355\u3002\u6301\u6709EXECUTE_APP_FUNCTIONS_SYSTEM\u7684\u7279\u6743\u7cfb\u7edf\u4ee3\u7406\u4f1a\u8df3\u8fc7\u767d\u540d\u5355\uff1b\u4ec5\u6301\u6709EXECUTE_APP_FUNCTIONS\u7684\u4ee3\u7406\u5fc5\u987b\u51fa\u73b0\u5728\u76ee\u6807\u5e94\u7528\u5bf9\u5e94\u7684\u767d\u540d\u5355\u5185\u3002<\/p>\n<h4>51.2.5 AIDL \u63a5\u53e3\u5b9a\u4e49<\/h4>\n<p>\u6846\u67b6\u5b9a\u4e49\u4e24\u7ec4 AIDL \u63a5\u53e3\uff1a\u4e00\u7ec4\u9762\u5411\u5ba2\u6237\u7aef\uff0c\u4e00\u7ec4\u9762\u5411\u76ee\u6807\u5e94\u7528\u3002<\/p>\n<p>IAppFunctionManager\uff08\u5ba2\u6237\u7aef \u2192 system_server\uff09 Android17 \u63a5\u53e3\u5927\u5e45\u6269\u5145\uff0c\u589e\u52a0\u53d1\u73b0\u3001\u89c2\u6d4b\u3001\u8fd0\u884c\u65f6\u6ce8\u518c\u3001\u8bbf\u95ee\u7ba1\u7406\u76f8\u5173\u63a5\u53e3\u3002<\/p>\n<p>interface IAppFunctionManager {<br \/>\n    ICancellationSignal executeAppFunction(<br \/>\n        in ExecuteAppFunctionAidlRequest request,<br \/>\n        in IExecuteAppFunctionCallback callback);<\/p>\n<p>    \/\/ \u53d1\u73b0\u4e0e\u89c2\u6d4b<br \/>\n    void observeAppFunctions(<br \/>\n        in AppFunctionAidlSearchSpec aidlSearchSpec,<br \/>\n        in IObserveAppFunctionChangesCallback callback);<br \/>\n    void unregisterAppFunctionObserver(<br \/>\n        in String callingPackage, in UserHandle userHandle,<br \/>\n        in IObserveAppFunctionChangesCallback callback);<br \/>\n    void getAppFunctionStates(<br \/>\n        in List&lt;AppFunctionName&gt; appFunctionNames,<br \/>\n        in String callingPackageName, int targetUserId,<br \/>\n        in IGetAppFunctionStatesCallback callback);<br \/>\n    void getAppFunctionActivityStates(<br \/>\n        in List&lt;AppFunctionActivityId&gt; activityIds,<br \/>\n        in String callingPackageName, int targetUserId,<br \/>\n        in IGetAppFunctionActivityStatesCallback callback);<\/p>\n<p>    \/\/ \u542f\u7528\u72b6\u6001\u751f\u547d\u5468\u671f<br \/>\n    void isAppFunctionEnabled(<br \/>\n        in String callingPackage, in String targetPackage,<br \/>\n        in String functionIdentifier, in UserHandle userHandle,<br \/>\n        in IIsAppFunctionEnabledCallback callback);<br \/>\n    void setAppFunctionEnabled(<br \/>\n        in String callingPackage, in String functionIdentifier,<br \/>\n        in UserHandle userHandle, int enabledState,<br \/>\n        in ISetAppFunctionEnabledCallback callback);<\/p>\n<p>    \/\/ \u8fd0\u884c\u65f6\u52a8\u6001\u6ce8\u518c<br \/>\n    void registerAppFunctions(in String packageName, in List&lt;String&gt; functionIds,<br \/>\n        in IAppFunctionExecutor executor, in IBinder activityToken);<br \/>\n    void unregisterAppFunctions(in String packageName, in List&lt;String&gt; functionIds,<br \/>\n        in IAppFunctionExecutor executor);<\/p>\n<p>    \/\/ \u8bbf\u95ee\u7ba1\u7406<br \/>\n    int getAccessRequestState(in String agentPackageName, int agentUserId,<br \/>\n        in String targetPackageName, int targetUserId);<br \/>\n    int getAccessFlags(in String agentPackageName, int agentUserId,<br \/>\n        in String targetPackageName, int targetUserId);<br \/>\n    boolean updateAccessFlags(in String agentPackageName, int agentUserId,<br \/>\n        in String targetPackageName, int targetUserId, int flagMask, int flags);<br \/>\n    void revokeSelfAccess(in String targetPackageName);<br \/>\n    List&lt;String&gt; getValidAgents(int userId);<br \/>\n    List&lt;String&gt; getValidTargets(int targetUserId);<br \/>\n    Intent createRequestAccessIntent(in String targetPackageName);<br \/>\n    void addOnAccessChangedListener(IOnAppFunctionAccessChangeListener listener, int userId);<br \/>\n    void removeOnAccessChangedListener(IOnAppFunctionAccessChangeListener listener, int userId);<br \/>\n}<\/p>\n<p>\u6ce8\u610f\u533a\u5206\u67e5\u8be2\u56de\u8c03IIsAppFunctionEnabledCallback\u548c\u4fee\u6539\u56de\u8c03ISetAppFunctionEnabledCallback\u3002\u8fd0\u884c\u65f6\u6ce8\u518c\u4f20\u9012IAppFunctionExecutor\uff0c\u7531\u7cfb\u7edf\u76f4\u63a5\u8c03\u7528\uff0c\u4e0d\u518d\u7ed1\u5b9a\u72ec\u7acb\u7ec4\u4ef6\u3002<\/p>\n<p>IAppFunctionService\uff08system_server \u2192 \u76ee\u6807\u5e94\u7528\uff0coneway\uff09<\/p>\n<p>oneway interface IAppFunctionService {<br \/>\n    void executeAppFunction(<br \/>\n        in ExecuteAppFunctionRequest request,<br \/>\n        in String callingPackage,<br \/>\n        in android.content.pm.SigningInfo callingPackageSigningInfo,<br \/>\n        in ICancellationCallback cancellationCallback,<br \/>\n        in IExecuteAppFunctionCallback callback);<br \/>\n}<\/p>\n<p>oneway\u4fee\u9970\u81f3\u5173\u91cd\u8981\uff1asystem_server \u4e0d\u4f1a\u963b\u585e\u7b49\u5f85\u76ee\u6807\u5e94\u7528\u6267\u884c\u5b8c\u6210\uff0c\u7ed3\u679c\u5168\u90e8\u7ecf\u7531IExecuteAppFunctionCallback\u56de\u8c03\u8fd4\u56de\u3002<\/p>\n<h4>51.2.6 \u76ee\u6807\u7aef\uff1aAppFunctionService<\/h4>\n<p>\u76ee\u6807\u5e94\u7528\u7ee7\u627fAppFunctionService\uff0c\u5b9e\u73b0\u552f\u4e00\u62bd\u8c61\u65b9\u6cd5\uff1a<\/p>\n<p>@MainThread<br \/>\npublic abstract void onExecuteFunction(<br \/>\n        @NonNull ExecuteAppFunctionRequest request,<br \/>\n        @NonNull String callingPackage,<br \/>\n        @NonNull SigningInfo callingPackageSigningInfo,<br \/>\n        @NonNull CancellationSignal cancellationSignal,<br \/>\n        @NonNull OutcomeReceiver&lt;ExecuteAppFunctionResponse, AppFunctionException&gt; callback);<\/p>\n<p>\u670d\u52a1\u5185\u90e8\u505a\u8c03\u7528\u8005\u6821\u9a8c\uff1a\u4ec5\u62e5\u6709BIND_APP_FUNCTION_SERVICE\u6743\u9650\u7684 system_server \u53ef\u4ee5\u8c03\u7528\u3002<\/p>\n<p>if (context.checkCallingPermission(BIND_APP_FUNCTION_SERVICE)<br \/>\n        == PERMISSION_DENIED) {<br \/>\n    throw new SecurityException(\\&#8221;Can only be called by the system server.\\&#8221;);<br \/>\n}<\/p>\n<p>Manifest \u58f0\u660e\u793a\u4f8b\uff0c\u5fc5\u987b\u6307\u5b9a\u7ed1\u5b9a\u6743\u9650\uff1a<\/p>\n<p>&lt;service android:name=\\&#8221;.YourService\\&#8221;<br \/>\n       android:permission=\\&#8221;android.permission.BIND_APP_FUNCTION_SERVICE\\&#8221;&gt;<br \/>\n    &lt;intent-filter&gt;<br \/>\n      &lt;action android:name=\\&#8221;android.app.appfunctions.AppFunctionService\\&#8221; \/&gt;<br \/>\n    &lt;\/intent-filter&gt;<br \/>\n&lt;\/service&gt;<\/p>\n<h4>51.2.7 \u8bf7\u6c42\u4e0e\u54cd\u5e94\u5e8f\u5217\u5316\u683c\u5f0f<\/h4>\n<p>ExecuteAppFunctionRequest\u4e0eExecuteAppFunctionResponse\u5747\u4f7f\u7528 AppSearch \u7684GenericDocument\u4f5c\u4e3a\u53c2\u6570\u8f7d\u4f53\u3002\u8be5\u8bbe\u8ba1\u4f7f\u51fd\u6570\u53c2\u6570\u53ef\u4ee5\u7528 Schema \u63cf\u8ff0\uff0c\u800c AppSearch \u539f\u751f\u652f\u6301\u7d22\u5f15\u4e0e\u67e5\u8be2\u8be5 Schema\u3002<\/p>\n<p>\u8bf7\u6c42\u7ed3\u6784\u4f53\uff1a<\/p>\n<p>public final class ExecuteAppFunctionRequest implements Parcelable {<br \/>\n    @NonNull private final String mTargetPackageName;<br \/>\n    @NonNull private final String mFunctionIdentifier;<br \/>\n    @NonNull private final Bundle mExtras;<br \/>\n    @NonNull private final GenericDocumentWrapper mParameters;<br \/>\n    @Nullable private final AppInteractionAttribution mAttribution;<\/p>\n<p>\u54cd\u5e94\u7ed3\u6784\u4f53\uff1a<\/p>\n<p>public final class ExecuteAppFunctionResponse implements Parcelable {<br \/>\n    public static final String PROPERTY_RETURN_VALUE = \\&#8221;androidAppfunctionsReturnValue\\&#8221;;<br \/>\n    @NonNull private final GenericDocumentWrapper mResultDocumentWrapper;<br \/>\n    @NonNull private final Bundle mExtras;<br \/>\n    @NonNull private final List&lt;AppFunctionUriGrant&gt; mUriGrants;<\/p>\n<p>\u8fd4\u56de\u503c\u5b58\u653e\u5728\u7ed3\u679cGenericDocument\u7684PROPERTY_RETURN_VALUE\u952e\u3002Jetpack AppFunction SDK \u63d0\u4f9b\u5f3a\u7c7b\u578b\u5c01\u88c5\uff0c\u8d1f\u8d23\u6253\u5305\u3001\u89e3\u6790\u8be5\u6587\u6863\u3002<\/p>\n<h4>51.2.8 \u5f52\u56e0\u4e0e\u4ea4\u4e92\u65e5\u5fd7<\/h4>\n<p>\u6bcf\u4e00\u6b21\u6267\u884c\u53ef\u4ee5\u643a\u5e26AppInteractionAttribution\uff0c\u63cf\u8ff0\u89e6\u53d1\u672c\u6b21\u8c03\u7528\u7684\u4ea4\u4e92\u6765\u6e90\u3002Android17 \u5c06\u8be5\u7c7b\u578b\u4ece appfunctions \u5305\u63d0\u5347\u81f3android.app\u5305\uff0c\u4f9b\u6574\u4e2a\u5e94\u7528\u4ea4\u4e92 API \u590d\u7528\uff0c\u5f00\u5173\u6807\u8bb0\u4e3aFLAG_ENABLE_APP_INTERACTION_API\u3002<\/p>\n<p>public static final int INTERACTION_TYPE_OTHER = 0;        \/\/ \u9700\u8981\u81ea\u5b9a\u4e49\u5b57\u7b26\u4e32<br \/>\npublic static final int INTERACTION_TYPE_USER_QUERY = 1;<br \/>\npublic static final int INTERACTION_TYPE_USER_SCHEDULED = 2;<\/p>\n<p>\u5f52\u56e0\u5305\u542b\u4ea4\u4e92\u7c7b\u578b\u3001\u53ef\u9009\u81ea\u5b9a\u4e49\u7c7b\u578b\u5b57\u7b26\u4e32\uff08\u7c7b\u578b\u4e3aINTERACTION_TYPE_OTHER\u65f6\u4f7f\u7528\uff09\u3001\u53ef\u9009\u4ea4\u4e92 Uri\uff0c\u6307\u5411\u539f\u59cb\u4e0a\u4e0b\u6587\u3002\u9690\u79c1 UI \u4f9d\u9760\u8be5\u4fe1\u606f\u5411\u7528\u6237\u89e3\u91ca\u51fd\u6570\u6267\u884c\u7f18\u7531\u3002<\/p>\n<p>Android17 \u4e0d\u4f1a\u6301\u4e45\u5316\u6bcf\u6b21\u8c03\u7528\u7684\u5386\u53f2\u6570\u636e\u5e93\uff0c\u800c\u662f\u628a\u6bcf\u4e00\u6b21\u6267\u884c\u5199\u5165\u5e73\u53f0 metrics \u6d41\u6c34\u7ebf statsd\u3002system_server \u4e2d\u7684AppFunctionsLoggerWrapper\u8fd0\u884c\u5728\u5171\u4eab\u540e\u53f0\u6267\u884c\u5668\uff0c\u4e3a\u6bcf\u4e00\u6b21\u6210\u529f\u6216\u5931\u8d25\u8f93\u51fa\u7ed3\u6784\u5316\u4e8b\u4ef6\uff0c\u5f52\u4e00\u5316\u5904\u7406\u5f52\u56e0\u5e38\u91cf\u5e76\u6807\u8bb0\u51fd\u6570\u7c7b\u578b\u3002<\/p>\n<p>static final int FUNCTION_TYPE_UNSPECIFIED = 0;<br \/>\nstatic final int FUNCTION_TYPE_STATIC = 1;          \/\/ AppFunctionService\u5b9e\u73b0<br \/>\nstatic final int FUNCTION_TYPE_DYNAMIC_GLOBAL = 2;  \/\/ registerAppFunction\uff08Service\/\u5168\u5c40\uff09<br \/>\nstatic final int FUNCTION_TYPE_DYNAMIC_ACTIVITY = 3;\/\/ registerAppFunction\uff08Activity\u4f5c\u7528\u57df\uff09<\/p>\n<p>void logAppFunctionSuccess(<br \/>\n        ExecuteAppFunctionAidlRequest request,<br \/>\n        ExecuteAppFunctionResponse response,<br \/>\n        int callingUid,<br \/>\n        long executionStartTimeMillis,<br \/>\n        @AppFunctionMetadata.AppFunctionType int appFunctionType) { &#8230; }<\/p>\n<p>\u65e5\u5fd7\u4e8b\u4ef6\u8bb0\u5f55\u8c03\u7528 UID\u3001\u76ee\u6807\u5305\u3001\u8bf7\u6c42\u4e2d\u63d0\u53d6\u7684\u4ea4\u4e92\u7c7b\u578b\u3001\u51fd\u6570\u7c7b\u578b\uff08\u9759\u6001 \/ \u52a8\u6001\u3001\u5168\u5c40 \/ Activity \u57df\uff09\u3001\u54cd\u5e94\u7801\uff0c\u4ee5\u53ca\u7ed1\u5b9a\u670d\u52a1\u5b8c\u6210\u4e4b\u540e\u7edf\u8ba1\u7684\u6267\u884c\u8017\u65f6\u3002<\/p>\n<h4>51.2.9 \u9519\u8bef\u5904\u7406<\/h4>\n<p>AppFunctionException\u5b9a\u4e49\u4e86\u5206\u7c7b\u9519\u8bef\u7801\u4f53\u7cfb\uff1a<\/p>\n<p>\/\/ \u8bf7\u6c42\u7c7b\u9519\u8bef 1000\u20111999<br \/>\npublic static final int ERROR_DENIED = 1000;<br \/>\npublic static final int ERROR_INVALID_ARGUMENT = 1001;<br \/>\npublic static final int ERROR_DISABLED = 1002;<br \/>\npublic static final int ERROR_FUNCTION_NOT_FOUND = 1003;<\/p>\n<p>\/\/ \u7cfb\u7edf\u7c7b\u9519\u8bef 2000\u20112999<br \/>\npublic static final int ERROR_SYSTEM_ERROR = 2000;<br \/>\npublic static final int ERROR_CANCELLED = 2001;<br \/>\npublic static final int ERROR_ENTERPRISE_POLICY_DISALLOWED = 2002;<\/p>\n<p>\/\/ \u5e94\u7528\u7c7b\u9519\u8bef 3000\u20113999<br \/>\npublic static final int ERROR_APP_UNKNOWN_ERROR = 3000;<\/p>\n<p>getErrorCategory()\u5c06\u9519\u8bef\u7801\u533a\u95f4\u6620\u5c04\u4e3a\u9519\u8bef\u5206\u7c7b\uff1a<\/p>\n<p>public int getErrorCategory() {<br \/>\n    if (mErrorCode &gt;= 1000 &amp;&amp; mErrorCode &lt; 2000) return ERROR_CATEGORY_REQUEST_ERROR;<br \/>\n    if (mErrorCode &gt;= 2000 &amp;&amp; mErrorCode &lt; 3000) return ERROR_CATEGORY_SYSTEM;<br \/>\n    if (mErrorCode &gt;= 3000 &amp;&amp; mErrorCode &lt; 4000) return ERROR_CATEGORY_APP;<br \/>\n    return ERROR_CATEGORY_UNKNOWN;<br \/>\n}<\/p>\n<h4>51.2.10 System Server \u5b9e\u73b0<\/h4>\n<p>\u8584\u7684SystemService\uff1aAppFunctionManagerService.java\uff0c\u8d1f\u8d23\u53d1\u5e03 Binder \u670d\u52a1\u5230Context.APP_FUNCTION_SERVICE\uff0c\u8f6c\u53d1\u7528\u6237\u751f\u547d\u5468\u671f\u3002\u4e1a\u52a1\u903b\u8f91\u4e3b\u4f53\u5728AppFunctionManagerServiceImpl\uff0c\u7ee7\u627fIAppFunctionManager.Stub\uff0c\u534f\u8c03\u5404\u4e2a\u534f\u4f5c\u7c7b\u3002<\/p>\n<p>public class AppFunctionManagerServiceImpl extends IAppFunctionManager.Stub {<br \/>\n    private final RemoteServiceCaller&lt;IAppFunctionService&gt; mRemoteServiceCaller;<br \/>\n    private final CallerValidator mCallerValidator;<br \/>\n    private final AppFunctionsLoggerWrapper mLoggerWrapper;<br \/>\n    private final IUriGrantsManager mUriGrantsManager;<br \/>\n    private final UriGrantsManagerInternal mUriGrantsManagerInternal;<br \/>\n    private final MultiUserDynamicAppFunctionRegistry mDynamicAppFunctionRegistry;<br \/>\n    private final AppFunctionMetadataReader mAppFunctionMetadataReader;<br \/>\n    private final AppFunctionMetadataObserver mAppFunctionMetadataObserver;<br \/>\n    private final VisibilityHelper mVisibilityHelper;<br \/>\n    private final ActivityTaskManagerInternal mActivityTaskManagerInternal;<br \/>\n    \/\/ \u8bbf\u95ee\u6821\u9a8c\u59d4\u6258\u7ed9\u6743\u9650\u5b50\u7cfb\u7edf<br \/>\n    private final AppFunctionAccessServiceInterface mAppFunctionAccessService;<br \/>\n    &#8230;<\/p>\n<p>\u5173\u952e\u652f\u6491\u7c7b\u8bf4\u660e\uff1a<\/p>\n<table>\n<tr>\n   \u7c7b\u540d<br \/>\n   \u804c\u8d23<br \/>\n  <\/tr>\n<tbody>\n<tr>\n<td>RemoteServiceCallerImpl<\/td>\n<td>\u7ed1\u5b9a\u76ee\u6807AppFunctionService\uff0c\u7ba1\u7406\u8fde\u63a5\u751f\u547d\u5468\u671f<\/td>\n<\/tr>\n<tr>\n<td>CallerValidatorImpl<\/td>\n<td>\u5f3a\u5236\u6821\u9a8cEXECUTE_APP_FUNCTIONS\/EXECUTE_APP_FUNCTIONS_SYSTEM\u6743\u9650\uff0c\u6821\u9a8c\u767d\u540d\u5355<\/td>\n<\/tr>\n<tr>\n<td>MetadataSyncAdapter<\/td>\n<td>\u5e94\u7528\u5305\u53d8\u66f4\u65f6\uff0c\u540c\u6b65\u9759\u6001\u51fd\u6570\u5143\u6570\u636e\u81f3 AppSearch<\/td>\n<\/tr>\n<tr>\n<td>AppFunctionPackageMonitor<\/td>\n<td>\u76d1\u542c\u5e94\u7528\u5b89\u88c5 \/ \u66f4\u65b0 \/ \u5378\u8f7d\u4e8b\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>MultiUserDynamicAppFunctionRegistry<\/td>\n<td>\u4fdd\u5b58\u6bcf\u4e2a\u7528\u6237\u4e0bregisterAppFunction\u8fd0\u884c\u65f6\u6ce8\u518c\u9879<\/td>\n<\/tr>\n<tr>\n<td>AppFunctionMetadataReader<\/td>\n<td>\u8bfb\u53d6\u9759\u6001\uff08AppSearch\uff09\u4e0e\u52a8\u6001\u5143\u6570\u636e\uff0c\u7528\u4e8e\u53d1\u73b0\u4e0e\u72b6\u6001\u67e5\u8be2<\/td>\n<\/tr>\n<tr>\n<td>AppFunctionMetadataObserver<\/td>\n<td>\u57fa\u4e8e AppSearch \u53d8\u66f4\u4e8b\u4ef6\u9a71\u52a8observeAppFunctions\u56de\u8c03<\/td>\n<\/tr>\n<tr>\n<td>SystemAppFunctionAllowlistReader<\/td>\n<td>\u901a\u8fc7AllowlistManager\u89e3\u6790\u7b7e\u540d\u4ee3\u7406\u767d\u540d\u5355<\/td>\n<\/tr>\n<tr>\n<td>AppFunctionsLoggerWrapper<\/td>\n<td>\u4e3a\u6bcf\u4e00\u6b21\u6267\u884c\u8f93\u51fa statsd \u57cb\u70b9\u4e8b\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>AppFunctionAccessService\uff08\u6743\u9650\u5b50\u7cfb\u7edf\uff09<\/td>\n<td>\u6301\u4e45\u5316\uff08\u4ee3\u7406\uff0c\u76ee\u6807\uff09\u8bbf\u95ee\u72b6\u6001\u4e0e\u6807\u5fd7\u4f4d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>51.2.11 \u901a\u8fc7 AppSearch \u5b9e\u73b0\u51fd\u6570\u53d1\u73b0<\/h4>\n<p>\u5e94\u7528\u5b89\u88c5\u3001\u66f4\u65b0\u6216\u8bbe\u5907\u5f00\u673a\u65f6\uff0cMetadataSyncAdapter\u4ece\u76ee\u6807\u5e94\u7528AppFunctionService\u63d0\u53d6\u51fd\u6570\u5143\u6570\u636e\uff0c\u4f5c\u4e3aAppFunctionStaticMetadata\u6587\u6863\u7d22\u5f15\u5b58\u5165 AppSearch\u3002\u4ee3\u7406\u5e94\u7528\u901a\u8fc7\u67e5\u8be2 AppSearch \u5b8c\u6210\u51fd\u6570\u53d1\u73b0\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"394\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260903010136-6a98c6f0a055f.png\" width=\"877\"><\/p>\n<h4>51.2.12 SafeOneTimeExecuteAppFunctionCallback<\/h4>\n<p>\u5173\u952e\u9632\u5fa1\u5c01\u88c5\uff0c\u4fdd\u8bc1\u56de\u8c03\u6709\u4e14\u4ec5\u6709\u4e00\u6b21\u88ab\u4ea4\u4ed8\u3002<\/p>\n<p>public class SafeOneTimeExecuteAppFunctionCallback {<br \/>\n    private final AtomicBoolean mOnResultCalled = new AtomicBoolean(false);<br \/>\n    @NonNull private final IExecuteAppFunctionCallback mCallback;<br \/>\n    @Nullable private final CompletionCallback mCompletionCallback;<br \/>\n    @Nullable private final BeforeCompletionCallback mBeforeCompletionCallback;<br \/>\n    private final AtomicLong mExecutionStartTimeAfterBindMillis = new AtomicLong();<\/p>\n<p>    public void onResult(@NonNull ExecuteAppFunctionResponse result) {<br \/>\n        if (!mOnResultCalled.compareAndSet(false, true)) {<br \/>\n            Log.w(TAG, \\&#8221;Ignore subsequent calls to onResult\/onError()\\&#8221;);<br \/>\n            return;<br \/>\n        }<br \/>\n        try {<br \/>\n            if (mBeforeCompletionCallback != null) {<br \/>\n                mBeforeCompletionCallback.beforeOnSuccess(result);<br \/>\n            }<br \/>\n            mCallback.onSuccess(result);<br \/>\n            if (mCompletionCallback != null) {<br \/>\n                mCompletionCallback.finalizeOnSuccess(<br \/>\n                        result, mExecutionStartTimeAfterBindMillis.get());<br \/>\n            }<br \/>\n        } catch (RemoteException ex) {<br \/>\n            Log.w(TAG, \\&#8221;Failed to invoke the callback\\&#8221;, ex);<br \/>\n        }<br \/>\n    }<\/p>\n<p>    public void onError(@NonNull AppFunctionException error) {<br \/>\n        if (!mOnResultCalled.compareAndSet(false, true)) {<br \/>\n            Log.w(TAG, \\&#8221;Ignore subsequent calls to onResult\/onError()\\&#8221;);<br \/>\n            return;<br \/>\n        }<br \/>\n        try {<br \/>\n            mCallback.onError(error);<br \/>\n            if (mCompletionCallback != null) {<br \/>\n                mCompletionCallback.finalizeOnError(<br \/>\n                        error, mExecutionStartTimeAfterBindMillis.get());<br \/>\n            }<br \/>\n        } catch (RemoteException ex) {<br \/>\n            Log.w(TAG, \\&#8221;Failed to invoke the callback\\&#8221;, ex);<br \/>\n        }<br \/>\n    }<\/p>\n<p>\u8be5\u8bbe\u8ba1\u6a21\u5f0f\u5fc5\u8981\u6027\uff1a<\/p>\n<li>\u76ee\u6807\u5e94\u7528\u5c5e\u4e8e\u7b2c\u4e09\u65b9\u4ee3\u7801\uff0c\u53ef\u80fd\u9519\u8bef\u591a\u6b21\u8c03\u7528\u56de\u8c03\u3002AtomicBoolean.compareAndSet()\u4fdd\u8bc1\u4ec5\u7b2c\u4e00\u6b21\u8c03\u7528\u751f\u6548\u3002<\/li>\n<li>\u6355\u83b7RemoteException\uff1a\u5982\u679c\u56de\u8c03\u8fdb\u7a0b\u5728\u7ed3\u679c\u8fd4\u56de\u524d\u5df2\u6b7b\u4ea1\uff0c\u5f02\u5e38\u4ec5\u6253\u65e5\u5fd7\uff0c\u4e0d\u4f1a\u5d29\u6e83 system_server\u3002<\/li>\n<li>\u5b8c\u6210\u94a9\u5b50\uff1aBeforeCompletionCallback\u4e0eCompletionCallback\u5141\u8bb8 system_server \u5728\u56de\u8c03\u4ea4\u4ed8\u524d\u540e\u6267\u884c\u9644\u52a0\u903b\u8f91\uff08\u57cb\u70b9\u65e5\u5fd7\u3001URI \u6388\u6743\u3001\u8bbf\u95ee\u5386\u53f2\u8bb0\u5f55\uff09\u3002<\/li>\n<p>    public interface CompletionCallback {<br \/>\n        void finalizeOnSuccess(<br \/>\n                ExecuteAppFunctionResponse result, long executionStartTimeMillis);<br \/>\n        void finalizeOnError(<br \/>\n                AppFunctionException error, long executionStartTimeMillis);<br \/>\n    }<\/p>\n<p>    public interface BeforeCompletionCallback {<br \/>\n        void beforeOnSuccess(ExecuteAppFunctionResponse result);<br \/>\n    }<\/p>\n<li>\u8017\u65f6\u7edf\u8ba1\uff1amExecutionStartTimeAfterBindMillis\u8bb0\u5f55\u670d\u52a1\u7ed1\u5b9a\u5b8c\u6210\u4e4b\u540e\u7684\u6267\u884c\u5f00\u59cb\u65f6\u523b\uff0c\u533a\u5206\u7ed1\u5b9a\u5f00\u9500\u4e0e\u771f\u6b63\u4e1a\u52a1\u6267\u884c\u8017\u65f6\u3002<\/li>\n<li>\u7981\u7528\u673a\u5236\uff1a\u63d0\u4f9bdisable()\uff0c\u8bf7\u6c42\u88ab\u53d6\u6d88\u6216\u8d85\u65f6\u65f6\u963b\u6b62\u540e\u7eed\u56de\u8c03\u4ea4\u4ed8\u3002<\/li>\n<h4>51.2.13 executeAppFunction \u5b9e\u73b0\u6df1\u5ea6\u89e3\u6790<\/h4>\n<p>system_server \u7684executeAppFunction\u662f\u6574\u4e2a\u6846\u67b6\u6700\u6838\u5fc3\u8def\u5f84\uff0c\u9010\u884c\u89e3\u6790\u4ece AIDL \u5165\u53e3\u5230\u7ed1\u5b9a\u76ee\u6807\u670d\u52a1\u7684\u5b8c\u6574\u94fe\u8def\u3002<\/p>\n<p>\u6b65\u9aa4 1\uff1a\u5165\u53e3\u4e0e\u521d\u59cb\u6821\u9a8c<\/p>\n<p>@Override<br \/>\npublic ICancellationSignal executeAppFunction(<br \/>\n        @NonNull ExecuteAppFunctionAidlRequest requestInternal,<br \/>\n        @NonNull IExecuteAppFunctionCallback executeAppFunctionCallback) {<\/p>\n<p>    int callingUid = Binder.getCallingUid();<br \/>\n    int callingPid = Binder.getCallingPid();<\/p>\n<p>    final SafeOneTimeExecuteAppFunctionCallback safeExecuteAppFunctionCallback =<br \/>\n            initializeSafeExecuteAppFunctionCallback(<br \/>\n                    requestInternal, executeAppFunctionCallback, callingUid);<\/p>\n<p>    String validatedCallingPackage;<br \/>\n    try {<br \/>\n        validatedCallingPackage =<br \/>\n                mCallerValidator.validateCallingPackage(requestInternal.getCallingPackage());<br \/>\n        mCallerValidator.verifyTargetUserHandle(<br \/>\n                requestInternal.getUserHandle(), validatedCallingPackage);<br \/>\n    } catch (SecurityException exception) {<br \/>\n        safeExecuteAppFunctionCallback.onError(<br \/>\n                new AppFunctionException(<br \/>\n                        AppFunctionException.ERROR_DENIED, exception.getMessage()));<br \/>\n        return null;<br \/>\n    }<\/p>\n<p>SafeOneTimeExecuteAppFunctionCallback\u5305\u88c5\uff0c\u4fdd\u8bc1\u65e0\u8bba\u76ee\u6807\u5e94\u7528\u591a\u6b21\u5e94\u7b54\u8fd8\u662f\u5d29\u6e83\uff0c\u53ea\u8fd4\u56de\u4e00\u6b21\u6210\u529f \/ \u9519\u8bef\u3002<\/p>\n<p>\u6b65\u9aa4 2\uff1a\u7ebf\u7a0b\u6c60\u5f02\u6b65\u6267\u884c\uff0c\u4e0d\u963b\u585e Binder \u7ebf\u7a0b<\/p>\n<p>    ICancellationSignal localCancelTransport = CancellationSignal.createTransport();<\/p>\n<p>    THREAD_POOL_EXECUTOR.execute(<br \/>\n            () -&gt; {<br \/>\n                try {<br \/>\n                    executeAppFunctionInternal(<br \/>\n                            requestInternal,<br \/>\n                            callingUid, callingPid,<br \/>\n                            localCancelTransport,<br \/>\n                            safeExecuteAppFunctionCallback,<br \/>\n                            executeAppFunctionCallback.asBinder());<br \/>\n                } catch (Exception e) {<br \/>\n                    safeExecuteAppFunctionCallback.onError(<br \/>\n                            mapExceptionToExecuteAppFunctionResponse(e));<br \/>\n                }<br \/>\n            });<br \/>\n    return localCancelTransport;<br \/>\n}<\/p>\n<p>\u4efb\u52a1\u63d0\u4ea4\u81f3THREAD_POOL_EXECUTOR\uff0c\u907f\u514d\u5360\u7528 Binder \u7ebf\u7a0b\u6c60\u3002<\/p>\n<p>\u6b65\u9aa4 3\uff1a\u6743\u9650\u4e0e\u72b6\u6001\u57fa\u7840\u6821\u9a8c\uff08\u5de5\u4f5c\u7ebf\u7a0b\uff09<\/p>\n<p>@WorkerThread<br \/>\nprivate void executeAppFunctionInternal(&#8230;) {<br \/>\n    \/\/ \u4f01\u4e1a\u7b56\u7565\u6821\u9a8c<br \/>\n    if (!mCallerValidator.verifyEnterprisePolicyIsAllowed(callingUser, targetUser)) {<br \/>\n        safeExecuteAppFunctionCallback.onError(<br \/>\n                new AppFunctionException(<br \/>\n                        AppFunctionException.ERROR_ENTERPRISE_POLICY_DISALLOWED, &#8230;));<br \/>\n        return;<br \/>\n    }<\/p>\n<p>    \/\/ \u76ee\u6807\u5305\u540d\u6821\u9a8c\u975e\u7a7a<br \/>\n    if (TextUtils.isEmpty(targetPackageName)) {<br \/>\n        safeExecuteAppFunctionCallback.onError(<br \/>\n                new AppFunctionException(<br \/>\n                        AppFunctionException.ERROR_INVALID_ARGUMENT, &#8230;));<br \/>\n        return;<br \/>\n    }<\/p>\n<p>\u6b65\u9aa4 4\uff1a\u94fe\u5f0f Future \u5b8c\u6210\u6743\u9650\u6821\u9a8c + AppSearch \u8bfb\u53d6\u542f\u7528\u72b6\u6001 \u5b9e\u73b0\u4f7f\u7528AndroidFuture.thenCompose()\u505a\u975e\u963b\u585e\u6743\u9650\u6821\u9a8c\uff0c\u7d27\u63a5\u7740\u67e5\u8be2 AppSearch \u83b7\u53d6\u51fd\u6570\u542f\u7528\u72b6\u6001\u3002<\/p>\n<p>    mCallerValidator<br \/>\n            .verifyCallerCanExecuteAppFunction(<br \/>\n                    callingUid, callingPid, targetUser,<br \/>\n                    requestInternal.getCallingPackage(),<br \/>\n                    targetPackageName,<br \/>\n                    requestInternal.getClientRequest().getFunctionIdentifier())<br \/>\n            .thenCompose(canExecuteResult -&gt; {<br \/>\n                if (canExecuteResult == CAN_EXECUTE_APP_FUNCTIONS_DENIED) {<br \/>\n                    return AndroidFuture.failedFuture(<br \/>\n                            new SecurityException(\\&#8221;Caller does not have permission\\&#8221;));<br \/>\n                }<br \/>\n                return isAppFunctionEnabled(<br \/>\n                        functionIdentifier, targetPackageName,<br \/>\n                        getAppSearchManagerAsUser(userHandle), THREAD_POOL_EXECUTOR)<br \/>\n                    .thenApply(isEnabled -&gt; {<br \/>\n                        if (!isEnabled) {<br \/>\n                            throw new DisabledAppFunctionException(\\&#8221;Disabled\\&#8221;);<br \/>\n                        }<br \/>\n                        return canExecuteResult;<br \/>\n                    });<br \/>\n            })<\/p>\n<p>\u6b65\u9aa4 5\uff1a\u670d\u52a1\u89e3\u6790\u4e0e\u7ed1\u5b9a<\/p>\n<p>            .thenAccept(canExecuteResult -&gt; {<br \/>\n                int bindFlags = Context.BIND_AUTO_CREATE;<br \/>\n                if (canExecuteResult<br \/>\n                        == CAN_EXECUTE_APP_FUNCTIONS_ALLOWED_HAS_PERMISSION) {<br \/>\n                    bindFlags |= Context.BIND_FOREGROUND_SERVICE;<br \/>\n                }<br \/>\n                Intent serviceIntent =<br \/>\n                        mInternalServiceHelper.resolveAppFunctionService(<br \/>\n                                targetPackageName, targetUser);<br \/>\n                \/\/ \u6388\u4e88\u9690\u5f0f\u53ef\u89c1\u6027\uff0c\u5141\u8bb8\u76ee\u6807\u770b\u5230\u8c03\u7528\u65b9<br \/>\n                mPackageManagerInternal.grantImplicitAccess(<br \/>\n                        grantRecipientUserId, serviceIntent,<br \/>\n                        grantRecipientAppId, callingUid, \/* direct= *\/ true);<br \/>\n                bindAppFunctionServiceUnchecked(<br \/>\n                        requestInternal, serviceIntent, targetUser,<br \/>\n                        localCancelTransport, safeExecuteAppFunctionCallback,<br \/>\n                        bindFlags, callerBinder, callingUid);<br \/>\n            })<\/p>\n<p>\u5173\u952e\u70b9\uff1a\u8c03\u7528\u65b9\u5177\u5907EXECUTE_APP_FUNCTIONS\u6743\u9650\u65f6\uff0c\u4f7f\u7528BIND_FOREGROUND_SERVICE\u63d0\u5347\u76ee\u6807\u670d\u52a1\u8fdb\u7a0b\u4f18\u5148\u7ea7\u3002\u81ea\u8c03\u7528\uff08\u540c\u4e00\u5305\u540d\uff09\u4e0d\u4f1a\u83b7\u5f97\u8be5\u4f18\u5148\u7ea7\u63d0\u5347\u3002<\/p>\n<h4>51.2.14 RemoteServiceCaller \u6a21\u5f0f<\/h4>\n<p>RemoteServiceCallerImpl\u5b9e\u73b0\u4e00\u6b21\u6027 Service \u7ed1\u5b9a\u6a21\u5f0f\uff1a<\/p>\n<p>public class RemoteServiceCallerImpl&lt;T&gt; implements RemoteServiceCaller&lt;T&gt; {<br \/>\n    public boolean runServiceCall(<br \/>\n            Intent intent, int bindFlags, UserHandle userHandle,<br \/>\n            long cancellationTimeoutMillis, CancellationSignal cancellationSignal,<br \/>\n            RunServiceCallCallback&lt;T&gt; callback, IBinder callerBinder) {<\/p>\n<p>        OneOffServiceConnection serviceConnection =<br \/>\n                new OneOffServiceConnection(intent, bindFlags, userHandle,<br \/>\n                        cancellationTimeoutMillis, cancellationSignal,<br \/>\n                        callback, callerBinder);<br \/>\n        return serviceConnection.bindAndRun();<br \/>\n    }<\/p>\n<p>OneOffServiceConnection\u662f\u81ea\u5b9a\u4e49ServiceConnection\uff0c\u884c\u4e3a\uff1a<\/p>\n<li>\u8c03\u7528Context.bindServiceAsUser()\u8fde\u63a5\u76ee\u6807\u670d\u52a1<\/li>\n<li>\u8bbe\u7f6e\u53d6\u6d88\u76d1\u542c\u5668\uff0c\u8d85\u65f6\u540e\u6267\u884c unbind<\/li>\n<li>\u76d1\u542c\u8c03\u7528\u65b9 Binder \u6b7b\u4ea1\uff0c\u8c03\u7528\u65b9\u8fdb\u7a0b\u6b7b\u4ea1\u5219\u81ea\u52a8\u53d6\u6d88<\/li>\n<li>\u56de\u8c03\u5b8c\u6210\u540e\u81ea\u52a8\u89e3\u7ed1<\/li>\n<p>private class OneOffServiceConnection<br \/>\n        implements ServiceConnection, ServiceUsageCompleteListener {<\/p>\n<p>    public boolean bindAndRun() {<br \/>\n        boolean bindServiceResult =<br \/>\n                mContext.bindServiceAsUser(mIntent, this, mFlags, mUserHandle);<\/p>\n<p>        if (bindServiceResult) {<br \/>\n            mCancellationSignal.setOnCancelListener(() -&gt; {<br \/>\n                mCallback.onCancelled();<br \/>\n                mHandler.postDelayed(mCancellationTimeoutRunnable,<br \/>\n                        mCancellationTimeoutMillis);<br \/>\n            });<br \/>\n            mDirectServiceVulture = () -&gt; {<br \/>\n                Slog.w(TAG, \\&#8221;Caller process onDeath signal received\\&#8221;);<br \/>\n                mCancellationSignal.cancel();<br \/>\n            };<br \/>\n            mCallerBinder.linkToDeath(mDirectServiceVulture, 0);<br \/>\n        }<br \/>\n        return bindServiceResult;<br \/>\n    }<\/p>\n<p>\u8be5\u6a21\u5f0f\u4fdd\u8bc1\u8d44\u6e90\u4e00\u5b9a\u88ab\u6e05\u7406\uff0c\u65e0\u8bba\u8c03\u7528\u65b9\u5d29\u6e83\u3001\u76ee\u6807\u5e94\u7528\u5d29\u6e83\u6216\u8005\u7528\u6237\u4e3b\u52a8\u53d6\u6d88\u3002<\/p>\n<h4>51.2.15 \u591a\u7528\u6237\u652f\u6301<\/h4>\n<p>\u5b9e\u73b0\u5b8c\u6574\u652f\u6301\u591a\u7528\u6237\u3002\u6bcf\u4e2a\u7528\u6237\u62e5\u6709\uff1a<\/p>\n<ul>\n<li>\u72ec\u7acb AppSearch \u6570\u636e\u5e93\uff0c\u4fdd\u5b58\u9759\u6001\u51fd\u6570\u5143\u6570\u636e<\/li>\n<li>\u72ec\u7acbPackageMonitor\u76d1\u542c\u5305\u53d8\u66f4<\/li>\n<li>MultiUserDynamicAppFunctionRegistry\u4e2d\u72ec\u7acb\u5206\u7247\u4fdd\u5b58\u8fd0\u884c\u65f6\u6ce8\u518c\u9879<\/li>\n<li>\u6743\u9650\u5b50\u7cfb\u7edf\u6301\u4e45\u5316\u72ec\u7acb\u7684\uff08\u4ee3\u7406\uff0c\u76ee\u6807\uff09\u8bbf\u95ee\u72b6\u6001\u4e0e\u6807\u5fd7\u4f4d<\/li>\n<\/ul>\n<p>public void onUserUnlocked(TargetUser user) {<br \/>\n    if (enableDynamicAppFunctions()) {<br \/>\n        mAppFunctionMetadataObserver.registerAppSearchObserverForUser(user);<br \/>\n    } else {<br \/>\n        registerAppSearchObserver(user);<br \/>\n    }<br \/>\n    trySyncRuntimeMetadata(user.getUserHandle(), &#8230;);<br \/>\n    PackageMonitor pkgMonitorForUser =<br \/>\n            AppFunctionPackageMonitor.registerPackageMonitorForUser(<br \/>\n                    mContext, user, mAppFunctionMetadataObserver);<br \/>\n    mPackageMonitors.append(user.getUserIdentifier(), pkgMonitorForUser);<br \/>\n    mDynamicAppFunctionRegistry.onUserUnlocked(user, &#8230;);<br \/>\n}<\/p>\n<p>public void onUserStopping(@NonNull TargetUser user) {<br \/>\n    if (enableDynamicAppFunctions()) {<br \/>\n        mAppFunctionMetadataObserver.unregisterAppSearchObserverForUser(user);<br \/>\n    } else {<br \/>\n        MetadataSyncPerUser.removeUserSyncAdapter(user.getUserHandle());<br \/>\n    }<br \/>\n    mPackageMonitors.get(user.getUserIdentifier()).unregister();<br \/>\n    mPackageMonitors.delete(user.getUserIdentifier());<br \/>\n}<\/p>\n<p>public void onUserStopped(@NonNull TargetUser user) {<br \/>\n    mDynamicAppFunctionRegistry.onUserStopped(user);<br \/>\n}<\/p>\n<p>\u52a8\u6001\u51fd\u6570\u6807\u8bb0\u5f00\u542f\u65f6\uff0c\u6bcf\u4e2a\u7528\u6237\u7684 AppSearch \u89c2\u5bdf\u8005\u7531AppFunctionMetadataObserver\u6301\u6709\uff0c\u53d8\u66f4\u4e8b\u4ef6\u540c\u65f6\u5206\u53d1\u7ed9\u5185\u90e8\u5143\u6570\u636e\u7f13\u5b58\u4ee5\u53ca\u5ba2\u6237\u7aefobserveAppFunctions\u56de\u8c03\u3002\u8fd0\u884c\u65f6\u6ce8\u518c\u8868\u4ee5 userId \u4e3a key\uff1b\u5f53\u7528\u6237\u505c\u6b62\uff0c\u8be5\u7528\u6237\u4e0b\u5168\u90e8\u6ce8\u518c\u9879\u88ab\u9500\u6bc1\u3002<\/p>\n<h4>51.2.16 \u4ee3\u7406\u767d\u540d\u5355\u67b6\u6784<\/h4>\n<p>Android17 \u4ee3\u7406\u767d\u540d\u5355\u4e0d\u518d\u662f DeviceConfig \u4e0e Settings.Secure \u5b57\u7b26\u4e32\u62fc\u63a5\uff0c\u6539\u7528\u5e73\u53f0AllowlistManager\uff0c\u767d\u540d\u5355 ID \u4e3aALLOWLIST_ID_APP_FUNCTION\u3002\u8f93\u5165\u7b7e\u540d\u4ee3\u7406\u5305\uff0c\u8fd4\u56de\u8be5\u4ee3\u7406\u53ef\u8bbf\u95ee\u7684\u76ee\u6807\u5305\u96c6\u5408\u3002AppFunctions \u670d\u52a1\u901a\u8fc7SystemAppFunctionAllowlistReader\u6d88\u8d39\u8be5\u80fd\u529b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"602\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260903010136-6a98c6f0bf78b.png\" width=\"511\"><\/p>\n<p>\u8bfb\u53d6\u5668\u5c06\u4ee3\u7406\u6700\u65b0\u7b7e\u540d\u8bc1\u4e66\u54c8\u5e0c\u5c01\u88c5\u4e3aSignedPackage\uff0c\u5411AllowlistManager\u67e5\u8be2\u5408\u6cd5\u76ee\u6807\u5305\uff1b\u67e5\u8be2\u7ed3\u679c\u653e\u5165 LruCache \u7f13\u5b58\uff0c\u76f8\u540c\u4ee3\u7406\u91cd\u590d\u6267\u884c\u53ef\u7701\u53bb\u4e00\u6b21 IPC\u3002<\/p>\n<p>@Override<br \/>\npublic CompletableFuture&lt;Boolean&gt; isAllowlisted(<br \/>\n        String agentPackageName, String targetPackageName, int userId) {<br \/>\n    if (agentPackageName.equals(targetPackageName)) {<br \/>\n        return AndroidFuture.completedFuture(true);   \/\/ \u81ea\u8eab\u51fd\u6570\u6c38\u8fdc\u5141\u8bb8<br \/>\n    }<br \/>\n    SignedPackage agentSignedPackage =<br \/>\n            new SignedPackage(agentPackageName, \/* certificate digest *\/ &#8230;);<br \/>\n    maybeStartAllowlistListener();<br \/>\n    return getValidTargetPackages(agentSignedPackage)<br \/>\n            .thenApply(allowlistTargets -&gt;<br \/>\n                    allowlistTargets.contains(WILDCARD_PACKAGE_NAME)<br \/>\n                            || allowlistTargets.contains(targetPackageName));<br \/>\n}<\/p>\n<p>\u4e09\u6761\u5173\u952e\u884c\u4e3a\uff1a<\/p>\n<li>\u81ea\u8bbf\u95ee\u9690\u5f0f\u653e\u884c\uff1a\u4ee3\u7406\u4e0e\u76ee\u6807\u5305\u76f8\u540c\uff0c\u5e94\u7528\u6c38\u8fdc\u53ef\u4ee5\u8c03\u7528\u81ea\u8eab\u51fd\u6570\u3002<\/li>\n<li>\u901a\u914d\u7b26\u76ee\u6807\uff1a\u767d\u540d\u5355\u914d\u7f6e\u901a\u914d\u7b26\u5305\u540d\uff0c\u4ee3\u7406\u53ef\u8bbf\u95ee\u5168\u90e8\u76ee\u6807\u3002<\/li>\n<li>\u53d8\u66f4\u76d1\u542c\uff1a\u9996\u6b21\u4f7f\u7528\u6ce8\u518cOnAllowlistChangedListener\uff1b\u767d\u540d\u5355\u66f4\u65b0\u65f6\u7f13\u5b58\u81ea\u52a8\u5931\u6548\uff0c\u4e0d\u518d\u53ea\u5728\u5f00\u673a\u9636\u6bb5\u8bfb\u53d6\u914d\u7f6e\u5b57\u7b26\u4e32\u3002<\/li>\n<h4>51.2.17 AppFunction \u54cd\u5e94\u4e2d\u7684 URI \u6388\u6743<\/h4>\n<p>\u5f53\u76ee\u6807\u5e94\u7528\u5728\u54cd\u5e94\u4e2d\u8fd4\u56de content URI\uff0c\u6846\u67b6\u53ef\u4ee5\u4e3a\u8c03\u7528\u4ee3\u7406\u6388\u4e88\u4e34\u65f6 URI \u6743\u9650\u3002<\/p>\n<p>private final IUriGrantsManager mUriGrantsManager;<br \/>\nprivate final UriGrantsManagerInternal mUriGrantsManagerInternal;<br \/>\nprivate final IBinder mPermissionOwner;<\/p>\n<p>\/\/ \u6784\u9020\u51fd\u6570\u4e2d\u521d\u59cb\u5316<br \/>\nmPermissionOwner = mUriGrantsManagerInternal.newUriPermissionOwner(\\&#8221;appfunctions\\&#8221;);<\/p>\n<p>\u54cd\u5e94\u4e2d\u7684AppFunctionUriGrant\u6307\u660e\u9700\u8981\u5411\u4ee3\u7406\u6388\u4e88\u54ea\u4e9b URI\u3002\u6388\u6743\u7ecf\u7531mUriGrantsManager.grantUriPermissionFromOwner\u5b8c\u6210\uff0c\u7ed1\u5b9a\u5230 AppFunctions \u4e13\u5c5e permission owner\u3002\u6743\u9650\u6709\u6548\u671f\u76f4\u5230 owner \u91ca\u653e\u6216\u8005\u8bbe\u5907\u91cd\u542f\u3002<\/p>\n<h4>51.2.18 Shell \u547d\u4ee4\u652f\u6301<\/h4>\n<p>\u670d\u52a1\u5b9e\u73b0onShellCommand()\uff0c\u7528\u4e8e\u5f00\u53d1\u8005\u8c03\u8bd5\u3002<\/p>\n<p>@Override<br \/>\npublic void onShellCommand(<br \/>\n        FileDescriptor in, FileDescriptor out, FileDescriptor err,<br \/>\n        @NonNull String[] args, ShellCallback callback,<br \/>\n        @NonNull ResultReceiver resultReceiver) {<br \/>\n    new AppFunctionManagerServiceShellCommand(mContext, this)<br \/>\n            .exec(this, in, out, err, args, callback, resultReceiver);<br \/>\n}<\/p>\n<p>adb \u547d\u4ee4\uff1aadb shell cmd app_function<\/p>\n<h4>51.2.19 \u670d\u52a1\u542f\u52a8\u4e0e\u751f\u547d\u5468\u671f<\/h4>\n<p>\u672c\u6846\u67b6\u5c5e\u4e8eSystemService\u3002AppFunctionManagerService.onStart()\uff0c\u5f53AppFunctionManagerConfiguration.isSupported(context)\u4e3a true \u65f6\uff0c\u628a Binder \u670d\u52a1\u53d1\u5e03\u5230Context.APP_FUNCTION_SERVICE\uff1b\u5f00\u542f App Interaction API \u6807\u8bb0\u65f6\uff0c\u989d\u5916\u53d1\u5e03\u672c\u5730\u670d\u52a1AppInteractionService\u3002<\/p>\n<p>@Override<br \/>\npublic void onStart() {<br \/>\n    if (AppFunctionManagerConfiguration.isSupported(getContext())) {<br \/>\n        publishBinderService(Context.APP_FUNCTION_SERVICE, mServiceImpl);<br \/>\n    }<br \/>\n    if (Flags.enableAppInteractionApi()) {<br \/>\n        publishLocalService(AppInte<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android \u5df2\u7ecf\u4ece\u4e00\u4e2a\u4ec5\u80fd\u8fd0\u884c\u5e94\u7528\u7684\u5e73\u53f0\uff0c\u6f14\u8fdb\u4e3a\u80fd\u591f\u7406\u89e3\u5e94\u7528\u884c\u4e3a\u7684\u5e73\u53f0\u3002\u4e00\u7cfb\u5217\u7aef\u4fa7\u667a\u80fd\u670d\u52a1\u5c06\u7528\u6237\u610f\u56fe\u4e0e\u5e94\u7528\u884c\u4e3a\u5173\u8054\u8d77\u6765\uff1aAppFunctions \u6846\u67b6\u5141\u8bb8\u52a9\u624b\u901a\u8fc7\u5f3a\u7c7b\u578b RPC \u5951\u7ea6\u8c03\u7528\u5e94\u7528\u7684\u4efb\u610f\u529f\u80fd\uff1b\u8ba1\u7b97\u673a\u63a7\u5236\uff08Computer Control\uff09\u4e3a AI \u4ee3\u7406\u63d0\u4f9b\u865a\u62df\u663e\u793a\u5668\uff0c\u53ef\u5728\u5176\u4e0a\u5b8c\u6210\u70b9\u51fb\u3001\u6ed1\u52a8\u3001\u622a\u56fe\u64cd\u4f5c\uff1bOnDeviceIntelligence \u5728\u9694\u79bb\u6c99\u7bb1\u4e2d\u8fd0\u884c\u5927\u673a\u5668\u5b66\u4e60\u6a21\u578b \u2014\u2014 \u5927\u8bed\u8a00\u6a21\u578b\u4ee5\u53ca\u5176\u4ed6\u751f\u6210\u5f0f\u6216\u5927\u89c4\u6a21\u63a8\u7406\u8d1f\u8f7d\uff1bNNAPI \u5411\u6240\u6709\u539f\u751f\u5de5\u4f5c\u8d1f\u8f7d\u66b4\u9732\u786c\u4ef6\u52a0\u901f<\/p>\n","protected":false},"author":2,"featured_media":99766,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11115],"topic":[],"class_list":["post-99770","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-aosp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7b2c 51 \u7ae0\uff1aAI\u3001AppFunctions \u4e0e\u8ba1\u7b97\u673a\u63a7\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/99770.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7b2c 51 \u7ae0\uff1aAI\u3001AppFunctions \u4e0e\u8ba1\u7b97\u673a\u63a7\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Android \u5df2\u7ecf\u4ece\u4e00\u4e2a\u4ec5\u80fd\u8fd0\u884c\u5e94\u7528\u7684\u5e73\u53f0\uff0c\u6f14\u8fdb\u4e3a\u80fd\u591f\u7406\u89e3\u5e94\u7528\u884c\u4e3a\u7684\u5e73\u53f0\u3002\u4e00\u7cfb\u5217\u7aef\u4fa7\u667a\u80fd\u670d\u52a1\u5c06\u7528\u6237\u610f\u56fe\u4e0e\u5e94\u7528\u884c\u4e3a\u5173\u8054\u8d77\u6765\uff1aAppFunctions \u6846\u67b6\u5141\u8bb8\u52a9\u624b\u901a\u8fc7\u5f3a\u7c7b\u578b RPC \u5951\u7ea6\u8c03\u7528\u5e94\u7528\u7684\u4efb\u610f\u529f\u80fd\uff1b\u8ba1\u7b97\u673a\u63a7\u5236\uff08Computer Control\uff09\u4e3a AI \u4ee3\u7406\u63d0\u4f9b\u865a\u62df\u663e\u793a\u5668\uff0c\u53ef\u5728\u5176\u4e0a\u5b8c\u6210\u70b9\u51fb\u3001\u6ed1\u52a8\u3001\u622a\u56fe\u64cd\u4f5c\uff1bOnDeviceIntelligence \u5728\u9694\u79bb\u6c99\u7bb1\u4e2d\u8fd0\u884c\u5927\u673a\u5668\u5b66\u4e60\u6a21\u578b \u2014\u2014 \u5927\u8bed\u8a00\u6a21\u578b\u4ee5\u53ca\u5176\u4ed6\u751f\u6210\u5f0f\u6216\u5927\u89c4\u6a21\u63a8\u7406\u8d1f\u8f7d\uff1bNNAPI \u5411\u6240\u6709\u539f\u751f\u5de5\u4f5c\u8d1f\u8f7d\u66b4\u9732\u786c\u4ef6\u52a0\u901f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/99770.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-03T01:01:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260903010136-6a98c6f005acb.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99770.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/99770.html\",\"name\":\"\u7b2c 51 \u7ae0\uff1aAI\u3001AppFunctions \u4e0e\u8ba1\u7b97\u673a\u63a7\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-03T01:01:37+00:00\",\"dateModified\":\"2026-09-03T01:01:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/99770.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/99770.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99770.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7b2c 51 \u7ae0\uff1aAI\u3001AppFunctions \u4e0e\u8ba1\u7b97\u673a\u63a7\u5236\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7b2c 51 \u7ae0\uff1aAI\u3001AppFunctions \u4e0e\u8ba1\u7b97\u673a\u63a7\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/99770.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7b2c 51 \u7ae0\uff1aAI\u3001AppFunctions \u4e0e\u8ba1\u7b97\u673a\u63a7\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Android \u5df2\u7ecf\u4ece\u4e00\u4e2a\u4ec5\u80fd\u8fd0\u884c\u5e94\u7528\u7684\u5e73\u53f0\uff0c\u6f14\u8fdb\u4e3a\u80fd\u591f\u7406\u89e3\u5e94\u7528\u884c\u4e3a\u7684\u5e73\u53f0\u3002\u4e00\u7cfb\u5217\u7aef\u4fa7\u667a\u80fd\u670d\u52a1\u5c06\u7528\u6237\u610f\u56fe\u4e0e\u5e94\u7528\u884c\u4e3a\u5173\u8054\u8d77\u6765\uff1aAppFunctions \u6846\u67b6\u5141\u8bb8\u52a9\u624b\u901a\u8fc7\u5f3a\u7c7b\u578b RPC \u5951\u7ea6\u8c03\u7528\u5e94\u7528\u7684\u4efb\u610f\u529f\u80fd\uff1b\u8ba1\u7b97\u673a\u63a7\u5236\uff08Computer Control\uff09\u4e3a AI \u4ee3\u7406\u63d0\u4f9b\u865a\u62df\u663e\u793a\u5668\uff0c\u53ef\u5728\u5176\u4e0a\u5b8c\u6210\u70b9\u51fb\u3001\u6ed1\u52a8\u3001\u622a\u56fe\u64cd\u4f5c\uff1bOnDeviceIntelligence \u5728\u9694\u79bb\u6c99\u7bb1\u4e2d\u8fd0\u884c\u5927\u673a\u5668\u5b66\u4e60\u6a21\u578b \u2014\u2014 \u5927\u8bed\u8a00\u6a21\u578b\u4ee5\u53ca\u5176\u4ed6\u751f\u6210\u5f0f\u6216\u5927\u89c4\u6a21\u63a8\u7406\u8d1f\u8f7d\uff1bNNAPI \u5411\u6240\u6709\u539f\u751f\u5de5\u4f5c\u8d1f\u8f7d\u66b4\u9732\u786c\u4ef6\u52a0\u901f","og_url":"https:\/\/www.wsisp.com\/helps\/99770.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-03T01:01:37+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260903010136-6a98c6f005acb.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/99770.html","url":"https:\/\/www.wsisp.com\/helps\/99770.html","name":"\u7b2c 51 \u7ae0\uff1aAI\u3001AppFunctions \u4e0e\u8ba1\u7b97\u673a\u63a7\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-03T01:01:37+00:00","dateModified":"2026-09-03T01:01:37+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/99770.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/99770.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/99770.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7b2c 51 \u7ae0\uff1aAI\u3001AppFunctions \u4e0e\u8ba1\u7b97\u673a\u63a7\u5236"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=99770"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99770\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/99766"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=99770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=99770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=99770"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=99770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}