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

Commit 530258d8 authored by Deqiang Chen's avatar Deqiang Chen Committed by android-build-merger
Browse files

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

am: 06aef134

Change-Id: I358e876d5496942c79a3e1833c08b7513f2fea57
parents 15f8a6f8 06aef134
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);