多种核心设备功能(例如,读取通话记录和发送短信)都依赖于访问敏感的用户信息。为了保护用户隐私并让用户更好地控制他们为设备上的应用提供的信息,Google Play 会限制应用对与通话和短信相关的权限组的访问权。
如果您在 Google Play 商店分发应用,并想要访问与通话记录和短信相关的敏感用户信息,您的应用需要注册为与该权限相关的核心设备功能的用户默认处理程序,除非应用满足 Play 管理中心帮助中心内显示的任意一种例外情况。例如,为了获取与通话相关的权限,您的应用需要注册为用户的默认电话或 Google 助理处理程序,除非应用满足某种例外情况。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Permissions used only in default handlers\n\n| **Note:** This guide primarily applies to Android app developers who are publishing apps on the [Google Play Store](https://play.google.com/store/apps). However, to protect your users' privacy, it's best to complete the tasks described on this page regardless of where you publish your Android app.\n\nSeveral core device functions, such as reading call logs and sending SMS\nmessages, depend on access to sensitive user information. To protect user\nprivacy and provide users with more control over the information that they\nprovide to apps on their device, Google Play restricts apps' access to call-\nand messaging-related permission groups.\n\nIf you distribute your app on the Google Play Store and want to access sensitive\nuser information related to call logs and SMS messages, your app needs\nto be registered as the user's *default handler* for the core device function\nrelated to that permission, unless your app satisfies one of the\n[exception cases](https://support.google.com/googleplay/android-developer/answer/9047303#exceptions)\nthat appear in the Play Console Help Center. For example, to access\ncall-related permissions, your app needs to be registered as the user's default\nPhone or Assistant handler, unless your app satisfies an exception case.\n\nThis guide provides a brief overview of how users access default handlers on\nAndroid-powered devices. The guide then reviews the requirements that an app\nmust satisfy before becoming eligible to be a default handler. Finally, the\nguide walks you through the process of receiving user consent to become a\ndefault handler.\n\nTo learn more about default handlers, as well as how to handle permissions in an\napp that's available on the Play Store, [see the Permissions policy\nguide](https://play.google.com/about/privacy-security-deception/permissions/).\n\nView and change the set of default handlers\n-------------------------------------------\n\nAndroid lets users set default handlers for several core use cases, such as\nplacing phone calls, sending SMS messages, and providing assistive technology\ncapabilities.\n\nThe Settings app on Android includes a screen that shows users which apps are\ncurrently default handlers for the device's core functions, as\nshown in figure 1. From this screen, users can change the default handler for a\ngiven function, as shown in figure 2. \n**Figure 1.** System settings screen showing list of default handlers on a device. \n**Figure 2.** System settings screen showing how to change the default SMS handler.\n\nFollow requirements for default handlers\n----------------------------------------\n\nGiven the sensitive user information that an app accesses while serving as a\ndefault handler, your app cannot become a default handler unless it meets the\nfollowing Play Store listing and core functionality requirements:\n\n- Your app must be able to perform the functionality for which it's a default handler. For example, a default SMS handler must be able to send text messages.\n- Your app must provide a privacy policy.\n- Your app must make its core functionality clear in the Play Store description. For example, a default Phone handler should describe its phone-related capabilities in the description.\n- Your app must declare permissions that are appropriate for its use case. For more details about which permissions you can declare as a given handler, see the [guidance on using SMS or call log permission\n groups](https://support.google.com/googleplay/android-developer/answer/9047303#intended) in the Play Console Help Center.\n- Your app must ask to become a default handler **before** it requests the permissions associated with being that handler. For example, an app must request to become the default SMS handler before it requests the `READ_SMS` permission.\n\nRequest user consent\n--------------------\n\nAfter ensuring that your app follows each of the requirements necessary to\nbecome a default handler, you can add logic to display the dialog shown in\nfigure 3. This dialog asks the user to make your app the default handler for a\nparticular use case. \n**Figure 3.** Prompt asking the user whether they want to change their device's default SMS handler.\n| **Note:** Your app must ask to become a default handler **before** it requests the permissions associated with being that handler. For example, an app must request to become the default SMS handler before it requests the `READ_SMS` permission.\n\n\nThe following example code shows the logic necessary to display a prompt that\nasks the user to change their device's default SMS handler: \n\n### Kotlin\n\n```kotlin\nval setSmsAppIntent = Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT)\nsetSmsAppIntent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME, packageName)\nstartActivityForResult(setSmsAppIntent, your-result-code)\n```\n\n### Java\n\n```java\nIntent setSmsAppIntent =\n new Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT);\nsetSmsAppIntent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME,\n getPackageName());\nstartActivityForResult(setSmsAppIntent, your-result-code);\n```"]]