| <html devsite><head> |
| <title>APN 和 CarrierConfig</title> |
| <meta name="project_path" value="/_project.yaml"/> |
| <meta name="book_path" value="/_book.yaml"/> |
| </head> |
| <body> |
| <!-- |
| Copyright 2018 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <p>运营商可以在 Android 开源项目 (AOSP) 中更新其接入点名称 (APN) 信息及其特定于运营商的配置设置 (<a href="/devices/tech/config/carrier">CarrierConfig</a>)。</p> |
| |
| <h2 id="create-account">与您的公司电子邮件地址相关联的 Google 帐号</h2> |
| |
| <p>要更新 APN 信息或 CarrierConfig,您需要使用与有效的公司电子邮件地址相关联的 Google 帐号提交请求(例如,来自 Acme Company 公司的 APN 更新请求应来自于 [email protected] <em></em>之类的电子邮件地址)。</p> |
| <p>如果您没有与公司电子邮件地址相关联的 Google 帐号,请从浏览器中退出登录所有 Gmail 帐号(建议您使用无痕式窗口等无痕浏览功能,以免与其他帐号混淆),然后<a href="https://accounts.google.com/SignUpWithoutGmail?hl=zh-cn">使用您的公司电子邮件地址创建 Google 帐号</a>。</p> |
| |
| <aside class="caution"><strong>注意</strong>:请勿将任何 Gmail 帐号与这一新建的帐号相关联。</aside> |
| |
| <h2 id="local-environment">准备本地开发环境</h2> |
| |
| <p>如果您以前从未向 AOSP 提交过代码,则需要初始化您的编译环境,熟悉相关工具,并了解如何提交补丁程序:</p> |
| <ul> |
| <li><a href="/setup/build/initializing">搭建编译环境</a></li> |
| <li><a href="/setup/develop/">熟悉 Git 和 Repo</a></li> |
| <li><a href="/setup/build/downloading">下载源代码</a></li> |
| <li><a href="/setup/contribute/submit-patches">提交补丁程序</a></li> |
| </ul> |
| |
| <p>此外,我们强烈建议您使用 <a class="external" href="https://developers.google.com/issue-tracker/">Google Issue Tracker</a> 来跟踪更改。</p> |
| |
| <h2 id="file-a-bug">提交错误</h2> |
| |
| <ol> |
| <li>转到 <a class="external" href="https://issuetracker.google.com">issuetracker.google.com</a>,然后使用您的公司电子邮件地址登录(请参阅<a href="#create-account">与您的公司电子邮件地址相关联的 Google 帐号</a>)。</li> |
| <aside class="note"><strong>注意</strong>:如果这是您第一次登录,则需要接受相关许可。</aside> |
| <li>登录后,请点击屏幕左侧的<strong>创建问题</strong>。</li> |
| <li>在<strong>组件</strong>中,请依次选择<a class="external" href="https://issuetracker.google.com/issues/new?component=192705&template=845803" class="external"><strong>“Android Public Tracker”>“框架”</strong></a>。</li> |
| <li>在适当的情况下,继续进行 <a href="#apn-update1">APN 更新</a>或 <a href="#carrierconfig-update1">CarrierConfig 更新</a>,以输入标题和说明。</li> |
| </ol> |
| |
| <h3 id="apn-update1">APN 错误</h3> |
| |
| <p>请按照如下方式设置错误属性:</p> |
| <p><strong>标题</strong>:添加/修改/移除 CarrierXYZ 的 APN<em></em><em></em><em></em></p> |
| <p><strong>说明</strong>:请添加关于您所请求更改的详细说明,其中包括 APN 设置本身。</p> |
| |
| <h3 id="carrierconfig-update1">CarrierConfig 错误</h3> |
| |
| <p>请按照如下方式设置错误属性:</p> |
| <p><strong>标题</strong>:CarrierXYZ 的配置更改</p> |
| <p><strong>描述</strong>:请添加关于您所请求更改的详细说明。</p> |
| |
| <h2 id="submit-changes">提交更改</h2> |
| |
| <p>要进行更改,请执行以下步骤:</p> |
| <ol> |
| <li>确定要更改的文件。</li> |
| <li>对相应的文件进行更改。</li> |
| <li>请按照<a href="/setup/contribute/submit-patches#make-your-change">提交补丁程序</a>的相关说明操作,将相关更改提交到本地代码库,并请注意提交消息指南(包括建议的格式)。</li> |
| <li>将更改提交到您的个人历史记录后,请使用 <code>repo upload</code> 命令将其上传到 Gerrit。</li> |
| <li>上传成功后,Repo 会提供 Gerrit 上新网页的网址。请使用此网址执行以下操作: |
| <ul> |
| <li>在审核服务器上查看您的补丁程序</li> |
| <li>添加注释</li> |
| <li>为您的补丁程序申请特定审核者</li> |
| </ul> |
| </li> |
| </ol> |
| |
| <aside class="note"><b>注意</b>:向 AOSP 提交 APN 和 CarrierConfig 更改并不能保证 OEM 一定会接受这些更改。运营商应与 OEM 合作,以便在其设备上进行所需更改。</aside> |
| |
| <h3 id="apn-update2">APN 语法</h3> |
| |
| <p><strong>Android 项目名称</strong> - device/sample</p> |
| <p><strong>文件名</strong> - etc/apns-full-conf.xml(<a class="external" href="https://android.googlesource.com/device/sample/+/master/etc/apns-full-conf.xml">Google Git 主链接</a>)</p> |
| <p>该文件包含 XML 格式的 APN 设置,并充当示例文件,因此 Android 设备的行为不会发生任何变化。</p> |
| <p>典型的 APN 配置如下所示:</p> |
| |
| <pre class="prettyprint"><apn carrier="CarrierXYZ" |
| mcc="123" |
| mnc="123" |
| apn="carrierxyz" |
| type="default,supl,mms,ims,cbs" |
| mmsc="http://mms.carrierxyz.com" |
| mmsproxy="0.0.0.0" |
| mmsport="80" |
| bearer_bitmask="4|5|6|7|8|12" |
| /> |
| </pre> |
| |
| <h4 id="testing">测试</h4> |
| <ol> |
| <li>连接您拥有 root 权限的任何 Android 设备。</li> |
| <li>将设置添加到 /etc/apns-conf.xml。</li> |
| <li>重置 APN 设置。</li> |
| <li>在 APN 设置中,确认已正确加载配置文件。</li> |
| <li>对于每个配置文件,都请测试数据连接、WLAN 热点和 MMS,以确保其能够正常运行。</li> |
| </ol> |
| |
| <h4 id="commit-message">提交消息</h4> |
| |
| <pre class="devsite-click-to-copy">[Example - "Add CarrierXYZ apns to sample apns"] |
| Bug: [Issue ID from Google Issue Tracker] |
| Test: No change to behavior as this is only a sample file |
| </pre> |
| |
| <h4 id="sample">示例 CL</h4> |
| <p>要获取示例 CL,请参阅<a class="external" href="https://android-review.googlesource.com/c/device/sample/+/532609">示例 BICS APN</a>。</p> |
| |
| <h3 id="carrierconfig-update2">CarrierConfig 语法</h3> |
| |
| <p><b>项目名称</b> - platform/packages/apps/CarrierConfig</p> |
| <p><b>文件名</b> - assets/carrier_config_<mccmnc>.xml(<a class="external" href="https://android.googlesource.com/platform/packages/apps/CarrierConfig/+/master/assets">Google Git 主链接</a>)</mccmnc></p> |
| <p>根据相关的 MCC/MNC 元组确认资源文件夹中的相关 XML 文件。该文件包含 XML 格式的运营商配置对象。系统会在 <a class="external" href="https://developer.android.com/reference/android/telephony/CarrierConfigManager.html">CarrierConfigManager</a> 下将属性名称定义为键,并使用后缀指明值的类型 (int/string/bool)。</p> |
| <p>典型的 int/string/bool 属性如下所示:</p> |
| |
| <pre class="prettyprint"><int name="vvm_port_number_int" value="5499" /> |
| <string name="vvm_type_string">vvm_type_omtp</string > |
| <boolean name="vvm_cellular_data_required_bool" value="true" /> |
| </pre> |
| |
| <h4 id="commit-message">提交消息</h4> |
| |
| <pre class="devsite-click-to-copy">[Example - "Add VVM settings for CarrierXYZ"] |
| |
| [Example - "Updated <mccmnc> carrier config file to include VVM settings |
| as defined by CarrierXYZ."] |
| |
| Bug: [Issue ID from Google Issue Tracker] |
| Test: [Testing notes] |
| </pre> |
| |
| <h4 id="sample">示例 CL</h4> |
| <p>要获取示例 CL,请参阅<a class="external" href="https://android-review.googlesource.com/c/platform/packages/apps/CarrierConfig/+/625835">经过更新的运营商配置文件</a>。</p> |
| |
| <h2 id="request-a-review">请求审核</h2> |
| |
| <p>要请求审核,请执行以下操作:</p> |
| <ul> |
| <li>转到相应更改的 Gerrit 网址,然后将“[email protected]”<em></em>添加为审核者。</li> |
| <li>您还可以将您的 Google 联系人添加到 Gerrit 上的抄送名单中。</li> |
| <li>为了进行跟踪,您可以将问题指派人更改为“[email protected]”。<em></em></li> |
| </ul> |
| |
| <p>在提交内容通过审核和验证流程之后,Gerrit 会自动将更改合并到公开代码库。其他用户可以运行 <code> repo sync </code> 以将更新提取到自己的本地客户端。</p> |
| <aside class="note"><strong>注意</strong>:对 APN 文件所做的更改不会自动生效,因为相应更改位于 device/sample 文件夹中。如果您正在与主要 OEM 合作,请确保他们可以从 AOSP 获取最新信息。一般情况下,OEM 会安排定期获取最新信息,但如果时间紧迫,您可以与 OEM 联系以建议他们尽快(而非延后)更新其列表。</aside> |
| |
| </body></html> |