| <html devsite> |
| <head> |
| <title>Carrier Identification</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. |
| --> |
| |
| {% include "_versions.html" %} |
| |
| <p> |
| Devices running Android {{ androidPVersionNumber }} and higher can |
| recognize subscription carrier information to provide an ID and a |
| carrier name. Android maintains a carrier ID database with matching |
| rules for each carrier and its unique carrier ID. AOSP includes the |
| content of the carrier ID database, in the file |
| <a |
| href="https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/master/assets/carrier_list.textpb" |
| class="external"><code>android/packages/providers/TelephonyProvider/assets/carrier_list.textpb</code></a>. |
| The unified database minimizes duplicate logic in apps that need to |
| identify carriers and limits the exposure of carrier-identifying |
| attributes. |
| </p> |
| |
| <p> |
| To improve the coverage and accuracy of carrier identification, Android |
| supports out-of-band carrier ID table updates. Each update comes with |
| a version number and is published to AOSP. |
| </p> |
| |
| <h2 id="implementation">Implementation</h2> |
| |
| <p> |
| Users who want to implement out-of-band updates can download the |
| <a |
| href="https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/master/assets/carrier_list.pb" |
| class="external"><code>carrier_list.pb</code></a> |
| binary from AOSP. To view the readable format of the table, see |
| <a |
| href="https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/master/assets/carrier_list.textpb" |
| class="external"><code>carrier_list.txtpb</code></a>. |
| </p> |
| |
| <p> |
| Place the updated carrier ID table in the |
| <code>/data/misc/carrierid/</code> data partition. If the updated |
| version is newer than the installed version, the device will persist |
| the table to the |
| <a |
| href="https://developer.android.com/reference/android/provider/Telephony.CarrierId" |
| class="external">carrier ID database</a>. The most recent |
| information from the carrier ID database will be picked up by the |
| public APIs |
| <a |
| href="https://developer.android.com/reference/android/telephony/TelephonyManager#getSimCarrierId()" |
| class="external"><code>getSimCarrierId()</code></a> and |
| <a |
| href="https://developer.android.com/reference/android/telephony/TelephonyManager#getSimCarrierIdName()" |
| class="external"><code>getSimCarrierIdName()</code></a>. |
| </p> |
| |
| </body> |
| </html> |