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

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

Snap for 9420665 from a088c772 to tm-qpr2-release

Change-Id: I98663fceca54e7fefcd81c25ead3b979653fe790
parents 1661af6b a088c772
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -907,6 +907,11 @@ public class LeAudioService extends ProfileService {
    private class AudioManagerRemoveAudioDeviceCallback extends AudioDeviceCallback {
        @Override
        public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) {
            if (mAudioManager == null) {
                Log.e(TAG, "Callback called when LeAudioService is stopped");
                return;
            }

            for (AudioDeviceInfo deviceInfo : removedDevices) {
                if (deviceInfo.getType() == AudioDeviceInfo.TYPE_BLE_HEADSET
                        || deviceInfo.getType() == AudioDeviceInfo.TYPE_BLE_SPEAKER) {
@@ -924,6 +929,11 @@ public class LeAudioService extends ProfileService {
    private class AudioManagerAddAudioDeviceCallback extends AudioDeviceCallback {
        @Override
        public void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices) {
            if (mAudioManager == null) {
                Log.e(TAG, "Callback called when LeAudioService is stopped");
                return;
            }

            for (AudioDeviceInfo deviceInfo : addedDevices) {
                if (deviceInfo.getType() == AudioDeviceInfo.TYPE_BLE_HEADSET
                        || deviceInfo.getType() == AudioDeviceInfo.TYPE_BLE_SPEAKER) {
+4 −12
Original line number Diff line number Diff line
@@ -1420,7 +1420,6 @@ public class BluetoothMapContentObserver {
                        int type = c.getInt(c.getColumnIndex(Sms.TYPE));
                        int threadId = c.getInt(c.getColumnIndex(Sms.THREAD_ID));
                        int read = c.getInt(c.getColumnIndex(Sms.READ));
                        long timestamp = c.getLong(c.getColumnIndex(Sms.DATE));

                        Msg msg = getMsgListSms().remove(id);

@@ -1428,10 +1427,6 @@ public class BluetoothMapContentObserver {
                         * a message deleted and/or MessageShift for messages deleted by the MCE. */

                        if (msg == null) {
                            if (BluetoothMapUtils.isDateTimeOlderThanOneYear(timestamp)) {
                                // Skip sending new message events older than one year
                                continue;
                            }
                            /* New message */
                            msg = new Msg(id, type, threadId, read);
                            msgListSms.put(id, msg);
@@ -1440,7 +1435,8 @@ public class BluetoothMapContentObserver {
                            if (mTransmitEvents && // extract contact details only if needed
                                    mMapEventReportVersion
                                            > BluetoothMapUtils.MAP_EVENT_REPORT_V10) {
                                String date = BluetoothMapUtils.getDateTimeString(timestamp);
                                String date = BluetoothMapUtils.getDateTimeString(
                                        c.getLong(c.getColumnIndex(Sms.DATE)));
                                String subject = c.getString(c.getColumnIndex(Sms.BODY));
                                if (subject == null) {
                                    subject = "";
@@ -1587,7 +1583,6 @@ public class BluetoothMapContentObserver {
                        // TODO: Go through code to see if we have an issue with mismatch in types
                        //       for threadId. Seems to be a long in DB??
                        int read = c.getInt(c.getColumnIndex(Mms.READ));
                        long timestamp = c.getLong(c.getColumnIndex(Mms.DATE));

                        Msg msg = getMsgListMms().remove(id);

@@ -1596,10 +1591,6 @@ public class BluetoothMapContentObserver {
                         * MCE.*/

                        if (msg == null) {
                            if (BluetoothMapUtils.isDateTimeOlderThanOneYear(timestamp)) {
                                // Skip sending new message events older than one year
                                continue;
                            }
                            /* New message - only notify on retrieve conf */
                            listChanged = true;
                            if (getMmsFolderName(type).equalsIgnoreCase(
@@ -1613,7 +1604,8 @@ public class BluetoothMapContentObserver {
                            if (mTransmitEvents && // extract contact details only if needed
                                    mMapEventReportVersion
                                            != BluetoothMapUtils.MAP_EVENT_REPORT_V10) {
                                String date = BluetoothMapUtils.getDateTimeString(timestamp);
                                String date = BluetoothMapUtils.getDateTimeString(
                                        c.getLong(c.getColumnIndex(Mms.DATE)));
                                String subject = c.getString(c.getColumnIndex(Mms.SUBJECT));
                                if (subject == null || subject.length() == 0) {
                                    /* Get subject from mms text body parts - if any exists */
+0 −15
Original line number Diff line number Diff line
@@ -677,21 +677,6 @@ public class BluetoothMapUtils {
        return format.format(cal.getTime());
    }

    static boolean isDateTimeOlderThanOneYear(long timestamp) {
        Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(timestamp);
        Calendar oneYearAgo = Calendar.getInstance();
        oneYearAgo.add(Calendar.YEAR, -1);
        if (cal.compareTo(oneYearAgo) > 0) {
            if (V) {
                Log.v(TAG, "isDateTimeOlderThanOneYear timestamp : " + timestamp
                        + " oneYearAgo: " + oneYearAgo);
            }
            return true;
        }
        return false;
    }

    static void savePeerSupportUtcTimeStamp(int remoteFeatureMask) {
        if ((remoteFeatureMask & MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT)
                == MAP_FEATURE_DEFINED_TIMESTAMP_FORMAT_BIT) {
+1 −7
Original line number Diff line number Diff line
@@ -758,13 +758,7 @@ TEST_F(CsisClientTest, test_add_device_to_group) {
  ASSERT_FALSE(g_1->IsEmpty());
}

TEST_F(CsisClientTest, test_set_desired_size) {
  auto g_1 = std::make_shared<CsisGroup>(666, bluetooth::Uuid::kEmpty);
  g_1->SetDesiredSize(10);
  ASSERT_EQ((int)sizeof(g_1), 16);
}

TEST_F(CsisClientTest, test_get_desired_size) {
TEST_F(CsisClientTest, test_get_set_desired_size) {
  auto g_1 = std::make_shared<CsisGroup>(666, bluetooth::Uuid::kEmpty);
  g_1->SetDesiredSize(10);
  ASSERT_EQ(g_1->GetDesiredSize(), 10);
+6 −0
Original line number Diff line number Diff line
@@ -1661,6 +1661,12 @@ LeAudioDeviceGroup::GetActiveConfiguration(void) {
std::optional<LeAudioCodecConfiguration>
LeAudioDeviceGroup::GetCodecConfigurationByDirection(
    types::LeAudioContextType group_context_type, uint8_t direction) const {
  if (available_context_to_configuration_map.count(group_context_type) == 0) {
    LOG_DEBUG("Context type %s, not supported",
              bluetooth::common::ToString(group_context_type).c_str());
    return std::nullopt;
  }

  const set_configurations::AudioSetConfiguration* audio_set_conf =
      available_context_to_configuration_map.at(group_context_type);
  LeAudioCodecConfiguration group_config = {0, 0, 0, 0};
Loading