Loading jni/com_android_bluetooth_a2dp.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -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"); Loading src/com/android/bluetooth/btservice/AdapterService.java +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading src/com/android/bluetooth/pbap/BluetoothPbapObexServer.java +12 −6 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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, Loading Loading @@ -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 { Loading @@ -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 { Loading Loading @@ -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 { Loading @@ -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 { Loading src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java +14 −4 Original line number Diff line number Diff line Loading @@ -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 { Loading @@ -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; } Loading Loading
jni/com_android_bluetooth_a2dp.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -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"); Loading
src/com/android/bluetooth/btservice/AdapterService.java +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading
src/com/android/bluetooth/pbap/BluetoothPbapObexServer.java +12 −6 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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, Loading Loading @@ -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 { Loading @@ -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 { Loading Loading @@ -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 { Loading @@ -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 { Loading
src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java +14 −4 Original line number Diff line number Diff line Loading @@ -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 { Loading @@ -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; } Loading