{"id":434,"date":"2022-11-29T15:27:51","date_gmt":"2022-11-29T07:27:51","guid":{"rendered":"https:\/\/iichen.cn\/?p=434"},"modified":"2022-11-29T15:27:51","modified_gmt":"2022-11-29T07:27:51","slug":"android-aidl","status":"publish","type":"post","link":"https:\/\/iichen.cn\/?p=434","title":{"rendered":"Android-AIDL"},"content":{"rendered":"<h5>1. AIDL\u7b80\u5355\u4f7f\u7528<\/h5>\n<ul>\n<li><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/18805699674\/AidlServer\" title=\"AIDL\u670d\u52a1\u7aef\">AIDL\u670d\u52a1\u7aef<\/a><\/li>\n<li><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/18805699674\/AidlClient\" title=\"AIDL\u5ba2\u6237\u7aef\">AIDL\u5ba2\u6237\u7aef<\/a><\/li>\n<\/ul>\n<h5>2. in\u3001out\u3001inout\u7684\u533a\u522b<\/h5>\n<blockquote><p>\n  <strong>in \u8868\u793a\u5ba2\u6237\u7aef\u4f20\u5165\u7684\u53c2\u6570 (\u5982\uff1abook\uff09, \u670d\u52a1\u7aef\u53ef\u4ee5\u5b8c\u6574\u63a5\u53d7\u5230\u6539\u5bf9\u8c61\uff0c\u4f46\u5bf9\u5176\u4fee\u6539\u4e0d\u4f1a\u4f1a\u540c\u6b65\u5230 \u5ba2\u6237\u7aef\u4f20\u5165\u7684\u53c2\u6570\u5bf9\u8c61<\/strong><\/p>\n<p>  <strong>out \u8868\u793a\u5ba2\u6237\u7aef\u4f20\u5165\u7684\u53c2\u6570 (\u5982\uff1abook), \u670d\u52a1\u7aef\u63a5\u53d7\u5230\u7684\u5bf9\u8c61\u4e3a\u7a7a\u5bf9\u8c61\uff0c\u5e76\u4e14\u670d\u52a1\u7aef\u91cd\u65b0new\u4fee\u6539\u6539\u5bf9\u8c61\uff0c\u5e76\u4e0d\u4f1a\u5f71\u54cd\u5ba2\u6237\u7aef\u4f20\u5165\u7684\u53c2\u6570\u5bf9\u8c61<\/strong><\/p>\n<p>  <strong>inout\u8868\u793a\u5ba2\u6237\u7aef\u4f20\u5165\u7684\u53c2\u6570 (\u5982\uff1abook\uff09, \u670d\u52a1\u7aef\u53ef\u4ee5\u5b8c\u6574\u63a5\u53d7\u5230\u6539\u5bf9\u8c61\uff0c\u5e76\u4e14\u5bf9\u5176\u4fee\u6539\u4f1a\u540c\u6b65\u5230 \u5ba2\u6237\u7aef\u4f20\u5165\u7684\u53c2\u6570\u5bf9\u8c61<\/strong>\n<\/p><\/blockquote>\n<pre><code class=\"language-java line-numbers\">\/\/ BookManager.aidl\n    interface BookManager {\n        \/\/\u4fdd\u8bc1\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u7aef\u662f\u8fde\u63a5\u4e0a\u7684\u4e14\u6570\u636e\u4f20\u8f93\u6b63\u5e38\n        List&lt;Book&gt; getBooks();\n\n        \/\/\u901a\u8fc7\u4e09\u79cd\u5b9a\u4f4dtag\u505a\u5bf9\u6bd4\u8bd5\u9a8c\uff0c\u89c2\u5bdf\u8f93\u51fa\u7684\u7ed3\u679c\n        Book addBookIn(in Book book);\n        Book addBookOut(out Book book);\n        Book addBookInout(inout Book book);\n    }\n<\/code><\/pre>\n<pre><code class=\"language-java line-numbers\">    @Override\n    public Book addBookIn(Book book) throws RemoteException {\n        synchronized (this) {\n            \/\/ xxx\n            \/\/\u8fd9\u91cc\u4fee\u6539\u4e86\u5e76\u4e0d\u5f71\u54cd\u5ba2\u6237\u7aefbook\u5bf9\u8c61\uff0c\u5ba2\u6237\u7aef\u7684\u53c2\u6570\u5bf9\u8c61book\u7684price\u5c5e\u6027\u4e0d\u4f1a\u88ab\u4fee\u6539\u4e3a2333\n            book.setPrice(2333);\n            if (!mBooks.contains(book)) {\n                mBooks.add(book);\n            }\n            return book;\n        }\n    }\n\n    @Override\n    public Book addBookOut(Book book) throws RemoteException {\n        synchronized (this) {\n            \/\/ xxx\n            \/\/ \u5373\u4f7f\u5ba2\u6237\u7aef\u4f20\u5165\u7684book\u5bf9\u8c61\u4e0d\u662f\u7a7a\u5bf9\u8c61\uff0c\u8fd9\u91cc\u7684book\u4e5f\u4f1a\u662f\u7a7a\u5bf9\u8c61\n            if(book == null){\n                Log.e(TAG , \"Book is null in Out\");\n                book = new Book();\n            }\n            book.setPrice(2333);\n            if (!mBooks.contains(book)) {\n                mBooks.add(book);\n            }\n            return book;\n        }\n    }\n\n    @Override\n    public Book addBookInout(Book book) throws RemoteException {\n        synchronized (this) {\n            \/\/ xxx\n            if(book == null){\n                Log.e(TAG , \"Book is null in Inout\");\n                book = new Book();\n            }\n            \/\/\u8fd9\u91cc\u4fee\u6539\u4e86\u4f1a\u5f71\u54cd\u5ba2\u6237\u7aefbook\u5bf9\u8c61\uff0c\u5ba2\u6237\u7aef\u7684\u53c2\u6570\u5bf9\u8c61book\u7684price\u5c5e\u6027\u4e5f\u88ab\u4fee\u6539\u4e3a2333\n            book.setPrice(2333);\n            if (!mBooks.contains(book)) {\n                mBooks.add(book);\n            }\n            return book;\n        }\n    }\n<\/code><\/pre>\n<h5>3. oneway<\/h5>\n<pre><code class=\"language-java line-numbers\">interface IPlayer {\n    oneway void start();\/\/\u5f02\u6b65\uff0c\u5047\u8bbe\u6267\u884c2\u79d2  \u5f02\u6b65\u4e0d\u5b9a\u4e49\u8fd4\u56de\u503c\uff0c\u5ba2\u6237\u7aef\u4e0d\u4f7f\u7528\n    oneway void stop();\/\/\u5f02\u6b65\uff0c\u5047\u8bbe\u6267\u884c2\u79d2\n    int getVolume();\/\/ \u540c\u6b65\uff0c\u5047\u8bbe\u6267\u884c1\u79d2\n}\ninterface IPlayer2 {\n    oneway void start();\/\/\u5f02\u6b65\uff0c\u5047\u8bbe\u6267\u884c2\u79d2  \u5f02\u6b65\u4e0d\u5b9a\u4e49\u8fd4\u56de\u503c\uff0c\u5ba2\u6237\u7aef\u4e0d\u4f7f\u7528\n    oneway void stop();\/\/\u5f02\u6b65\uff0c\u5047\u8bbe\u6267\u884c2\u79d2\n    int getVolume();\/\/ \u540c\u6b65\uff0c\u5047\u8bbe\u6267\u884c1\u79d2\n}\n<\/code><\/pre>\n<blockquote><p>\n  \u4e24\u4e2a\u8fdb\u7a0b  \u4e0d\u80fd\u540c\u65f6\u8c03\u7528 IPlayer.start()\u548cIPlayer.stop(), \u9700\u8981\u6392\u961f\u6267\u884c<br \/>\n  \u4e24\u4e2a\u8fdb\u7a0b  \u80fd\u540c\u65f6\u8c03\u7528 IPlayer.start()\u548cIPlayer2.stop(), \u9700\u8981\u6392\u961f\u6267\u884c<\/p>\n<p>  \u5f02\u6b65\u8c03\u7528\u548c\u4e32\u884c\u5316\u5904\u7406\u3002\u5f02\u6b65\u8c03\u7528\u662f\u6307\u5e94\u7528\u5411 binder \u9a71\u52a8\u53d1\u9001\u6570\u636e\u540e\u4e0d\u9700\u8981\u6302\u8d77\u7ebf\u7a0b\u7b49\u5f85 binder \u9a71\u52a8\u7684\u56de\u590d\uff0c\u800c\u662f\u76f4\u63a5\u7ed3\u675f\u3002\u50cf\u4e00\u4e9b\u7cfb\u7edf\u670d\u52a1\u8c03\u7528\u5e94\u7528\u8fdb\u7a0b\u7684\u65f6\u5019\u5c31\u4f1a\u4f7f\u7528 oneway\uff0c\u6bd4\u5982 AMS \u8c03\u7528\u5e94\u7528\u8fdb\u7a0b\u542f\u52a8 Activity\uff0c\u8fd9\u6837\u5c31\u7b97\u5e94\u7528\u8fdb\u7a0b\u4e2d\u505a\u4e86\u8017\u65f6\u7684\u4efb\u52a1\uff0c\u4e5f\u4e0d\u4f1a\u963b\u585e\u7cfb\u7edf\u670d\u52a1\u7684\u8fd0\u884c<\/p>\n<p>  \u4e32\u884c\u5316\u5904\u7406\u662f\u6307\u5bf9\u4e8e\u4e00\u4e2a\u670d\u52a1\u7aef\u7684 AIDL \u63a5\u53e3\u800c\u8a00\uff0c\u6240\u6709\u7684 oneway \u65b9\u6cd5\u4e0d\u4f1a\u540c\u65f6\u6267\u884c\uff0cbinder \u9a71\u52a8\u4f1a\u5c06\u4ed6\u4eec\u4e32\u884c\u5316\u5904\u7406\uff0c\u6392\u961f\u4e00\u4e2a\u4e00\u4e2a\u8c03\u7528<\/p>\n<p>  \u6302\u8d77\u76f8\u5f53\u4e8e Thread \u7684 sleep\uff0c\u662f\u771f\u6b63\u7684&#8221;\u4f11\u7720&#8221;\uff0c\u5e95\u5c42\u8c03\u7528\u7684\u662f wait_event_interruptible() Linux \u7cfb\u7edf\u51fd\u6570\u3002Handler \u673a\u5236\u7684\u65f6\u5019\uff0cHandler \u4e2d\u6700\u5173\u952e\u7684\u5730\u65b9\u5c31\u662f Looper \u7684\u963b\u585e\u4e0e\u5524\u9192\uff0c\u963b\u585e\u662f\u8c03\u7528\u4e86 nativePollOnce() \u65b9\u6cd5\n<\/p><\/blockquote>\n<pre><code class=\"language-java line-numbers\">\/**\n * binder_proc_transaction() - sends a transaction to a process and wakes it up\n * @t:      transaction to send\n * @proc:   process to send the transaction to\n * @thread: thread in @proc to send the transaction to (may be NULL)\n *\/\nstatic bool binder_proc_transaction(struct binder_transaction *t,\n                    struct binder_proc *proc,\n                    struct binder_thread *thread)\n{\n    \/\/\u627e\u5230Server\u7aef\u7684\u5bf9\u5e94Binder\u670d\u52a1\u5728Binder\u9a71\u52a8\u4e2d\u5bf9\u5e94\u7684\u5bf9\u8c61binder_node\n    struct binder_node *node = t-&gt;buffer-&gt;target_node;\n    \/\/\u5224\u65ad\u8fd9\u6b21Binder\u8c03\u7528\u662f\u4e0d\u662foneway\n    bool oneway = !!(t-&gt;flags &amp; TF_ONE_WAY);\n    \/\/\u521d\u59cb\u5316\u4e3afalse\uff0c\u7528\u4e8e\u6807\u8bb0\u5f53\u524dServer\u7aef\u7684\u5bf9\u5e94Binder\u670d\u52a1\u662f\u5426\u6b63\u5728\u6267\u884coneway\u7684\u65b9\u6cd5\n    bool pending_async = false;\n\n    binder_node_lock(node);\n    \/\/oneway == true\n    if (oneway) {\n        if (node-&gt;has_async_transaction) {\n            \/\/\u7b2c2\u6b21oneway\u8c03\u7528\u6267\u884c\u8fd9\u91cc\n            \/\/\u53d1\u73b0\u5bf9\u5e94Binder\u670d\u52a1\u6b63\u5728\u6267\u884coneway\u7684\u65b9\u6cd5\uff0c\u8bbe\u7f6epending_async\u4e3atrue\n            pending_async = true;\n        } else {\n            \/\/\u7b2c1\u6b21oneway\u8c03\u7528\u6267\u884c\u8fd9\u91cc\n            \/\/\u53d1\u73b0\u5bf9\u5e94Binder\u670d\u52a1\u6ca1\u6709\u6267\u884coneway\u7684\u65b9\u6cd5\uff0c\u8bbe\u7f6ehas_async_transaction\u4e3a1\n            node-&gt;has_async_transaction = 1;\n        }\n    }\n\n    binder_inner_proc_lock(proc);\n\n    \/\/\u5982\u679c\u53d1\u73b0Server\u7aef\u5df2\u7ecf\u6b7b\u4ea1\uff0c\u5c31\u76f4\u63a5\u8fd4\u56de\u4e86\uff0c\u6b63\u5e38\u4e0d\u4f1a\u6267\u884c\n    if (proc-&gt;is_dead || (thread &amp;&amp; thread-&gt;is_dead)) {\n        binder_inner_proc_unlock(proc);\n        binder_node_unlock(node);\n        return false;\n    }\n\n    \/\/oneway\u7684\u8c03\u7528thread\u4e3a\u7a7a\uff0c\u7b2c1\u6b21oneway\u8c03\u7528\uff0cpending_async\u4e3afalse\n    if (!thread &amp;&amp; !pending_async)\n        \/\/\u7b2c1\u6b21oneway\u8c03\u7528\u4f1a\u627e\u5230\u4e00\u4e2a\u7a7a\u95f2\u7684Server\u7aef\u7ebf\u7a0b\uff0c\u7528\u4e8e\u54cd\u5e94\u8fd9\u6b21oneway\u8c03\u7528\n        thread = binder_select_thread_ilocked(proc);\n\n    if (thread) {\n        \/\/\u7b2c1\u6b21oneway\u8c03\u7528,thread\u4e0d\u4e3a\u7a7a\uff0c\u76f4\u63a5\u628a\u8fd9\u6b21Binder work\u653e\u5230thread\u7684\u5de5\u4f5c\u961f\u5217\u53bb\u6267\u884c\n        binder_enqueue_thread_work_ilocked(thread, &amp;t-&gt;work);\n    } else if (!pending_async) {\n        binder_enqueue_work_ilocked(&amp;t-&gt;work, &amp;proc-&gt;todo);\n    } else {\n        \/\/\u7b2c2\u6b21oneway\u8c03\u7528,thread\u4e3a\u7a7a\uff0cpending_async\u4e3atrue\uff0c\n        \/\/\u8fd9\u6b21Binder work\u653e\u5230Binder Node\u7684async_todo\u961f\u5217\u4e2d,\u4e0d\u4f1a\u7acb\u523b\u6267\u884c\n        binder_enqueue_work_ilocked(&amp;t-&gt;work, &amp;node-&gt;async_todo);\n    }\n\n    if (!pending_async)\n        \/\/\u7b2c1\u6b21oneway\u8c03\u7528\uff0cthread\u4e0d\u4e3a\u7a7a\uff0c\u6240\u4ee5\u9700\u8981\u5524\u9192thread\u6267\u884c\u5de5\u4f5c\u961f\u5217\u4e2d\u7684Binder work\n        binder_wakeup_thread_ilocked(proc, thread, !oneway \/* sync *\/);\n\n    binder_inner_proc_unlock(proc);\n    binder_node_unlock(node);\n\n    return true;\n}\n<\/code><\/pre>\n<blockquote><p>\n  \u91ca\u653e\u4e0e\u5524\u9192\u4e0b\u4e00\u4e2a\u4efb\u52a1\n<\/p><\/blockquote>\n<pre><code class=\"language-java line-numbers\">        case BC_FREE_BUFFER: {\n            \/\/\u51c6\u786e\u91ca\u653e\u8fdb\u7a0bB\u7533\u8bf7\u7684buffer\n            if (buffer-&gt;async_transaction &amp;&amp; buffer-&gt;target_node) {\n                struct binder_node *buf_node;\n                struct binder_work *w;\n                \/\/\u5148\u62ff\u5230\u8fd9\u5757buffer\u5904\u7406\u7684binder node\uff0c\u4e5f\u5c31\u662fIPlayer1\u5bf9\u5e94\u7684binder node\n                buf_node = buffer-&gt;target_node;\n                binder_node_inner_lock(buf_node);\n                \/\/\u68c0\u67e5\u4e00\u4e0bbuf_node\u662f\u5426\u6709\u672a\u5904\u7406\u7684oneway\u7684binder work\n                w = binder_dequeue_work_head_ilocked(\n                        &amp;buf_node-&gt;async_todo);\n                if (!w) {\n                    \/\/\u4e0d\u6267\u884c\n                    buf_node-&gt;has_async_transaction = 0;\n                } else {\n                    \/\/\u5982\u679c\u6709\u672a\u5904\u7406\u5b8c\u7684oneway\u7684binder work\uff0c\u5c31\u5c06binder node\u4fdd\u5b58\u7684async_todo\u5168\u90e8\u6dfb\u52a0\u5230\u8fdb\u7a0bA\u7684todo\u3002\n                    binder_enqueue_work_ilocked(\n                            w, &amp;proc-&gt;todo);\n                    \/\/\u5524\u9192\u4e00\u4e2a\u7ebf\u7a0b\u53bb\u5904\u7406todo\u4e2d\u7684binder work\uff0c\u4e5f\u5c31\u662f\u8fdb\u7a0bC\u7684IPlayer1.start()\n                    binder_wakeup_proc_ilocked(proc);\n                }\n                binder_node_inner_unlock(buf_node);\n            }\n            \/\/\u91ca\u653e\u8fdb\u7a0bB\u7533\u8bf7\u7684buffer\n            trace_binder_transaction_buffer_release(buffer);\n            binder_transaction_buffer_release(proc, buffer, NULL);\n            binder_alloc_free_buf(&amp;proc-&gt;alloc, buffer);\n            break;\n        }\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. AIDL\u7b80\u5355\u4f7f\u7528 AIDL\u670d\u52a1\u7aef AIDL\u5ba2\u6237\u7aef 2. in\u3001out\u3001inout\u7684\u533a\u522b in \u8868\u793a\u5ba2\u6237\u7aef [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,8],"tags":[],"class_list":["post-434","post","type-post","status-publish","format-standard","hentry","category-android","category-8"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android-AIDL - IIchen<\/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:\/\/iichen.cn\/?p=434\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android-AIDL - IIchen\" \/>\n<meta property=\"og:description\" content=\"1. AIDL\u7b80\u5355\u4f7f\u7528 AIDL\u670d\u52a1\u7aef AIDL\u5ba2\u6237\u7aef 2. in\u3001out\u3001inout\u7684\u533a\u522b in \u8868\u793a\u5ba2\u6237\u7aef [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/iichen.cn\/?p=434\" \/>\n<meta property=\"og:site_name\" content=\"IIchen\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-29T07:27:51+00:00\" \/>\n<meta name=\"author\" content=\"iichen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"iichen\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/iichen.cn\/?p=434#article\",\"isPartOf\":{\"@id\":\"https:\/\/iichen.cn\/?p=434\"},\"author\":{\"name\":\"iichen\",\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c\"},\"headline\":\"Android-AIDL\",\"datePublished\":\"2022-11-29T07:27:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/iichen.cn\/?p=434\"},\"wordCount\":41,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c\"},\"articleSection\":[\"Android\",\"\u7b14\u8bb0\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/iichen.cn\/?p=434#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/iichen.cn\/?p=434\",\"url\":\"https:\/\/iichen.cn\/?p=434\",\"name\":\"Android-AIDL - IIchen\",\"isPartOf\":{\"@id\":\"https:\/\/iichen.cn\/#website\"},\"datePublished\":\"2022-11-29T07:27:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/iichen.cn\/?p=434#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/iichen.cn\/?p=434\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/iichen.cn\/?p=434#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/iichen.cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android-AIDL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/iichen.cn\/#website\",\"url\":\"https:\/\/iichen.cn\/\",\"name\":\"IIchen\",\"description\":\"Just do it!\",\"publisher\":{\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/iichen.cn\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c\",\"name\":\"iichen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/iichen.cn\/wp-content\/uploads\/2025\/01\/avatar.jpg\",\"contentUrl\":\"https:\/\/iichen.cn\/wp-content\/uploads\/2025\/01\/avatar.jpg\",\"width\":940,\"height\":940,\"caption\":\"iichen\"},\"logo\":{\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/www.iichen.cn\"],\"url\":\"https:\/\/iichen.cn\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android-AIDL - IIchen","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:\/\/iichen.cn\/?p=434","og_locale":"zh_CN","og_type":"article","og_title":"Android-AIDL - IIchen","og_description":"1. AIDL\u7b80\u5355\u4f7f\u7528 AIDL\u670d\u52a1\u7aef AIDL\u5ba2\u6237\u7aef 2. in\u3001out\u3001inout\u7684\u533a\u522b in \u8868\u793a\u5ba2\u6237\u7aef [&hellip;]","og_url":"https:\/\/iichen.cn\/?p=434","og_site_name":"IIchen","article_published_time":"2022-11-29T07:27:51+00:00","author":"iichen","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"iichen","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/iichen.cn\/?p=434#article","isPartOf":{"@id":"https:\/\/iichen.cn\/?p=434"},"author":{"name":"iichen","@id":"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c"},"headline":"Android-AIDL","datePublished":"2022-11-29T07:27:51+00:00","mainEntityOfPage":{"@id":"https:\/\/iichen.cn\/?p=434"},"wordCount":41,"commentCount":0,"publisher":{"@id":"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c"},"articleSection":["Android","\u7b14\u8bb0"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/iichen.cn\/?p=434#respond"]}]},{"@type":"WebPage","@id":"https:\/\/iichen.cn\/?p=434","url":"https:\/\/iichen.cn\/?p=434","name":"Android-AIDL - IIchen","isPartOf":{"@id":"https:\/\/iichen.cn\/#website"},"datePublished":"2022-11-29T07:27:51+00:00","breadcrumb":{"@id":"https:\/\/iichen.cn\/?p=434#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/iichen.cn\/?p=434"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/iichen.cn\/?p=434#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/iichen.cn\/"},{"@type":"ListItem","position":2,"name":"Android-AIDL"}]},{"@type":"WebSite","@id":"https:\/\/iichen.cn\/#website","url":"https:\/\/iichen.cn\/","name":"IIchen","description":"Just do it!","publisher":{"@id":"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/iichen.cn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c","name":"iichen","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/iichen.cn\/#\/schema\/person\/image\/","url":"https:\/\/iichen.cn\/wp-content\/uploads\/2025\/01\/avatar.jpg","contentUrl":"https:\/\/iichen.cn\/wp-content\/uploads\/2025\/01\/avatar.jpg","width":940,"height":940,"caption":"iichen"},"logo":{"@id":"https:\/\/iichen.cn\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/www.iichen.cn"],"url":"https:\/\/iichen.cn\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/iichen.cn\/index.php?rest_route=\/wp\/v2\/posts\/434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iichen.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iichen.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iichen.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iichen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=434"}],"version-history":[{"count":0,"href":"https:\/\/iichen.cn\/index.php?rest_route=\/wp\/v2\/posts\/434\/revisions"}],"wp:attachment":[{"href":"https:\/\/iichen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iichen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iichen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}