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

Commit b5dac064 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11135477 from 74534337 to 24Q1-release

Change-Id: I05eb05ae4f4180361ebadccf5bd9562754772d56
parents 6cb96855 74534337
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5,6 +5,6 @@
    <string name="bluetooth_sap_notif_ticker" msgid="7295825445933648498">"Bluetooth-adgang til SIM-kort"</string>
    <string name="bluetooth_sap_notif_message" msgid="1004269289836361678">"Vil du anmode klienten om at afbryde forbindelsen?"</string>
    <string name="bluetooth_sap_notif_disconnecting" msgid="6041257463440623400">"Venter på, at klienten afbryder forbindelsen"</string>
    <string name="bluetooth_sap_notif_disconnect_button" msgid="3059012556387692616">"Afbryd"</string>
    <string name="bluetooth_sap_notif_disconnect_button" msgid="3059012556387692616">"Afbryd forbindelse"</string>
    <string name="bluetooth_sap_notif_force_disconnect_button" msgid="2239425242376623998">"Gennemtving afbrydelse af forbindelsen"</string>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@
    <string name="transfer_menu_clear" msgid="7213491281898188730">"ಪಟ್ಟಿಯಿಂದ ತೆರವುಗೊಳಿಸಿ"</string>
    <string name="transfer_clear_dlg_title" msgid="128904516163257225">"ತೆರವುಗೊಳಿಸು"</string>
    <string name="bluetooth_a2dp_sink_queue_name" msgid="7521243473328258997">"Now Playing"</string>
    <string name="bluetooth_map_settings_save" msgid="8309113239113961550">"ಉಳಿಸಿ"</string>
    <string name="bluetooth_map_settings_save" msgid="8309113239113961550">"ಸೇವ್ ಮಾಡಿ"</string>
    <string name="bluetooth_map_settings_cancel" msgid="3374494364625947793">"ರದ್ದುಮಾಡಿ"</string>
    <string name="bluetooth_map_settings_intro" msgid="4748160773998753325">"ಬ್ಲೂಟೂತ್‌ ಮೂಲಕ ಹಂಚಿಕೊಳ್ಳಲು ಬಯಸುವ ಖಾತೆಗಳನ್ನು ಆಯ್ಕೆಮಾಡಿ. ಸಂಪರ್ಕಿಸುವಾಗ ಖಾತೆಗಳಿಗೆ ಯಾವುದೇ ಪ್ರವೇಶವನ್ನು ನೀವು ಈಗಲೂ ಸಮ್ಮತಿಸಬೇಕಾಗುತ್ತದೆ."</string>
    <string name="bluetooth_map_settings_count" msgid="183013143617807702">"ಉಳಿದಿರುವ ಸ್ಲಾಟ್‌ಗಳು:"</string>
+80 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.bluetooth.BluetoothStatusCodes;
import android.bluetooth.hfp.BluetoothHfpProtoEnums;
import android.content.Intent;
import android.media.AudioManager;
import android.os.Build;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
@@ -181,6 +182,18 @@ public class HeadsetStateMachine extends StateMachine {
        VENDOR_SPECIFIC_AT_COMMAND_COMPANY_ID.put(
                BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_IPHONEACCEV,
                BluetoothAssignedNumbers.APPLE);
        VENDOR_SPECIFIC_AT_COMMAND_COMPANY_ID.put(
                BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGMI,
                BluetoothAssignedNumbers.GOOGLE);
        VENDOR_SPECIFIC_AT_COMMAND_COMPANY_ID.put(
                BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGMR,
                BluetoothAssignedNumbers.GOOGLE);
        VENDOR_SPECIFIC_AT_COMMAND_COMPANY_ID.put(
                BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGMM,
                BluetoothAssignedNumbers.GOOGLE);
        VENDOR_SPECIFIC_AT_COMMAND_COMPANY_ID.put(
                BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGSN,
                BluetoothAssignedNumbers.GOOGLE);
    }

    private HeadsetStateMachine(BluetoothDevice device, Looper looper,
@@ -2030,7 +2043,32 @@ public class HeadsetStateMachine extends StateMachine {
    void processVendorSpecificAt(String atString, BluetoothDevice device) {
        log("processVendorSpecificAt - atString = " + atString);

        // Currently we accept only SET type commands.
        // Currently we accept only SET type commands, except the 4 AT commands
        // which requests the device's information: +CGMI, +CGMM, +CGMR and +CGSN, which we
        // responds to right away without any further processing.
        boolean isIopInfoRequestAt = true;
        switch (atString) {
            case BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGMI:
                processAtCgmi(device);
                break;
            case BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGMM:
                processAtCgmm(device);
                break;
            case BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGMR:
                processAtCgmr(device);
                break;
            case BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGSN:
                processAtCgsn(device);
                break;
            default:
                isIopInfoRequestAt = false;
        }
        if (isIopInfoRequestAt) {
            mNativeInterface.atResponseCode(device, HeadsetHalConstants.AT_RESPONSE_OK, 0);
            return;
        }

        // Check if the command is a SET type command.
        int indexOfEqual = atString.indexOf("=");
        if (indexOfEqual == -1) {
            Log.w(TAG, "processVendorSpecificAt: command type error in " + atString);
@@ -2221,6 +2259,47 @@ public class HeadsetStateMachine extends StateMachine {
        mNativeInterface.atResponseString(device, "+XAPL=iPhone," + String.valueOf(2));
    }

    /**
     * Process AT+CGMI AT command
     *
     * @param device Remote device that has sent this command
     */
    @VisibleForTesting
    void processAtCgmi(BluetoothDevice device) {
        mNativeInterface.atResponseString(device, Build.MANUFACTURER);
    }

    /**
     * Process AT+CGMM AT command
     *
     * @param device Remote device that has sent this command
     */
    @VisibleForTesting
    void processAtCgmm(BluetoothDevice device) {
        mNativeInterface.atResponseString(device, Build.MODEL);
    }

    /**
     * Process AT+CGMR AT command
     *
     * @param device Remote device that has sent this command
     */
    @VisibleForTesting
    void processAtCgmr(BluetoothDevice device) {
        mNativeInterface.atResponseString(
                device, String.format("%s (%s)", Build.VERSION.RELEASE, Build.VERSION.INCREMENTAL));
    }

    /**
     * Process AT+CGSN AT command
     *
     * @param device Remote device that has sent this command
     */
    @VisibleForTesting
    void processAtCgsn(BluetoothDevice device) {
        mNativeInterface.atResponseString(device, Build.getSerial());
    }

    @VisibleForTesting
    void processUnknownAt(String atString, BluetoothDevice device) {
        if (device == null) {
+20 −12
Original line number Diff line number Diff line
@@ -1366,10 +1366,12 @@ public class VolumeControlService extends ProfileService {
        } else if (toState == BluetoothProfile.STATE_CONNECTED) {
            // Restore the group volume if it was changed while the device was not yet connected.
            CsipSetCoordinatorService csipClient = mFactory.getCsipSetCoordinatorService();
            if (csipClient != null) {
                Integer groupId = csipClient.getGroupId(device, BluetoothUuid.CAP);
                if (groupId != IBluetoothCsipSetCoordinator.CSIS_GROUP_ID_INVALID) {
                Integer groupVolume = mGroupVolumeCache.getOrDefault(groupId,
                        IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME);
                    Integer groupVolume =
                            mGroupVolumeCache.getOrDefault(
                                    groupId, IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME);
                    if (groupVolume != IBluetoothVolumeControl.VOLUME_CONTROL_UNKNOWN_VOLUME) {
                        mVolumeControlNativeInterface.setVolume(device, groupVolume);
                    }
@@ -1381,6 +1383,12 @@ public class VolumeControlService extends ProfileService {
                        mVolumeControlNativeInterface.unmute(device);
                    }
                }
            } else {
                /* It could happen when Bluetooth is stopping while VC is getting
                 * connection event
                 */
                Log.w(TAG, "CSIP is not available");
            }
        }
        mAdapterService.handleProfileConnectionStateChange(
                BluetoothProfile.VOLUME_CONTROL, device, fromState, toState);
+45 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.content.ServiceConnection;
import android.database.Cursor;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.HandlerThread;
@@ -1374,7 +1375,7 @@ public class HeadsetStateMachineTest {
    }

    @Test
    public void testProcessVendorSpecificAt_withNoEqualSignCommand() {
    public void testProcessVendorSpecificAt_withNonExceptedNoEqualSignCommand() {
        String atString = "invalid_command";

        mHeadsetStateMachine.processVendorSpecificAt(atString, mTestDevice);
@@ -1413,6 +1414,49 @@ public class HeadsetStateMachineTest {
        verify(mNativeInterface).atResponseCode(mTestDevice, HeadsetHalConstants.AT_RESPONSE_OK, 0);
    }

    @Test
    public void testProcessVendorSpecificAt_withExceptedNoEqualSignCommandCGMI() {
        String atString = BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGMI;

        mHeadsetStateMachine.processVendorSpecificAt(atString, mTestDevice);

        verify(mNativeInterface).atResponseString(mTestDevice, Build.MANUFACTURER);
        verify(mNativeInterface).atResponseCode(mTestDevice, HeadsetHalConstants.AT_RESPONSE_OK, 0);
    }

    @Test
    public void testProcessVendorSpecificAt_withExceptedNoEqualSignCommandCGMM() {
        String atString = BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGMM;

        mHeadsetStateMachine.processVendorSpecificAt(atString, mTestDevice);

        verify(mNativeInterface).atResponseString(mTestDevice, Build.MODEL);
        verify(mNativeInterface).atResponseCode(mTestDevice, HeadsetHalConstants.AT_RESPONSE_OK, 0);
    }

    @Test
    public void testProcessVendorSpecificAt_withExceptedNoEqualSignCommandCGMR() {
        String atString = BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGMR;

        mHeadsetStateMachine.processVendorSpecificAt(atString, mTestDevice);

        verify(mNativeInterface)
                .atResponseString(
                        mTestDevice,
                        String.format("%s (%s)", Build.VERSION.RELEASE, Build.VERSION.INCREMENTAL));
        verify(mNativeInterface).atResponseCode(mTestDevice, HeadsetHalConstants.AT_RESPONSE_OK, 0);
    }

    @Test
    public void testProcessVendorSpecificAt_withExceptedNoEqualSignCommandCGSN() {
        String atString = BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_CGSN;

        mHeadsetStateMachine.processVendorSpecificAt(atString, mTestDevice);

        verify(mNativeInterface).atResponseString(mTestDevice, Build.getSerial());
        verify(mNativeInterface).atResponseCode(mTestDevice, HeadsetHalConstants.AT_RESPONSE_OK, 0);
    }

    @Test
    public void testProcessVolumeEvent_withVolumeTypeMic() {
        when(mHeadsetService.getActiveDevice()).thenReturn(mTestDevice);
Loading