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

Commit 0d4d9164 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4778776 from 62a52af7 to pi-release

Change-Id: I54216b8853ad5ecdef848c45304519d0ddbef213
parents 44e00eb8 62a52af7
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1645,7 +1645,13 @@ static void gattServerSendResponseNative(JNIEnv* env, jobject object,
  response.attr_value.len = 0;

  if (val != NULL) {
    if (env->GetArrayLength(val) < BTGATT_MAX_ATTR_LEN) {
      response.attr_value.len = (uint16_t)env->GetArrayLength(val);
    } else {
      android_errorWriteLog(0x534e4554, "78787521");
      response.attr_value.len = BTGATT_MAX_ATTR_LEN;
    }

    jbyte* array = env->GetByteArrayElements(val, 0);

    for (int i = 0; i != response.attr_value.len; ++i)
+10 −3
Original line number Diff line number Diff line
@@ -442,10 +442,17 @@ public class A2dpService extends ProfileService {
                // disconnected. Please see comment in broadcastActiveDevice() for why.
                broadcastActiveDevice(null);
                if (previousActiveDevice != null) {
                    // Make sure the Audio Manager knows the previous Active device is disconnected
                    mAudioManager.setBluetoothA2dpDeviceConnectionState(
                    // Make sure the Audio Manager knows the previous Active device is disconnected.
                    // However, if A2DP is still connected for that remote device, the user has
                    // explicitly switched the output to the local device and music should
                    // continue playing. Otherwise, the remote device has been indeed disconnected,
                    // and audio should be suspended before switching the output to the local
                    // device.
                    mAudioManager.setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(
                            previousActiveDevice, BluetoothProfile.STATE_DISCONNECTED,
                            BluetoothProfile.A2DP);
                            BluetoothProfile.A2DP,
                            getConnectionState(previousActiveDevice)
                                == BluetoothProfile.STATE_CONNECTED);
                    // Make sure the Active device in native layer is set to null and audio is off
                    if (!mA2dpNativeInterface.setActiveDevice(null)) {
                        Log.w(TAG, "setActiveDevice(null): Cannot remove active device in native "
+10 −0
Original line number Diff line number Diff line
@@ -121,6 +121,16 @@ class MediaPlayerWrapper {
    }

    Metadata getCurrentMetadata() {
        // Try to use the now playing list if the information exists.
        if (getActiveQueueID() != -1) {
            for (Metadata data : getCurrentQueue()) {
                if (data.mediaId.equals(Util.NOW_PLAYING_PREFIX + getActiveQueueID())) {
                    d("getCurrentMetadata: Using playlist data: " + data.toString());
                    return data.clone();
                }
            }
        }

        return Util.toMetadata(getMetadata());
    }

+5 −2
Original line number Diff line number Diff line
@@ -209,8 +209,11 @@ class Util {

        if (items == null) return list;

        for (MediaSession.QueueItem item : items) {
            list.add(toMetadata(item));
        for (int i = 0; i < items.size(); i++) {
            Metadata data = toMetadata(items.get(i));
            data.trackNum = "" + (i + 1);
            data.numTracks = "" + items.size();
            list.add(data);
        }

        return list;
+14 −3
Original line number Diff line number Diff line
@@ -344,6 +344,9 @@ public class BluetoothPbapVcardManager {
                        Log.e(TAG, "Failed to read a contact. Error reason: "
                                + composer.getErrorReason());
                        return nameList;
                    } else if (vcard.isEmpty()) {
                        Log.i(TAG, "Contact may have been deleted during operation");
                        continue;
                    }
                    if (V) {
                        Log.v(TAG, "Checking selected bits in the vcard composer" + vcard);
@@ -739,6 +742,9 @@ public class BluetoothPbapVcardManager {
                    Log.e(TAG,
                            "Failed to read a contact. Error reason: " + composer.getErrorReason());
                    return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
                } else if (vcard.isEmpty()) {
                    Log.i(TAG, "Contact may have been deleted during operation");
                    continue;
                }
                if (V) {
                    Log.v(TAG, "vCard from composer: " + vcard);
@@ -835,6 +841,9 @@ public class BluetoothPbapVcardManager {
                    Log.e(TAG,
                            "Failed to read a contact. Error reason: " + composer.getErrorReason());
                    return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
                } else if (vcard.isEmpty()) {
                    Log.i(TAG, "Contact may have been deleted during operation");
                    continue;
                }
                if (V) {
                    Log.v(TAG, "Checking selected bits in the vcard composer" + vcard);
@@ -921,14 +930,16 @@ public class BluetoothPbapVcardManager {
                        continue;
                    }
                    if (needSendBody == NEED_SEND_BODY) {
                        if (vcard != null) {
                            vcard = vcardfilter.apply(vcard, vcardType21);
                        }
                        if (vcard == null) {
                            Log.e(TAG, "Failed to read a contact. Error reason: "
                                    + composer.getErrorReason());
                            return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
                        } else if (vcard.isEmpty()) {
                            Log.i(TAG, "Call Log may have been deleted during operation");
                            continue;
                        }
                        vcard = vcardfilter.apply(vcard, vcardType21);

                        if (V) {
                            Log.v(TAG, "Vcard Entry:");
                            Log.v(TAG, vcard);
Loading