自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
技术详情
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
下图展示了与拨号器交互的系统组件:

图 1. 与拨号器交互的组件
-
系统界面:降低导航 Facet 来托管“电话”按钮,这会注册 intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;package=com.android.car.dialer;launchFlags=0x10000000;end
intent。这会启动用户的主 Activity,即 TelecomActivity
。
-
应用启动器:管理整个应用列表。拨号器使用 android.intent.category.LAUNCHER
声明 TelecomActivity。从启动器的应用列表中选择手机应用会显示 TelecomActivity。
-
主屏幕微件:在 AOSP 参考中,没有主屏幕微件。OEM 可能需要考虑为拨号器添加一个主屏幕 widget,以显示当前已连接手机的状态(以及其他信息)。
-
通知中心
-
收到来电时,系统会显示浮动通知 (HUN)。当拨号器 InCallServiceImpl
收到来电时,拨号器会将 HUN 发布到通知中心,HUN 会显示来电详情(例如电话号码或联系信息)。拨号器还会显示两个操作按钮:“接听”和“挂断”。点按“接听”按钮即可接听来电,并且 InCallServiceImpl
会处理活跃通话以显示拨号器的通话界面并关闭 HUN。点击 HUN 时会显示全屏通话页面,其中包含“接听”和“挂断”按钮。
-
如有未读的未接来电提醒,系统会显示通知。点击通知会显示“通话记录”页面,并将未接来电标记为已读。点按“回拨”按钮可拨打电话并显示拨号器的通话界面。
-
助理:用户可以让智能助理拨打电话,它可以显示拨号器的通话界面。
-
Google 地图:从 Google 地图中致电商家时,系统会发送 DIAL intent 以及电话号码的额外信息,这会启动拨号键盘页面以供快速拨号。
-
CarInputService:监控方向盘上“通话”和“结束通话”实体按键。按键对应的操作如下:
-
当没有来电时,按下方向盘上的“通话”按钮会发送 DIAL intent 并显示拨号器的拨号键盘页面。
-
当有来电时,按下方向盘上的“通话”按钮会使 TelecomManager 接听来电。
-
当有来电时,按下方向盘上的“结束通话”按钮会使 TelecomManager 挂断电话。
-
蓝牙
-
PBAPClient。从手机下载联系人并将其写入联系人提供程序。对于连接的每部手机,系统会创建一个账号,并以设备的蓝牙 MAC 地址作为账号名称,以 com.android.bluetooth.pbapsink
(packages/apps/Bluetooth
中定义的 @string/pbap_account_type
)作为账号类型。写入联系人提供程序的联系人会使用账号信息写入,并在手机断开连接时清除。PBAPClient
不与拨号器直接交互,而是将联系人写入联系人提供程序。拨号器从联系人提供程序读取联系人。
-
HfpClientConnectionService
:通过 HFP 管理蓝牙通话,并向 Telecom 服务程序报告来电。
-
Telecom:Android Telecom 框架管理 Android 设备上的音频和视频通话。由于拨号器是默认手机应用,因此它实现了 InCallService
API,而 InCallController
会绑定拨号器的 InCallService 实现来处理通话。如需了解详情,请参阅创建替代电话应用和成为默认电话应用。
-
系统设置:拨号器会监控已连接 HFP 的设备列表,并会在没有手机通过蓝牙连接到拨号器时显示错误消息。在 AOSP 参考中,“连接到蓝牙”按钮会将用户链接到系统“蓝牙设置”页面,以配对新设备或连接到配对的设备。
-
防止驾驶员分心的引擎:此 Android 系统服务根据汽车的行驶状态施加用户体验限制。拨号器必须执行所有防止驾驶员分心的用户体验限制。为此,拨号器必须监听 CarUXRestrictionManager 并实现所有政策。拨号器必须:
用户流
拨号器主页面
下面提供了拨号器的各个页面。

图 2.拨号器主页面
来电处理
来电处理流程如下所示:

图 3.来电处理
通知
各个通知页面如下所示:

图 4.通知
通话状态
通话页面流程如下所示:

图 5. 通话页面
搜索
搜索界面如下所示:

图 6.搜索
设置
“设置”选项如下所示:

图 7.设置
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Technical details\n\nThe following diagram illustrates the system components that interact with Dialer:\n\n**Figure 1.** Components that interact with Dialer\n\n- **System UI.** Lower navigation facet to host the Phone button, which\n registers the `intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;package=com.android.car.dialer;launchFlags=0x10000000;end` intent.\n This starts the user's main activity, `TelecomActivity`.\n\n- **App Launcher.** Manages the entire app list. Dialer declares\n TelecomActivity with `android.intent.category.LAUNCHER`. Selecting the phone app from\n the launcher's app list displays TelecomActivity.\n\n- **Home widget.** In AOSP reference, there is no Home widget. OEMs might want to\n consider adding a Home widget for Dialer to display the state of the current connected phone (as\n well as other information).\n\n- **Notification Center**\n\n - **Heads Up Notification (HUN) is displayed for incoming calls.** When the Dialer\n `InCallServiceImpl` receives an incoming call, Dialer posts a HUN to the\n Notification center, which shows the call details, such as phone number or contact info.\n Dialer also displays two action buttons, Answer and Decline. By tapping Answer button,\n the call is answered and `InCallServiceImpl` handles the active call to show\n Dialer's in call UI and dismisses the HUN. Clicking on the HUN displays the fullscreen\n InCall page with the Answer and Reject buttons.\n\n - **Notification appears for unread missed calls.** Clicking on the\n notification displays the Call History page and marks missed calls as read. Tapping the\n Call Back button places a call and displays the Dialer's InCall user interface.\n\n- **Assistant.** Users can ask an assistant to make a call that may display the\n Dialer InCall user interface.\n\n- **Google Maps.**Calling a merchant from Google Maps sends the DIAL\n intent with extras of phone numbers which will start Dialpad page for quick dialing.\n\n- **CarInputService.**Monitors the physical key of the Call and End Call\n buttons on the steering wheel. Pressing the:\n\n - Call button from the steering wheel when there is no incoming call sends the DIAL\n intent and displays the Dialpad page of Dialer.\n\n - Call button from the steering wheel when there is an incoming call causes the\n TelecomManager to answer the call.\n\n - End Call button from the steering wheel when there is an incoming call, the\n TelecomManager ends the call.\n\n- **Bluetooth**\n\n - **PBAPClient.** Downloads contacts from a phone and writes to the\n contacts provider. For each phone connected, an account is created with the device's\n Bluetooth MAC address as the account name and `com.android.bluetooth.pbapsink`\n (`@string/pbap_account_type` defined in `packages/apps/Bluetooth`) as\n the account type. Contacts written to the contacts provider are written with the account\n information and are cleared when the phone is disconnected. `PBAPClient` doesn't\n interact directly with Dialer but instead writes contacts to the Contacts Provider. Dialer\n reads the contacts from the Contacts Provider.\n\n - **`HfpClientConnectionService`.** Manages the Bluetooth call\n through HFP and reports the call to the Telecom services.\n\n- **Telecom.** The Android Telecom framework manages audio and video calls on an\n Android device. Since Dialer is the default phone app, it implements the\n [InCallService](https://developer.android.com/reference/android/telecom/InCallService.html)\n APIs and `InCallController` will bind the Dialer's InCallService implementation to\n handle calls. For more details, see\n [Create\n a replacement phone app](https://developer.android.com/guide/topics/connectivity/telecom#replacePhoneApp) and\n [Becoming\n the Default Phone App](https://developer.android.com/reference/android/telecom/InCallService.html#becoming-the-default-phone-app).\n\n- **System Settings.** Dialer monitors the HFP-connected device list and displays\n an error message when no phones are connected to dialer through Bluetooth. In the AOSP\n reference, the Connect to Bluetooth button links users to the system Bluetooth Settings\n page to pair a new device or to connect to a paired device.\n\n- **Driver Distraction Engine.** This Android system service imposes UX\n restrictions based on the driving state of the car. Dialer must execute all UX driving\n distraction restrictions.To do so, Dialer must listen to the\n [CarUXRestrictionManager](https://developer.android.com/reference/android/car/drivingstate/CarUxRestrictionsManager)\n and implement all policies. Dialer must:\n\n - Connect to the [Car](https://developer.android.com/reference/android/car/Car)\n library and obtain an instance of\n [CarUXRestrictionManager](https://developer.android.com/reference/android/car/drivingstate/CarUxRestrictionsManager).\n\n - Subscribe to updates in the list of\n [CarUxRestrictions](https://developer.android.com/reference/android/car/drivingstate/CarUxRestrictions)\n and implement them as documented.\n\n - Of particular importance to Dialer:\n\n - **Settings page is vehicle-optimized.** User could not access the\n Dialer Settings page when driving. By tapping on the Settings menu from the action bar,\n a blocking screen is displayed to prevent the user from accessing Settings while\n driving. If the Settings page is already displayed, the blocking screen will pop up to\n stop the user interaction.\n\n - **System settings cannot be accessed while driving.** On the Error page,\n when no Bluetooth devices are connected, a Connect to Bluetooth button displays the\n system Bluetooth settings page. The UXR of this button is fully restricted.\n While driving, clicking on this button displays an error message to inform the\n user to park the car first and then perform the action.\n\n - **User cannot start the add-to-favorite flow while driving.** The Add a\n Favorite button is disabled.\n\nUser flows\n----------\n\n### Dialer Main\n\nThe different pages for Dialer are provided below.\n\n**Figure 2.** Main Dialer page\n\n### Call handling\n\nThe call handing process flow is presented below:\n\n**Figure 3.** Call handling\n\n### Notifications\n\nThe different notifications pages are displayed below:\n\n**Figure 4.** Notifications\n\n### InCall status\n\nThe InCall page flow is shown below:\n\n**Figure 5.** InCall page\n\n### Search\n\nThe Search displays are:\n\n**Figure 6.** Search\n\n### Settings\n\nThe Settings options are:\n\n**Figure 7.** Settings"]]