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

Commit 7025df2d authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge eea9bc66 on remote branch

Change-Id: Ide3c4820cf68ae7cc8e22909faf38bf306544c26
parents 0611b4c3 eea9bc66
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -184,7 +184,12 @@ static void initNative(JNIEnv *env, jobject object, jint maxA2dpConnections,
    const char *offload_capabilities;
    bt_status_t status;

    if (offload_cap != NULL) {
        offload_capabilities = env->GetStringUTFChars(offload_cap, NULL);
    } else {
        ALOGW("offload_cap is NULL");
        offload_capabilities = NULL;
    }

    if ( (btInf = getBluetoothInterface()) == NULL) {
        ALOGE("Bluetooth module is not loaded");
+2 −2
Original line number Diff line number Diff line
@@ -2260,8 +2260,8 @@ public class AdapterService extends Service {
    }

     boolean setPairingConfirmation(BluetoothDevice device, boolean accept) {
        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
                                       "Need BLUETOOTH ADMIN permission");
        enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED,
                                       "Need BLUETOOTH PRIVILEGED permission");
        DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device);
        if (deviceProp == null || deviceProp.getBondState() != BluetoothDevice.BOND_BONDING) {
            return false;
+12 −6
Original line number Diff line number Diff line
@@ -1256,7 +1256,8 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
                return ResponseCodes.OBEX_HTTP_NOT_FOUND;
            } else if (intIndex == 0) {
                // For PB_PATH, 0.vcf is the phone number of this phone.
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21,null);
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21,
                                     appParamValue.ignorefilter, appParamValue.propertySelector);
                return pushBytes(op, ownerVcard);
            } else {
                return mVcardManager.composeAndSendPhonebookOneVcard(op, intIndex, vcard21, null,
@@ -1268,7 +1269,8 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
                return ResponseCodes.OBEX_HTTP_NOT_FOUND;
            } else if (intIndex == 0) {
                // For PB_PATH, 0.vcf is the phone number of this phone.
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21, null);
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21,
                                     appParamValue.ignorefilter, appParamValue.propertySelector);
                return pushBytes(op, ownerVcard);
            } else {
                return mVcardManager.composeAndSendSIMPhonebookOneVcard(op, intIndex, vcard21, null,
@@ -1342,7 +1344,8 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
        boolean vcard21 = appParamValue.vcard21;
        if (appParamValue.needTag == BluetoothPbapObexServer.ContentType.PHONEBOOK) {
            if (startPoint == 0) {
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21, null);
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21,
                                     appParamValue.ignorefilter, appParamValue.propertySelector);
                if (endPoint == 0) {
                    return pushBytes(op, ownerVcard);
                } else {
@@ -1359,7 +1362,8 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
            }
        } else if (appParamValue.needTag == BluetoothPbapObexServer.ContentType.SIM_PHONEBOOK) {
            if (startPoint == 0) {
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21, null);
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21,
                                     appParamValue.ignorefilter, appParamValue.propertySelector);
                if (endPoint == 0) {
                    return pushBytes(op, ownerVcard);
                } else {
@@ -1429,7 +1433,8 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
        boolean vcard21 = appParamValue.vcard21;
        if (appParamValue.needTag == BluetoothPbapObexServer.ContentType.PHONEBOOK) {
            if (startPoint == 0) {
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21, null);
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21,
                                     appParamValue.ignorefilter, appParamValue.propertySelector);
                if (endPoint == 0) {
                    return pushBytes(op, ownerVcard);
                } else {
@@ -1446,7 +1451,8 @@ public class BluetoothPbapObexServer extends ServerRequestHandler {
            }
        } else if (appParamValue.needTag == BluetoothPbapObexServer.ContentType.SIM_PHONEBOOK) {
            if (startPoint == 0) {
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21, null);
                String ownerVcard = mVcardManager.getOwnerPhoneNumberVcard(vcard21,
                                     appParamValue.ignorefilter, appParamValue.propertySelector);
                if (endPoint == 0) {
                    return pushBytes(op, ownerVcard);
                } else {
+14 −4
Original line number Diff line number Diff line
@@ -140,9 +140,13 @@ public class BluetoothPbapVcardManager {
     * @param vcardType21
     * @return
     */
    private final String getOwnerPhoneNumberVcardFromProfile(final boolean vcardType21, final byte[] filter) {
    private final String getOwnerPhoneNumberVcardFromProfile(final boolean vcardType21,
                                            boolean ignorefilter, final byte[] filter) {
        // Currently only support Generic Vcard 2.1 and 3.0
        int vcardType;
        String vcard = null;
        VCardFilter vcardfilter = new VCardFilter(ignorefilter ? null : filter);

        if (vcardType21) {
            vcardType = VCardConfig.VCARD_TYPE_V21_GENERIC;
        } else {
@@ -153,13 +157,19 @@ public class BluetoothPbapVcardManager {
            vcardType |= VCardConfig.FLAG_REFRAIN_IMAGE_EXPORT;
        }

        return BluetoothPbapUtils.createProfileVCard(mContext, vcardType,filter);
        vcard = BluetoothPbapUtils.createProfileVCard(mContext, vcardType, filter);
        if ((vcard != null) && !ignorefilter) {
            vcard = vcardfilter.apply(vcard, vcardType21);
        }
        return vcard;

    }

    public final String getOwnerPhoneNumberVcard(final boolean vcardType21, final byte[] filter) {
    public final String getOwnerPhoneNumberVcard(final boolean vcardType21,
                                boolean ignorefilter, final byte[] filter) {
        //Owner vCard enhancement: Use "ME" profile if configured
        if (BluetoothPbapConfig.useProfileForOwnerVcard()) {
            String vcard = getOwnerPhoneNumberVcardFromProfile(vcardType21, filter);
            String vcard = getOwnerPhoneNumberVcardFromProfile(vcardType21, ignorefilter, filter);
            if (vcard != null && vcard.length() != 0) {
                return vcard;
            }