Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06aef134 authored by Deqiang Chen's avatar Deqiang Chen Committed by Gerrit Code Review
Browse files

Merge "Add the capability to list bluetooth HFP as emergency capable phone account"

parents b0d6aa4b fc5fbdd2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@
    <!-- For enabling the hfp client connection service -->
    <bool name="hfp_client_connection_service_enabled">false</bool>

    <!-- For supporting emergency call through the hfp client connection service  -->
    <bool name="hfp_client_connection_service_support_emergency_call">false</bool>

    <!-- Enabling autoconnect over pan -->
    <bool name="config_bluetooth_pan_enable_autoconnect">true</bool>

+10 −1
Original line number Diff line number Diff line
@@ -328,10 +328,19 @@ public class HfpClientConnectionService extends ConnectionService {
        PhoneAccountHandle handle =
                new PhoneAccountHandle(new ComponentName(context, HfpClientConnectionService.class),
                        device.getAddress());

        int capabilities = PhoneAccount.CAPABILITY_CALL_PROVIDER;
        if (context.getApplicationContext().getResources().getBoolean(
                com.android.bluetooth.R.bool
                .hfp_client_connection_service_support_emergency_call)) {
            // Need to have an emergency call capability to place emergency call
            capabilities |= PhoneAccount.CAPABILITY_PLACE_EMERGENCY_CALLS;
        }

        PhoneAccount account =
                new PhoneAccount.Builder(handle, "HFP " + device.toString()).setAddress(addr)
                        .setSupportedUriSchemes(Arrays.asList(PhoneAccount.SCHEME_TEL))
                        .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER)
                        .setCapabilities(capabilities)
                        .build();
        if (DBG) {
            Log.d(TAG, "phoneaccount: " + account);