Loading android/app/src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java +22 −0 Original line number Diff line number Diff line Loading @@ -565,6 +565,7 @@ public class BluetoothPbapVcardManager { + composer.getErrorReason()); return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR; } vcard = StripTelephoneNumber(vcard); if (V) { Log.v(TAG, "Vcard Entry:"); Log.v(TAG,vcard); Loading Loading @@ -631,6 +632,27 @@ public class BluetoothPbapVcardManager { return ResponseCodes.OBEX_HTTP_OK; } public String StripTelephoneNumber (String vCard){ String attr [] = vCard.split(System.getProperty("line.separator")); String Vcard = ""; for (int i=0; i < attr.length; i++) { if(attr[i].startsWith("TEL")) { attr[i] = attr[i].replace("(", ""); attr[i] = attr[i].replace(")", ""); attr[i] = attr[i].replace("-", ""); attr[i] = attr[i].replace(" ", ""); } } for (int i=0; i < attr.length; i++) { if(!attr[i].equals("")){ Vcard = Vcard.concat(attr[i] + "\n"); } } Log.v(TAG, "Vcard with stripped telephone no.: " + Vcard); return Vcard; } /** * Handler to emit vCards to PCE. */ Loading Loading
android/app/src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java +22 −0 Original line number Diff line number Diff line Loading @@ -565,6 +565,7 @@ public class BluetoothPbapVcardManager { + composer.getErrorReason()); return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR; } vcard = StripTelephoneNumber(vcard); if (V) { Log.v(TAG, "Vcard Entry:"); Log.v(TAG,vcard); Loading Loading @@ -631,6 +632,27 @@ public class BluetoothPbapVcardManager { return ResponseCodes.OBEX_HTTP_OK; } public String StripTelephoneNumber (String vCard){ String attr [] = vCard.split(System.getProperty("line.separator")); String Vcard = ""; for (int i=0; i < attr.length; i++) { if(attr[i].startsWith("TEL")) { attr[i] = attr[i].replace("(", ""); attr[i] = attr[i].replace(")", ""); attr[i] = attr[i].replace("-", ""); attr[i] = attr[i].replace(" ", ""); } } for (int i=0; i < attr.length; i++) { if(!attr[i].equals("")){ Vcard = Vcard.concat(attr[i] + "\n"); } } Log.v(TAG, "Vcard with stripped telephone no.: " + Vcard); return Vcard; } /** * Handler to emit vCards to PCE. */ Loading