Android 9는 서드 파티(3P) 통화 앱을 더 잘 지원하는 API를 제공합니다. 3P 통화 앱은 일반적으로 PHONE_STATE 브로드캐스트와 같은 텔레포니 API를 사용하여 이동통신사 전화 통화와 함께 공존합니다. 결과적으로 3P 통화 앱은 이동통신사 이용 통화에 우선권을 부여해야 하므로 자동으로 앱에서 수신 전화를 거부하거나 이동통신사 이용 통화를 위해 진행 중인 통화를 종료해야 하는 경우가 많습니다.
Android 9의 API는 3P 앱과 이동통신사 이용 통화 간의 동시 통화 시나리오를 지원합니다. 예를 들어 이동통신사 이용 통화를 하는 동안 수신되는 3P 전화를 받을 수 있습니다. 이 프레임워크는 사용자가 3P 통화를 하고 있을 때 이동통신사 이용 통화를 대기 상태로 유지합니다.
Android 9에서 3P 통화 앱은 자체 관리 ConnectionService API를 구현하는 것이 좋습니다. 이 API를 사용하여 통화 앱을 빌드하는 방법에 관한 자세한 내용은 통화 앱 빌드를 참조하세요.
자체 관리 ConnectionService API를 사용하면 개발자가 시스템 통화 기록에 앱의 통화가 기록되도록 선택할 수 있습니다(EXTRA_LOG_SELF_MANAGED_CALLS 참조). Android 호환성 정의 문서(CDD)의 요구사항(섹션 7.4.1.2)에 따라 다이얼러/전화 앱에 이러한 통화 기록 항목이 표시되고 통화가 시작된 3P 통화 앱의 이름이 표시되도록 해야 합니다. AOSP 다이얼러 앱이 이 요구사항을 충족하는 방법에 관한 예는 3P 통화 앱의 통화 기록 항목을 참조하세요.
진행 중인 3P 통화(예: SuperCaller 통화)가 통화 대기를 지원하지 않고 사용자가 이동통신사 FooCom 등을 통해 모바일 통화를 수신하는 시나리오에서는 다이얼러/전화 앱에서 사용자에게 모바일 네트워크 전화를 받으면 진행 중인 3P 통화가 종료된다고 표시해야 합니다.
3P 통화 앱에 프레임워크에서 통화 대기할 수 없는 진행 중인 통화가 있을 수 있으므로 이 사용자 환경은 중요합니다. 새로운 모바일 전화를 받으면 진행 중인 3P 통화의 연결이 끊어집니다.
adb install -g -r <apk path>를 사용하여 빌드 APK를 설치합니다. 그러면 자체 관리 샘플 아이콘이 런처에 추가됩니다.
아이콘을 탭하여 테스트 애플리케이션을 엽니다.
진행 중인 통화의 연결을 끊는 수신 전화 처리
다음 단계를 따라 수신 전화가 진행 중인 3P 통화 연결을 끊는지 확인하세요.
그림 3. 자체 관리 ConnectionService API의 샘플 구현이 있는 테스트 애플리케이션
통화 대기 가능 옵션을 선택 해제합니다.
발신을 탭하여 새로운 샘플 발신 전화를 시작합니다.
활성 버튼을 탭하여 통화를 활성화합니다.
다른 전화를 사용하여 테스트 중인 기기의 전화번호로 전화를 겁니다. 이렇게 하면 다이얼러에 앱의 이름이 제공되어 통화 연결이 끊기는 시나리오가 발생합니다.
작업을 완료하면 테스트 앱에서 연결 끊기 버튼을 탭합니다.
서드 파티 통화 앱의 통화 기록 항목
위 단계를 완료하고 나면 테스트 앱이 시스템 통화 기록에 통화를 기록했어야 합니다. 기기에서 3P 통화 앱의 통화를 기록하는지 확인하려면 다이얼러 앱을 열고 시스템 통화 기록에 통화가 표시되는지 확인합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2024-05-02(UTC)
[[["이해하기 쉬움","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"]],["최종 업데이트: 2024-05-02(UTC)"],[],[],null,["# Support third-party calling apps\n\nAndroid 9 provides APIs to better support third-party\ncalling apps. Third-party calling apps typically rely on Telephony APIs such as\nthe `PHONE_STATE` broadcast to co-exist alongside carrier phone calls. As a\nconsequence, third-party calling apps must give carrier calls priority and often\nresort to silently rejecting incoming calls in the app, or terminating an\nongoing call to make way for a carrier call.\n\nThe APIs in Android 9 support concurrent calling\nscenarios between third-party apps and carrier calls. This makes it possible,\nfor example, to receive an incoming third-party call while engaged in a carrier\ncall. The framework assumes responsibility for ensuring the carrier call is held\nwhen the user engages in the third-party call.\n\nIn Android 9, third-party calling apps are encouraged to\nimplement the self-managed `ConnectionService` API. For more information on how\nto build a calling app using this API, see\n[Build a calling app](https://developer.android.com/guide/topics/connectivity/telecom/selfManaged).\n\nThe self-managed `ConnectionService` API also gives developers the opportunity\nto opt-in to having calls in their app logged in the system call log (see\n[`EXTRA_LOG_SELF_MANAGED_CALLS`](https://developer.android.com/reference/android/telecom/PhoneAccount#EXTRA_LOG_SELF_MANAGED_CALLS)).\nPer the requirements in the\n[Android Compatibility Definition Document (CDD)](/docs/compatibility/android-cdd#7_4_data_connectivity)\n(section 7.4.1.2), you should ensure your dialer or phone app displays these\ncall log entries and shows the name of the third-party calling app where the\ncall originated (for an example of how the AOSP dialer app meets this\nrequirement, see\n[Call log entries from third-party calling apps](#call_log_entries_from_3p_calling_apps)).\n\nApps are responsible for setting\n[`CAPABILITY_SUPPORT_HOLD`](https://developer.android.com/reference/android/telecom/Connection.html#CAPABILITY_SUPPORT_HOLD)\nand\n[`CAPABILITY_HOLD`](https://developer.android.com/reference/android/telecom/Connection.html#CAPABILITY_HOLD)\non their apps' connections. However, it is possible that an app cannot hold a\ncall in some circumstances. The framework includes provisions for resolving\nthese types of cases.\n\nScenarios\n---------\n\nYou should modify your dialer app to handle the following scenarios.\n\n### Handle incoming calls that disconnect an ongoing call\n\nIn a scenario where there is an ongoing third-party call (e.g. in a SuperCaller call)\nthat does not support hold, and the user receives a mobile call (for example,\nusing their carrier FooCom), your Dialer or Phone app should indicate to the\nuser that answering the mobile network call will end the ongoing third-party call.\n\nThis user experience is important as a third-party calling app may have an ongoing call\nthat cannot be held by the framework. Answering a new mobile call causes the\nongoing third-party call to be disconnected.\n\nSee the user interface in the figure for an example:\n\n**Figure 1.** Incoming call disconnecting an ongoing third-party call.\n\nYour dialer app can check if an incoming call causes another call to be\ndisconnected by checking the\n[call extras](https://developer.android.com/reference/android/telecom/Call.Details.html#getExtras()).\nMake sure that\n[`EXTRA_ANSWERING_DROPS_FG_CALL`](https://developer.android.com/reference/android/telecom/Connection.html#EXTRA_ANSWERING_DROPS_FG_CALL)\nis set to `TRUE`, and\n[`EXTRA_ANSWERING_DROPS_FG_CALL_APP_NAME`](https://developer.android.com/reference/android/telecom/Connection.html#EXTRA_ANSWERING_DROPS_FG_CALL_APP_NAME)\nis set to the name of the app whose call is disconnected upon answering the\nincoming mobile call.\n\n### Call log entries from third-party calling apps\n\nDevelopers of third-party calling apps can opt-in to having calls in their app\nlogged in the system call log (see\n[`EXTRA_LOG_SELF_MANAGED_CALLS`](https://developer.android.com/reference/android/telecom/PhoneAccount#EXTRA_LOG_SELF_MANAGED_CALLS)).\nThis means that it is possible to have entries in the call log that are not for\nmobile network calls.\n\nWhen the AOSP dialer app displays call log entries related to a third-party\ncalling app, the name of the app where the call took place is displayed in the\ncall log, as illustrated in the figure:\n\n**Figure 2.** Call log entry with name of third-party calling app on dialer app.\n\nTo determine the name of an app associated with a call log entry, use the\n[`PHONE_ACCOUNT_COMPONENT_NAME`](https://developer.android.com/reference/android/provider/CallLog.Calls.html#PHONE_ACCOUNT_COMPONENT_NAME)\nand\n[`PHONE_ACCOUNT_ID`](https://developer.android.com/reference/android/provider/CallLog.Calls.html#PHONE_ACCOUNT_ID)\ncolumns in the call log provider to create an instance of\n[`PhoneAccountHandle`](https://developer.android.com/reference/android/telecom/PhoneAccountHandle.html#PhoneAccountHandle(android.content.ComponentName,%20java.lang.String)),\nwhich identifies the source of a call log entry. Query\n[`TelecomManager`](https://developer.android.com/reference/android/telecom/TelecomManager.html#getPhoneAccount(android.telecom.PhoneAccountHandle))\nto get the details for the PhoneAccount. \n\nTo determine if a call log entry is from a third-party calling app, check\n[`PhoneAccount` capabilities](https://developer.android.com/reference/android/telecom/PhoneAccount.html#getCapabilities())\nto see if\n[`CAPABILITY_SELF_MANAGED`](https://developer.android.com/reference/android/telecom/PhoneAccount.html#CAPABILITY_SELF_MANAGED)\nis set.\n\nThe\n[`getLabel`](https://developer.android.com/reference/android/telecom/PhoneAccount.html#getLabel())\nmethod of the returned `PhoneAccount` returns the name of the app associated\nwith a call log entry from the third-party calling app.\n\nValidation\n----------\n\nTo test that your device supports third-party calling apps, use the Telecomm test\napp, which implements the self-managed ConnectionService API. The\napp is located in\n[`/packages/services/Telecomm/testapps/`](https://android.googlesource.com/platform/packages/services/Telecomm/+/android16-release/testapps/).\n\n1. Build the test app from the root of your Android source repository using:\n\n `mmma packages/services/Telecomm/testapps/`\n2. Install the build apk using `adb install -g -r \u003capk path\u003e`. A Self-Managed\n Sample icon is then added to your launcher.\n\n3. Tap the icon to open the test app.\n\n### Handle incoming calls that disconnect an ongoing call\n\nFollow these steps to verify that an incoming call disconnects an ongoing\nthird-party call.\n\n**Figure 3.** Test app with sample implementations of the ConnectionService API.\n\n1. Clear the **Holdable** option.\n2. Tap **OUTGOING** to start a new sample outgoing call.\n3. Tap the **ACTIVE** button to make the call go active.\n4. Call the phone number of the device under test with another phone. This invokes the scenario where your dialer is provided with the name of an app, which will have its call disconnected.\n5. When you are finished, tap the **DISCONNECT** button in the test app.\n\n### Call log entries from third-party calling apps\n\nAfter completing the steps above, the test app should have logged a call to the\nsystem call log. To confirm the device logs calls from third-party calling apps,\nopen your dialer app and confirm the call appears in the system call log."]]