2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
전화 계정 제안
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Android 10에서는 전화 계정 추천 서비스를 사용하여 사용자가 전화를 걸 때 전화 계정 추천이 표시되도록 할 수 있습니다. 예를 들어 SIM이 여러 개이고 네트워크 내 통화 요금이 더 낮은 기기를 가진 사용자의 경우, 이 서비스는 먼저 수신자의 이동통신사를 식별한 후 수신자와 동일한 네트워크의 SIM 사용을 추천합니다.
전화 계정 추천 서비스는 선택사항이며 Android 10 이상을 실행하는 기기에서 구현할 수 있습니다.
구현
전화 계정 추천을 구현하려면 /system/priv-app/
에 있는 앱에서 PhoneAccountSuggestionService
서비스를 하나 구현합니다. 둘 이상의 PhoneAccountSuggestionService
가 구현되면 서비스는 쿼리되지 않습니다. 서비스는 android.Manifest.permission.BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE
권한을 선언해야 합니다.
기본 발신 전화 계정과 기본 전화 계정이 모두 수신자에게 설정되어 있지 않은 발신 전화를 사용자가 걸면 통신사 서비스는 PhoneAccountSuggestionService
에 바인딩하여 계정에 관한 정보를 수집하고 onAccountSuggestionRequest(String number)
가 호출되며 발신 전화 처리는 정지됩니다.
PhoneAccountSuggestionService
는 onAccountSuggestionRequest(String number)
에서 반환된 번호로 suggestPhoneAccounts(String number, List<PhoneAccountSuggestion> suggestions)
를 호출해야 합니다.
suggestPhoneAccounts(String number, List<PhoneAccountSuggestion> suggestions)
가 호출되면 통신사 서비스는 추천된 전화 계정 목록을 반환합니다. 그러면 다이얼러에서는 사용자가 전화를 걸 때 선택할 수 있는 추천 전화 계정의 목록을 표시해야 합니다.
PhoneAccountSuggestion
추천하려면 PhoneAccountSuggestion 클래스를 사용하세요.
예를 들어 서비스에서 수신자가 기기의 SIM 중 하나와 동일한 이동통신사를 사용한다고 확인하면 서비스는 REASON_INTRA_CARRIER
로 전화 계정을 표시해야 합니다.
그러면 다이얼러의 사용자에게 정보가 전달될 수 있습니다.
예를 들어 사용자가 직장 Google 계정의 모든 연락처에 직장 SIM을 사용하도록 기기를 구성한 경우 서비스는 전화 계정을 REASON_USER_SET
로 표시하고 shouldAutoSelect
를 true로 설정하여 다이얼러가 선택 대화상자를 우회하고 전화 계정을 사용하여 자동으로 전화를 걸 수 있도록 해야 합니다.
다른 추천에 관한 자세한 내용은 PhoneAccountSuggestion
을 참조하세요.
다이얼러
통화가 STATE_SELECT_PHONE_ACCOUNT
상태가 되면 다이얼러는 PhoneAccountSuggestion
의 정보를 사용하여 EXTRA_SUGGESTED_PHONE_ACCOUNTS
를 처리해야 합니다.
서비스 사용 중지
특정 이동통신사의 구현을 맞춤설정하려면 setComponentEnabledSetting
을 사용하여 서비스를 사용 설정하거나 사용 중지하면 됩니다.
사용 중지되면 서비스는 쿼리되지 않습니다.
시스템 UI 구현
구현에 따라 시스템 UI를 변경해야 할 수 있습니다. 예를 들어 사용자가 특정 연락처의 모든 통화를 특정 전화 계정에서 이루어지도록 지정할 수 있으려면 기기에 맞춤설정된 설정 흐름과 설정 UI를 구현해야 합니다.
유효성 검사
구현을 확인하려면 다음 CTS 테스트를 실행하세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Phone account suggestion\n\nIn Android 10, the phone account suggestion service\nallows suggestions for phone\naccounts to be shown to users when making a call. For example, for users with a\ndevice with multiple SIMs and lower rates for intra-network calls, this\nservice first identifies the callee's carrier and then suggests using the SIM on\nthe same network as the callee.\n\nThe phone account suggestion service is optional and can be implemented on\ndevices running Android 10 or higher.\n\nImplementation\n--------------\n\nTo implement phone account suggestions, implement *one*\n[`PhoneAccountSuggestionService`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestionService.java)\nservice in an app that is located in `/system/priv-app/`. The service isn't\nqueried if more than one `PhoneAccountSuggestionService`is implemented. The\nservice must declare the\n`android.Manifest.permission.BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE` permission.\n\nWhen a user makes an outgoing call where neither the\n[default outgoing phone account](https://developer.android.com/reference/android/telecom/TelecomManager.html#getDefaultOutgoingPhoneAccount(java.lang.String))\nnor the\n[preferred phone account](https://developer.android.com/reference/android/provider/ContactsContract.DataColumns.html#PREFERRED_PHONE_ACCOUNT_COMPONENT_NAME)\nis set for the callee, the telecom service binds to\n`PhoneAccountSuggestionService` to gather information about the accounts,\n[`onAccountSuggestionRequest(String number)`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestionService.java#98)\nis called, and the outgoing call process is suspended.\n\n`PhoneAccountSuggestionService` must call\n[`suggestPhoneAccounts(String number, List\u003cPhoneAccountSuggestion\u003e suggestions)`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestionService.java#110)\nwith the number returned by\n[`onAccountSuggestionRequest(String number)`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestionService.java#98).\n\nWhen\n[`suggestPhoneAccounts(String number, List\u003cPhoneAccountSuggestion\u003e suggestions)`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestionService.java#110)\nis called, the telecom service returns a list of suggested phone accounts. The\ndialer must then display the list of suggested phone accounts for the user to\nchoose from to make the call.\n\n### PhoneAccountSuggestion\n\nTo make suggestions, use the\n[PhoneAccountSuggestion](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestion.java)\nclass.\nFor example, if the service determines the callee is on the same carrier as one\nof the SIMs in the device, the service should mark the phone account with\n[`REASON_INTRA_CARRIER`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestion.java#46).\nThis information can then be conveyed to the user in the dialer.\n\nFor example, in a situation where the user has configured the device to use\na work SIM for all contacts\nin a work Google Account, the service should mark the phone account with\n[`REASON_USER_SET`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestion.java#58)\nand set\n[`shouldAutoSelect`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestion.java#121)\nto true to allow the dialer to bypass the selection dialog and automatically\nplace the call using the phone account.\n\nFor information on other suggestions, see\n[`PhoneAccountSuggestion`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestion.java).\n\n### Dialer\n\nWhen the call enters the\n[`STATE_SELECT_PHONE_ACCOUNT`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/Call.java#84)\nstate, the dialer must use the information from\n[`PhoneAccountSuggestion`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/PhoneAccountSuggestion.java)\nto handle\n[`EXTRA_SUGGESTED_PHONE_ACCOUNTS`](https://android.googlesource.com/platform/frameworks/base/+/android16-release/telecomm/java/android/telecom/Call.java#136).\n\n### Disable the service\n\nTo customize your implementation for specific carriers, you can enable or\ndisable the service using\n[`setComponentEnabledSetting`](https://developer.android.com/reference/android/content/pm/PackageManager.html#setComponentEnabledSetting(android.content.ComponentName,%20int,%20int)%60).\nThe service is not queried if disabled.\n\n### System UI implementation\n\nDepending on your implementation, changes to the system UI may be required. For\nexample, to allow users to specify that all calls to a specific contact are\nmade from a specific phone account, you must implement a customized set up flow\nand settings UI for the device.\n\nValidation\n----------\n\nTo validate your implementation, run the following CTS tests:\n\n- [`/cts/tests/tests/telecom/src/android/telecom/cts/PhoneAccountSuggestionServiceTest.java`](https://android.googlesource.com/platform/cts/+/android16-release/tests/tests/telecom/src/android/telecom/cts/PhoneAccountSuggestionServiceTest.java)\n- [`/cts/tests/tests/telecom/src/android/telecom/cts/PhoneAccountSuggestionTest.java`](https://android.googlesource.com/platform/cts/+/android16-release/tests/tests/telecom/src/android/telecom/cts/PhoneAccountSuggestionTest.java)"]]