{"id":52892,"date":"2025-08-11T21:09:14","date_gmt":"2025-08-11T13:09:14","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/52892.html"},"modified":"2025-08-11T21:09:14","modified_gmt":"2025-08-11T13:09:14","slug":"android%e9%9f%b3%e9%a2%91%e5%ad%a6%e4%b9%a0%e4%b9%9d-audiopolicyservice","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/52892.html","title":{"rendered":"Android\u97f3\u9891\u5b66\u4e60(\u4e5d)\u2014\u2014AudioPolicyService"},"content":{"rendered":"<p>\u00a0 \u00a0 \u00a0 \u00a0 AudioPolicyService&#xff08;APS&#xff09;\u662f Android \u97f3\u9891\u7cfb\u7edf\u7684\u00a0\u7b56\u7565\u63a7\u5236\u4e2d\u67a2&#xff0c;\u8d1f\u8d23\u7ba1\u7406\u97f3\u9891\u8def\u7531\u3001\u8bbe\u5907\u5207\u6362\u3001\u97f3\u91cf\u7b56\u7565\u3001\u7b56\u7565\u51b2\u7a81\u89e3\u51b3\u7b49\u5173\u952e\u51b3\u7b56\u3002\u5b83\u4e0e AudioFlinger&#xff08;\u8d1f\u8d23\u97f3\u9891\u6570\u636e\u5904\u7406&#xff09;\u534f\u540c\u5de5\u4f5c&#xff0c;\u5171\u540c\u6784\u6210 Android \u97f3\u9891\u6846\u67b6\u7684\u6838\u5fc3\u3002<\/p>\n<h2>1. \u6838\u5fc3\u804c\u8d23<\/h2>\n<table>\n<tr>\u529f\u80fd\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u97f3\u9891\u8def\u7531\u51b3\u7b56<\/td>\n<td>\u6839\u636e\u573a\u666f&#xff08;\u901a\u8bdd\/\u97f3\u4e50\/\u901a\u77e5&#xff09;\u548c\u5f53\u524d\u8bbe\u5907\u72b6\u6001&#xff08;\u8033\u673a\/\u626c\u58f0\u5668\/\u84dd\u7259&#xff09;\u52a8\u6001\u9009\u62e9\u6700\u4f73\u8f93\u51fa\u8def\u5f84<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u5907\u72b6\u6001\u7ba1\u7406<\/td>\n<td>\u76d1\u542c\u8bbe\u5907\u8fde\u63a5\/\u65ad\u5f00&#xff08;\u5982\u8033\u673a\u62d4\u51fa&#xff09;&#xff0c;\u89e6\u53d1\u8def\u7531\u5207\u6362\u548c\u7b56\u7565\u66f4\u65b0<\/td>\n<\/tr>\n<tr>\n<td>\u97f3\u91cf\u7b56\u7565\u63a7\u5236<\/td>\n<td>\u7ba1\u7406\u4e0d\u540c\u6d41\u7c7b\u578b&#xff08;\u97f3\u4e50\/\u901a\u8bdd\/\u8b66\u62a5&#xff09;\u7684\u72ec\u7acb\u97f3\u91cf\u66f2\u7ebf&#xff0c;\u652f\u6301\u8bbe\u5907\u5dee\u5f02\u5316\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>\u7b56\u7565\u51b2\u7a81\u4ef2\u88c1<\/td>\n<td>\u89e3\u51b3\u591a\u5e94\u7528\u540c\u65f6\u8bf7\u6c42\u97f3\u9891\u7126\u70b9\u65f6\u7684\u4f18\u5148\u7ea7\u51b2\u7a81&#xff08;\u5982\u901a\u8bdd\u6253\u65ad\u97f3\u4e50&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u97f3\u9891\u7126\u70b9\u7ba1\u7406<\/td>\n<td>\u901a\u8fc7\u00a0AudioFocus\u00a0\u673a\u5236\u534f\u8c03\u5e94\u7528\u5bf9\u97f3\u9891\u8d44\u6e90\u7684\u62a2\u5360\u5f0f\u4f7f\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>2 \u6838\u5fc3\u5de5\u4f5c\u6d41\u7a0b<\/h2>\n<p>2.1\u8bbe\u5907\u72b6\u6001\u53d8\u5316\u5904\u7406&#xff08;\u4ee5\u8033\u673a\u63d2\u5165\u4e3a\u4f8b&#xff09;&#xff1a;<\/p>\n<p>(1)UEventObserver\u00a0\u76d1\u542c\u5185\u6838\u4e8b\u4ef6 \u2192 \u68c0\u6d4b\u8033\u673a\u63d2\u5165<\/p>\n<p>(2)\u8c03\u7528\u00a0setDeviceConnectionState()\u00a0\u66f4\u65b0\u8bbe\u5907\u72b6\u6001<\/p>\n<p>(3)AudioPolicyManager\u00a0\u91cd\u65b0\u8ba1\u7b97\u8def\u7531\u7b56\u7565<\/p>\n<p>(4)\u901a\u77e5 AudioFlinger \u91cd\u65b0\u6253\u5f00\u8f93\u51fa\u6d41<\/p>\n<p>(5)\u5e7f\u64ad\u00a0ACTION_HEADSET_PLUG\u00a0\u901a\u77e5\u5e94\u7528<\/p>\n<p>2.2\u97f3\u9891\u64ad\u653e\u8def\u7531\u51b3\u7b56&#xff1a;<\/p>\n<p>\/\/ \u793a\u4f8b&#xff1a;\u9009\u62e9\u8f93\u51fa\u8bbe\u5907\u7684\u6838\u5fc3\u903b\u8f91 (\u7b80\u5316\u7248)<br \/>\naudio_io_handle_t AudioPolicyManager::getOutputForAttr() {<br \/>\n    \/\/ 1. \u6839\u636e\u97f3\u9891\u5c5e\u6027&#xff08;usage, content type&#xff09;\u786e\u5b9a\u6d41\u7c7b\u578b<br \/>\n    audio_stream_type_t stream &#061; _streamForAttributes(attr);<\/p>\n<p>    \/\/ 2. \u68c0\u67e5\u5f53\u524d\u8bbe\u5907\u53ef\u7528\u6027&#xff08;\u626c\u58f0\u5668\/\u8033\u673a\/\u84dd\u7259\u7b49&#xff09;<br \/>\n    DeviceVector availableDevices &#061; getAvailableOutputDevices();<\/p>\n<p>    \/\/ 3. \u5e94\u7528\u8def\u7531\u7b56\u7565\u89c4\u5219&#xff08;\u4f18\u5148\u7ea7&#xff1a;\u84dd\u7259 &gt; \u6709\u7ebf\u8033\u673a &gt; \u626c\u58f0\u5668&#xff09;<br \/>\n    DeviceDescriptor device &#061; _findDeviceForStrategy(<br \/>\n        getStrategyForStream(stream),<br \/>\n        availableDevices<br \/>\n    );<\/p>\n<p>    \/\/ 4. \u521b\u5efa\/\u590d\u7528\u5bf9\u5e94\u7684\u8f93\u51fa\u6d41<br \/>\n    return openOutputWithProfile(device, profile);<br \/>\n}<\/p>\n<h2>3.\u00a0\u5173\u952e\u7ec4\u4ef6\u4ea4\u4e92<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"225\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250811130912-6899eb788c6d1.png\" width=\"1800\" \/><\/p>\n<h2>4.\u7b56\u7565\u914d\u7f6e\u673a\u5236<\/h2>\n<ul>\n<li>\n<p>\u914d\u7f6e\u6587\u4ef6&#xff1a;audio_policy_configuration.xml&#xff08;\u8def\u5f84&#xff1a;\/vendor\/etc\/&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5173\u952e\u914d\u7f6e\u9879&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u8bbe\u5907\u5b9a\u4e49&#xff08;\u626c\u58f0\u5668\/\u8033\u673a\/\u84dd\u7259A2DP&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u97f3\u91cf\u66f2\u7ebf&#xff08;\u4e0d\u540c\u8bbe\u5907\u7684\u6700\u5927\/\u6700\u5c0f\u97f3\u91cf\u6620\u5c04&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u7b56\u7565\u89c4\u5219&#xff08;\u5982&#034;\u5a92\u4f53\u64ad\u653e\u65f6\u63d2\u5165\u8033\u673a\u81ea\u52a8\u5207\u6362&#034;&#xff09;<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u52a8\u6001\u7b56\u7565&#xff1a;\u901a\u8fc7\u00a0AudioManager.setPreferredDevice()\u00a0\u5141\u8bb8\u5e94\u7528\u4e34\u65f6\u8986\u76d6\u8def\u7531<\/p>\n<\/li>\n<\/ul>\n<h2>5.\u00a0\u5178\u578b\u573a\u666f\u5206\u6790<\/h2>\n<p>\u573a\u666f&#xff1a;\u6765\u7535\u6253\u65ad\u97f3\u4e50\u64ad\u653e<\/p>\n<p>(1)\u7535\u8bdd\u5e94\u7528\u8bf7\u6c42\u00a0AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE<\/p>\n<p>(2)APS \u6682\u505c\u97f3\u4e50\u64ad\u653e\u6d41&#xff08;\u53d1\u9001\u00a0AUDIOFOCUS_LOSS_TRANSIENT&#xff09;<\/p>\n<p>(3)\u5207\u6362\u97f3\u9891\u8def\u7531\u5230\u542c\u7b52\/\u84dd\u7259\u8033\u673a<\/p>\n<p>(4)\u901a\u8bdd\u7ed3\u675f\u6062\u590d\u97f3\u4e50\u64ad\u653e&#xff08;\u81ea\u52a8\u8def\u7531\u56de\u539f\u8bbe\u5907&#xff09;<\/p>\n<h2>6.\u00a0\u6027\u80fd\u4e0e\u5ef6\u8fdf\u4f18\u5316<\/h2>\n<ul>\n<li>\n<p>\u5f02\u6b65\u547d\u4ee4\u5904\u7406&#xff1a;\u901a\u8fc7\u00a0AudioCommandThread\u00a0\u961f\u5217\u5904\u7406\u8def\u7531\u5207\u6362&#xff0c;\u907f\u514d\u963b\u585e\u4e3b\u7ebf\u7a0b<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u5907\u70ed\u5207\u6362\u5ef6\u8fdf&#xff1a;\u84dd\u7259\u8bbe\u5907\u5207\u6362\u901a\u5e38\u9700 200-500ms&#xff08;\u53d7\u9650\u4e8e A2DP \u534f\u8bae\u6808&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u7f13\u5b58\u673a\u5236&#xff1a;\u5e38\u7528\u8f93\u51fa\u6d41\u4fdd\u6301\u6253\u5f00\u72b6\u6001\u51cf\u5c11\u5ef6\u8fdf<\/p>\n<\/li>\n<\/ul>\n<h2>7.\u5382\u5546\u5b9a\u5236\u8981\u70b9<\/h2>\n<ul>\n<li>\n<p>HAL \u6269\u5c55&#xff1a;\u5b9e\u73b0\u00a0audio_policy\u00a0HAL \u63a5\u53e3\u652f\u6301\u7279\u6b8a\u786c\u4ef6<\/p>\n<\/li>\n<li>\n<p>\u7b56\u7565\u8986\u76d6&#xff1a;\u91cd\u5199\u00a0AudioPolicyManager::getDeviceForStrategy()\u00a0\u4fee\u6539\u8def\u7531\u903b\u8f91<\/p>\n<\/li>\n<li>\n<p>\u8c03\u8bd5\u5de5\u5177&#xff1a;<\/p>\n<\/li>\n<\/ul>\n<p><span style=\"color:#fe2c24\">adb shell dumpsys media.audio_policy<\/span>  # \u83b7\u53d6\u5b8c\u6574\u7b56\u7565\u72b6\u6001<\/p>\n<h2>8.\u6311\u6218\u4e0e\u6f14\u8fdb<\/h2>\n<ul>\n<li>\n<p>\u591a\u8bbe\u5907\u534f\u540c&#xff1a;Android 13 \u5f15\u5165\u00a0AudioDeviceBroker\u00a0\u7edf\u4e00\u7ba1\u7406 LE Audio\/\u591a\u8bbe\u5907\u8f93\u51fa<\/p>\n<\/li>\n<li>\n<p>\u4f4e\u5ef6\u8fdf\u8def\u7531&#xff1a;AAudio API \u652f\u6301\u7ed5\u8fc7\u7b56\u7565\u76f4\u63a5\u8bbf\u95ee\u4f4e\u5ef6\u8fdf\u8def\u5f84<\/p>\n<\/li>\n<li>\n<p>\u8f66\u8f7d\u7cfb\u7edf\u6269\u5c55&#xff1a;\u652f\u6301\u591a\u533a\u72ec\u7acb\u97f3\u9891\u7b56\u7565&#xff08;Android Automotive&#xff09;<\/p>\n<\/li>\n<\/ul>\n<h2>9.AudioPolicyService\u521d\u59cb\u5316\u6d41\u7a0b<\/h2>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u9996\u5148\u5728main_audioserver.cpp\u7684main\u51fd\u6570\u4e2d\u8c03\u7528instantiate()\u65b9\u6cd5&#xff0c;\u641c\u4e86\u4e0b\u5e76\u6ca1\u6709\u5b9e\u73b0\u8be5\u65b9\u6cd5&#xff0c;\u63a8\u65ad\u4ece\u7236\u7c7b\u4e2d\u7ee7\u627f,\u7ee7\u627f\u4e86BinderService\u7684instantiate()\u3002<\/p>\n<p>int main(int argc __unused, char **argv)<br \/>\n{<br \/>\n&#8230;<br \/>\n        sp&lt;IServiceManager&gt; sm &#061; defaultServiceManager();<br \/>\n&#8230;<br \/>\n        AudioFlinger::instantiate();<br \/>\n        AudioPolicyService::instantiate();<br \/>\n&#8230;<br \/>\n}<\/p>\n<p>\u6700\u7ec8\u8fd4\u56de\u4e00\u4e2amedia.audio_policy\u7684\u670d\u52a1\u3002<\/p>\n<p>\u00a0static const char *getServiceName() ANDROID_API { return &#034;media.audio_policy&#034;; }<\/p>\n<p>\u5728AudioPolicyService\u7684\u6784\u9020\u51fd\u6570\u4e2d&#xff0c;\u4ec5\u505a\u4e86\u521d\u59cb\u5316\u5de5\u4f5c<\/p>\n<p>AudioPolicyService::AudioPolicyService()<br \/>\n    : BnAudioPolicyService(),<br \/>\n      mAudioPolicyManager(NULL),<br \/>\n      mAudioPolicyClient(NULL),<br \/>\n      mPhoneState(AUDIO_MODE_INVALID),<br \/>\n      mCaptureStateNotifier(false) {<br \/>\n}<\/p>\n<p>\u7531\u4e8esm\u662fsp&lt;IServiceManager&gt;\u5f3a\u5f15\u7528\u7c7b\u578b\u7684\u6307\u9488&#xff0c;\u6240\u4ee5\u5728\u7b2c\u4e00\u6b21\u8c03\u7528AudioPolicyService\u6a21\u5757\u65f6&#xff0c;\u4f1a\u8c03\u7528AudioPolicyService::onFirstRef()<\/p>\n<p>void AudioPolicyService::onFirstRef()<br \/>\n{<br \/>\n    {<br \/>\n        Mutex::Autolock _l(mLock);<\/p>\n<p>        \/\/ start audio commands thread<br \/>\n        mAudioCommandThread &#061; new AudioCommandThread(String8(&#034;ApmAudio&#034;), this);<br \/>\n        \/\/ start output activity command thread<br \/>\n        mOutputCommandThread &#061; new AudioCommandThread(String8(&#034;ApmOutput&#034;), this);<\/p>\n<p>        mAudioPolicyClient &#061; new AudioPolicyClient(this);<br \/>\n        mAudioPolicyManager &#061; createAudioPolicyManager(mAudioPolicyClient);<br \/>\n    }<br \/>\n    \/\/ load audio processing modules<br \/>\n    sp&lt;AudioPolicyEffects&gt; audioPolicyEffects &#061; new AudioPolicyEffects();<br \/>\n    sp&lt;UidPolicy&gt; uidPolicy &#061; new UidPolicy(this);<br \/>\n    sp&lt;SensorPrivacyPolicy&gt; sensorPrivacyPolicy &#061; new SensorPrivacyPolicy(this);<br \/>\n    {<br \/>\n        Mutex::Autolock _l(mLock);<br \/>\n        mAudioPolicyEffects &#061; audioPolicyEffects;<br \/>\n        mUidPolicy &#061; uidPolicy;<br \/>\n        mSensorPrivacyPolicy &#061; sensorPrivacyPolicy;<br \/>\n    }<br \/>\n    uidPolicy-&gt;registerSelf();<br \/>\n    sensorPrivacyPolicy-&gt;registerSelf();<br \/>\n}<\/p>\n<p>\u5728onFirstRef\u4e2d&#xff0c;\u521b\u5efa\u4e86mAudioCommandThread&#xff0c;mOutputCommandThread,mAudioPolicyClient&#xff0c;\u4ee5\u53camAudioPolicyManager\u3002<\/p>\n<p>createAudioPolicyManager\u65b9\u6cd5\u4e2d\u4f20\u5165\u4e86\u4e0a\u4e00\u6b65\u521b\u5efa\u7684mAudioPolicyClient\u3002<\/p>\n<p>\u521b\u5efaAudioPolicyManager\u5bf9\u8c61\u65f6&#xff0c;\u9996\u5148\u4f1a\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6&#xff0c;\u4f4d\u7f6e\u5728\u5f00\u53d1\u7248\u7684vendor\/etc\/audio_policy_configuration.xml\u6216\/system\/etc\/audio_policy_configuration.xml&#xff0c;\u4ee3\u7801\u4e2d\u53ef\u5728\/frameworks\/av\/services\/audiopolicy\/config\u4e2d\u67e5\u627e&#xff0c;\u5177\u4f53\u5728\u4e0b\u4e00\u7bc7\u4e2d\u5206\u6790\u3002<\/p>\n<p>AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterface)<br \/>\n        : AudioPolicyManager(clientInterface, false \/*forTesting*\/)<br \/>\n{<br \/>\n    loadConfig();<br \/>\n}<\/p>\n<p>\u63a5\u4e0b\u6765\u8c03\u7528apm\u7684initialize()&#xff0c;\u6839\u636e\u4ece\u914d\u7f6e\u6587\u4ef6\u4e2d\u89e3\u6790\u51fa\u7684HwMoudle\u7684Name\u52a0\u8f7d\u5bf9\u5e94\u7684\u97f3\u9891\u786c\u4ef6\u6a21\u5757&#xff0c;\u6700\u7ec8\u8c03\u7528\u5230af\u7684loadHwModule()&#xff0c;\u540e\u9762\u6587\u7ae0\u4f1a\u7ee7\u7eed\u5206\u6790\u3002\u6211\u4eec\u53ef\u4ee5\u770b\u5230AudioPolicyService\u521d\u59cb\u5316\u65f6\u4f1a\u8c03\u7528\u5230af\u7684\u65b9\u6cd5&#xff0c;\u6240\u4ee5AudioFlinger\u521d\u59cb\u5316\u5728\u524d&#xff0c;AudioPolicyService\u5728\u540e\u3002<\/p>\n<p>audio_module_handle_t AudioPolicyService::AudioPolicyClient::loadHwModule(const char *name)<br \/>\n{<br \/>\n    sp&lt;IAudioFlinger&gt; af &#061; AudioSystem::get_audio_flinger();<br \/>\n    if (af &#061;&#061; 0) {<br \/>\n        ALOGW(&#034;%s: could not get AudioFlinger&#034;, __func__);<br \/>\n        return AUDIO_MODULE_HANDLE_NONE;<br \/>\n    }<\/p>\n<p>    return af-&gt;loadHwModule(name);<\/p>\n<p>\u6574\u4f53\u6d41\u7a0b\u5982\u4e0b&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"532\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250811130912-6899eb78bcd97.png\" width=\"1813\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb261\u6b21\u3002AudioPolicyService\uff08APS\uff09\u662f Android \u97f3\u9891\u7cfb\u7edf\u7684\uff0c\u8d1f\u8d23\u7ba1\u7406\u97f3\u9891\u8def\u7531\u3001\u8bbe\u5907\u5207\u6362\u3001\u97f3\u91cf\u7b56\u7565\u3001\u7b56\u7565\u51b2\u7a81\u89e3\u51b3\u7b49\u5173\u952e\u51b3\u7b56\u3002\u5b83\u4e0e AudioFlinger\uff08\u8d1f\u8d23\u97f3\u9891\u6570\u636e\u5904\u7406\uff09\u534f\u540c\u5de5\u4f5c\uff0c\u5171\u540c\u6784\u6210 Android \u97f3\u9891\u6846\u67b6\u7684\u6838\u5fc3\u3002<\/p>\n","protected":false},"author":2,"featured_media":52890,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[371],"topic":[],"class_list":["post-52892","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-371"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android\u97f3\u9891\u5b66\u4e60(\u4e5d)\u2014\u2014AudioPolicyService - \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\/52892.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android\u97f3\u9891\u5b66\u4e60(\u4e5d)\u2014\u2014AudioPolicyService - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb261\u6b21\u3002AudioPolicyService\uff08APS\uff09\u662f Android \u97f3\u9891\u7cfb\u7edf\u7684\uff0c\u8d1f\u8d23\u7ba1\u7406\u97f3\u9891\u8def\u7531\u3001\u8bbe\u5907\u5207\u6362\u3001\u97f3\u91cf\u7b56\u7565\u3001\u7b56\u7565\u51b2\u7a81\u89e3\u51b3\u7b49\u5173\u952e\u51b3\u7b56\u3002\u5b83\u4e0e AudioFlinger\uff08\u8d1f\u8d23\u97f3\u9891\u6570\u636e\u5904\u7406\uff09\u534f\u540c\u5de5\u4f5c\uff0c\u5171\u540c\u6784\u6210 Android \u97f3\u9891\u6846\u67b6\u7684\u6838\u5fc3\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/52892.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-11T13:09:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250811130912-6899eb788c6d1.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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/52892.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/52892.html\",\"name\":\"Android\u97f3\u9891\u5b66\u4e60(\u4e5d)\u2014\u2014AudioPolicyService - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-11T13:09:14+00:00\",\"dateModified\":\"2025-08-11T13:09:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/52892.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/52892.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/52892.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android\u97f3\u9891\u5b66\u4e60(\u4e5d)\u2014\u2014AudioPolicyService\"}]},{\"@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":"Android\u97f3\u9891\u5b66\u4e60(\u4e5d)\u2014\u2014AudioPolicyService - \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\/52892.html","og_locale":"zh_CN","og_type":"article","og_title":"Android\u97f3\u9891\u5b66\u4e60(\u4e5d)\u2014\u2014AudioPolicyService - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb261\u6b21\u3002AudioPolicyService\uff08APS\uff09\u662f Android \u97f3\u9891\u7cfb\u7edf\u7684\uff0c\u8d1f\u8d23\u7ba1\u7406\u97f3\u9891\u8def\u7531\u3001\u8bbe\u5907\u5207\u6362\u3001\u97f3\u91cf\u7b56\u7565\u3001\u7b56\u7565\u51b2\u7a81\u89e3\u51b3\u7b49\u5173\u952e\u51b3\u7b56\u3002\u5b83\u4e0e AudioFlinger\uff08\u8d1f\u8d23\u97f3\u9891\u6570\u636e\u5904\u7406\uff09\u534f\u540c\u5de5\u4f5c\uff0c\u5171\u540c\u6784\u6210 Android \u97f3\u9891\u6846\u67b6\u7684\u6838\u5fc3\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/52892.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-11T13:09:14+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250811130912-6899eb788c6d1.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/52892.html","url":"https:\/\/www.wsisp.com\/helps\/52892.html","name":"Android\u97f3\u9891\u5b66\u4e60(\u4e5d)\u2014\u2014AudioPolicyService - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-11T13:09:14+00:00","dateModified":"2025-08-11T13:09:14+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/52892.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/52892.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/52892.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Android\u97f3\u9891\u5b66\u4e60(\u4e5d)\u2014\u2014AudioPolicyService"}]},{"@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\/52892","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=52892"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/52892\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/52890"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=52892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=52892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=52892"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=52892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}