From 25144d93b7fc46946f4b56265c7d9c18c2f79701 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Mon, 27 Apr 2015 15:44:03 +0200 Subject: [PATCH 01/29] Fix chat notifications on lollipop --- src/org/linphone/ChatFragment.java | 5 +++++ src/org/linphone/LinphoneActivity.java | 14 ++++++++++++++ src/org/linphone/LinphoneManager.java | 10 ++++++---- .../linphone/compatibility/ApiTwentyOnePlus.java | 1 + 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/org/linphone/ChatFragment.java b/src/org/linphone/ChatFragment.java index 10ef4ac92..91157a2cf 100644 --- a/src/org/linphone/ChatFragment.java +++ b/src/org/linphone/ChatFragment.java @@ -438,6 +438,10 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC LinphoneService.instance().removeMessageNotification(); + if (LinphoneActivity.isInstanciated()) { + LinphoneActivity.instance().updateChatFragment(null); + } + LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull(); if (lc != null) { lc.removeListener(mListener); @@ -462,6 +466,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC if (getResources().getBoolean(R.bool.show_statusbar_only_on_dialer)) { LinphoneActivity.instance().hideStatusBar(); } + LinphoneActivity.instance().updateChatFragment(this); } String draft = getArguments().getString("messageDraft"); diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 2b0e8bf18..71605d991 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -102,6 +102,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene private FragmentsAvailable currentFragment, nextFragment; private List fragmentsHistory; private Fragment dialerFragment, messageListFragment, friendStatusListenerFragment; + private ChatFragment chatFragment; private SavedState dialerSavedState; private boolean isAnimationDisabled = false, preferLinphoneContacts = false; private OrientationEventListener mOrientationHelper; @@ -599,6 +600,15 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene changeCurrentFragment(FragmentsAvailable.ABOUT, null); } + public boolean displayChatMessageNotification(String address){ + if(chatFragment != null) { + if(chatFragment.getSipUri().equals(address)){ + return true; + } + } + return false; + } + public void displayChat(String sipUri) { if (getResources().getBoolean(R.bool.disable_chat)) { return; @@ -744,6 +754,10 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); } + public void updateChatFragment(ChatFragment fragment) { + chatFragment = fragment; + } + public void updateChatListFragment(ChatListFragment fragment) { messageListFragment = fragment; } diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 3ebd4d8c8..52b038723 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -717,10 +717,12 @@ public class LinphoneManager implements LinphoneCoreListener { try { Contact contact = ContactsManager.getInstance().findContactWithAddress(mServiceContext.getContentResolver(),from); if (!mServiceContext.getResources().getBoolean(R.bool.disable_chat__message_notification)) { - if(contact != null) { - LinphoneService.instance().displayMessageNotification(from.asStringUriOnly(), contact.getName(), textMessage); - } else { - LinphoneService.instance().displayMessageNotification(from.asStringUriOnly(), from.getUserName(), textMessage); + if(LinphoneActivity.isInstanciated() && !LinphoneActivity.instance().displayChatMessageNotification(from.asStringUriOnly())) { + if (contact != null) { + LinphoneService.instance().displayMessageNotification(from.asStringUriOnly(), contact.getName(), textMessage); + } else { + LinphoneService.instance().displayMessageNotification(from.asStringUriOnly(), from.getUserName(), textMessage); + } } } } catch (Exception e) { diff --git a/src/org/linphone/compatibility/ApiTwentyOnePlus.java b/src/org/linphone/compatibility/ApiTwentyOnePlus.java index d02e5c3e5..e12b228b7 100644 --- a/src/org/linphone/compatibility/ApiTwentyOnePlus.java +++ b/src/org/linphone/compatibility/ApiTwentyOnePlus.java @@ -50,6 +50,7 @@ public class ApiTwentyOnePlus { .setSmallIcon(R.drawable.chat_icon_over) .setAutoCancel(true) .setContentIntent(intent) + .setDefaults(Notification.DEFAULT_ALL) .setLargeIcon(contactIcon) .setCategory(Notification.CATEGORY_MESSAGE) .setVisibility(Notification.VISIBILITY_PRIVATE) From aa650803c71b2fe9d48f83f1d453e523da342ec1 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Mon, 27 Apr 2015 16:29:19 +0200 Subject: [PATCH 02/29] fix draft in chat message --- src/org/linphone/ChatFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/linphone/ChatFragment.java b/src/org/linphone/ChatFragment.java index 91157a2cf..9fbf83fa7 100644 --- a/src/org/linphone/ChatFragment.java +++ b/src/org/linphone/ChatFragment.java @@ -447,7 +447,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC lc.removeListener(mListener); } - getActivity().getIntent().putExtra("messageDraft", message.getText().toString()); + onSaveInstanceState(getArguments()); super.onPause(); } From 4d5d4869bb0882639a48a1248d2a267a8b66bed1 Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Mon, 27 Apr 2015 23:47:33 +0200 Subject: [PATCH 03/29] update bzrtp and linphone --- submodules/bzrtp | 2 +- submodules/linphone | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/bzrtp b/submodules/bzrtp index ebe07ed33..4a4f757f6 160000 --- a/submodules/bzrtp +++ b/submodules/bzrtp @@ -1 +1 @@ -Subproject commit ebe07ed33ef00f8ec133374977a5cadf42044fee +Subproject commit 4a4f757f66b02cf8834fd8d7a939bf54b245ad7e diff --git a/submodules/linphone b/submodules/linphone index 5a0c92bac..7b31dd3c5 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 5a0c92bac32d086e176e2b10d13c7fd5bb4c1032 +Subproject commit 7b31dd3c55380194a54c542a8f976fb1d3bb1a3c From 383c6a10fb02c8eaff37895028d6ca547f89166f Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Tue, 28 Apr 2015 12:25:25 +0200 Subject: [PATCH 04/29] Normalize numbers in contact --- src/org/linphone/ContactFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/org/linphone/ContactFragment.java b/src/org/linphone/ContactFragment.java index 2f98e33e1..cc07822f8 100644 --- a/src/org/linphone/ContactFragment.java +++ b/src/org/linphone/ContactFragment.java @@ -79,8 +79,9 @@ public class ContactFragment extends Fragment implements OnClickListener { private OnClickListener chatListener = new OnClickListener() { @Override public void onClick(View v) { - if (LinphoneActivity.isInstanciated()) + if (LinphoneActivity.isInstanciated()) { LinphoneActivity.instance().displayChat(v.getTag().toString()); + } } }; @@ -147,6 +148,7 @@ public class ContactFragment extends Fragment implements OnClickListener { v.findViewById(R.id.start_chat).setOnClickListener(chatListener); LinphoneProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig(); if (lpc != null) { + displayednumberOrAddress = lpc.normalizePhoneNumber(displayednumberOrAddress); if (!displayednumberOrAddress.startsWith("sip:")) { numberOrAddress = "sip:" + displayednumberOrAddress; } From d62252ed2299e87a33940d272ee2435a8689c63c Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Tue, 28 Apr 2015 12:26:02 +0200 Subject: [PATCH 05/29] hide video popup at the end of the timer --- src/org/linphone/InCallActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/linphone/InCallActivity.java b/src/org/linphone/InCallActivity.java index 181d1e677..31c474ff2 100644 --- a/src/org/linphone/InCallActivity.java +++ b/src/org/linphone/InCallActivity.java @@ -92,6 +92,7 @@ public class InCallActivity extends FragmentActivity implements OnClickListener private Animation slideOutLeftToRight, slideInRightToLeft, slideInBottomToTop, slideInTopToBottom, slideOutBottomToTop, slideOutTopToBottom; private CountDownTimer timer; private boolean isVideoCallPaused = false; + AcceptCallUpdateDialogFragment callUpdateDialog; private TableLayout callsList; private LayoutInflater inflater; @@ -192,6 +193,8 @@ public class InCallActivity extends FragmentActivity implements OnClickListener timer = new CountDownTimer(SECONDS_BEFORE_DENYING_CALL_UPDATE, 1000) { public void onTick(long millisUntilFinished) { } public void onFinish() { + if (callUpdateDialog != null) + callUpdateDialog.dismiss(); acceptCallUpdate(false); } }.start(); @@ -1140,7 +1143,7 @@ public class InCallActivity extends FragmentActivity implements OnClickListener private void showAcceptCallUpdateDialog() { FragmentManager fm = getSupportFragmentManager(); - AcceptCallUpdateDialogFragment callUpdateDialog = new AcceptCallUpdateDialogFragment(); + callUpdateDialog = new AcceptCallUpdateDialogFragment(); callUpdateDialog.show(fm, "Accept Call Update Dialog"); } From e86833a9a1d35e32f99db5143817851398f27947 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 28 Apr 2015 13:54:22 +0200 Subject: [PATCH 06/29] ChatStorage.java: getHistory(1) returns a single message, remove unneeded security (#2091) --- src/org/linphone/ChatStorage.java | 133 +++++++++++++++--------------- 1 file changed, 66 insertions(+), 67 deletions(-) diff --git a/src/org/linphone/ChatStorage.java b/src/org/linphone/ChatStorage.java index 189678463..259aa05f9 100644 --- a/src/org/linphone/ChatStorage.java +++ b/src/org/linphone/ChatStorage.java @@ -47,7 +47,7 @@ public class ChatStorage { private static final int OUTGOING = 0; private static final int READ = 1; private static final int NOT_READ = 0; - + private static ChatStorage instance; private Context context; private SQLiteDatabase db; @@ -66,7 +66,7 @@ public class ChatStorage { instance.close(); instance = new ChatStorage(LinphoneService.instance().getApplicationContext()); } - + private boolean isVersionUsingNewChatStorage() { try { return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode >= 2200; @@ -75,7 +75,7 @@ public class ChatStorage { } return true; } - + private ChatStorage(Context c) { context = c; boolean useLinphoneStorage = c.getResources().getBoolean(R.bool.use_linphone_chat_storage); @@ -84,24 +84,24 @@ public class ChatStorage { updateNeeded = updateNeeded && !isVersionUsingNewChatStorage(); useNativeAPI = useLinphoneStorage && !updateNeeded; Log.d("Using native API: " + useNativeAPI); - + if (!useNativeAPI) { ChatHelper chatHelper = new ChatHelper(context); db = chatHelper.getWritableDatabase(); } } - + public void close() { if (!useNativeAPI) { db.close(); } } - + public void updateMessageStatus(String to, String message, int status) { if (useNativeAPI) { return; } - + String[] whereArgs = { String.valueOf(OUTGOING), to, message }; Cursor c = db.query(TABLE_NAME, null, "direction LIKE ? AND remoteContact LIKE ? AND message LIKE ?", whereArgs, null, null, "id DESC"); @@ -114,29 +114,29 @@ public class ChatStorage { } } c.close(); - + if (id != null && id.length() > 0) { int intID = Integer.parseInt(id); updateMessageStatus(to, intID, status); } } - + public void updateMessageStatus(String to, int id, int status) { if (useNativeAPI) { return; } - + ContentValues values = new ContentValues(); values.put("status", status); - + db.update(TABLE_NAME, values, "id LIKE " + id, null); } - + public int saveTextMessage(String from, String to, String message, long time) { if (useNativeAPI) { return -1; } - + ContentValues values = new ContentValues(); if (from.equals("")) { values.put("localContact", from); @@ -155,12 +155,12 @@ public class ChatStorage { values.put("time", time); return (int) db.insert(TABLE_NAME, null, values); } - + public int saveImageMessage(String from, String to, Bitmap image, String url, long time) { if (useNativeAPI) { return -1; } - + ContentValues values = new ContentValues(); if (from.equals("")) { values.put("localContact", from); @@ -176,73 +176,73 @@ public class ChatStorage { values.put("status", LinphoneChatMessage.State.Idle.toInt()); } values.put("url", url); - + if (image != null) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); image.compress(CompressFormat.JPEG, 100, baos); values.put("image", baos.toByteArray()); } - + values.put("time", time); return (int) db.insert(TABLE_NAME, null, values); } - + public void saveImage(int id, Bitmap image) { if (useNativeAPI) { //Handled before this point return; } - + if (image == null) return; - + ContentValues values = new ContentValues(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); image.compress(CompressFormat.JPEG, 100, baos); values.put("image", baos.toByteArray()); - + db.update(TABLE_NAME, values, "id LIKE " + id, null); } - + public int saveDraft(String to, String message) { if (useNativeAPI) { //TODO return -1; } - + ContentValues values = new ContentValues(); values.put("remoteContact", to); values.put("message", message); return (int) db.insert(DRAFT_TABLE_NAME, null, values); } - + public void updateDraft(String to, String message) { if (useNativeAPI) { //TODO return; } - + ContentValues values = new ContentValues(); values.put("message", message); - + db.update(DRAFT_TABLE_NAME, values, "remoteContact LIKE \"" + to + "\"", null); } - + public void deleteDraft(String to) { if (useNativeAPI) { //TODO return; } - + db.delete(DRAFT_TABLE_NAME, "remoteContact LIKE \"" + to + "\"", null); } - + public String getDraft(String to) { if (useNativeAPI) { //TODO return ""; } - + Cursor c = db.query(DRAFT_TABLE_NAME, null, "remoteContact LIKE \"" + to + "\"", null, null, null, "id ASC"); String message = null; @@ -254,13 +254,13 @@ public class ChatStorage { } } c.close(); - + return message; } - + public List getDrafts() { List drafts = new ArrayList(); - + if (useNativeAPI) { //TODO } else { @@ -276,16 +276,16 @@ public class ChatStorage { } c.close(); } - + return drafts; } - + public List getMessages(String correspondent) { List chatMessages = new ArrayList(); - + if (!useNativeAPI) { Cursor c = db.query(TABLE_NAME, null, "remoteContact LIKE \"" + correspondent + "\"", null, null, null, "id ASC"); - + while (c.moveToNext()) { try { String message, timestamp, url; @@ -297,7 +297,7 @@ public class ChatStorage { byte[] rawImage = c.getBlob(c.getColumnIndex("image")); int read = c.getInt(c.getColumnIndex("read")); url = c.getString(c.getColumnIndex("url")); - + ChatMessage chatMessage = new ChatMessage(id, message, rawImage, timestamp, direction == INCOMING, status, read == READ); chatMessage.setUrl(url); chatMessages.add(chatMessage); @@ -311,26 +311,26 @@ public class ChatStorage { LinphoneChatMessage[] history = room.getHistory(); for (int i = 0; i < history.length; i++) { LinphoneChatMessage message = history[i]; - + Bitmap bm = null; String url = message.getExternalBodyUrl(); if (url != null && !url.startsWith("http")) { bm = BitmapFactory.decodeFile(url); } - ChatMessage chatMessage = new ChatMessage(i+1, message.getText(), bm, - String.valueOf(message.getTime()), !message.isOutgoing(), + ChatMessage chatMessage = new ChatMessage(i+1, message.getText(), bm, + String.valueOf(message.getTime()), !message.isOutgoing(), message.getStatus().toInt(), message.isRead()); chatMessage.setUrl(url); chatMessages.add(chatMessage); } } - + return chatMessages; } public String getTextMessageForId(LinphoneChatRoom chatroom, int id) { String message = null; - + if (useNativeAPI) { LinphoneChatMessage[] history = chatroom.getHistory(); for (LinphoneChatMessage msg : history) { @@ -341,7 +341,7 @@ public class ChatStorage { } } else { Cursor c = db.query(TABLE_NAME, null, "id LIKE " + id, null, null, null, null); - + if (c.moveToFirst()) { try { message = c.getString(c.getColumnIndex("message")); @@ -351,10 +351,10 @@ public class ChatStorage { } c.close(); } - + return message; } - + public LinphoneChatMessage getMessage(LinphoneChatRoom chatroom, int id) { if (useNativeAPI) { LinphoneChatMessage[] history = chatroom.getHistory(); @@ -366,7 +366,7 @@ public class ChatStorage { } return null; } - + public void removeDiscussion(String correspondent) { if (useNativeAPI) { LinphoneChatRoom chatroom = LinphoneManager.getLc().getOrCreateChatRoom(correspondent); @@ -375,30 +375,29 @@ public class ChatStorage { db.delete(TABLE_NAME, "remoteContact LIKE \"" + correspondent + "\"", null); } } - + public ArrayList getChatList() { ArrayList chatList = new ArrayList(); - + if (useNativeAPI) { LinphoneChatRoom[] chats = LinphoneManager.getLc().getChatRooms(); List rooms = new ArrayList(); - + for (LinphoneChatRoom chatroom : chats) { if (chatroom.getHistory(1).length > 0) { rooms.add(chatroom); } } - + if (rooms.size() > 1) { Collections.sort(rooms, new Comparator() { @Override public int compare(LinphoneChatRoom a, LinphoneChatRoom b) { LinphoneChatMessage[] messagesA = a.getHistory(1); LinphoneChatMessage[] messagesB = b.getHistory(1); - long atime, btime; - // /!\ Warning: Have to take the second element because it returns two even when asking for only one... - atime = messagesA.length > 1 ? messagesA[1].getTime() : messagesA[0].getTime(); - btime = messagesA.length > 1 ? messagesB[1].getTime() : messagesB[0].getTime(); + long atime = messagesA[0].getTime(); + long btime = messagesB[0].getTime(); + if (atime > btime) return -1; else if (btime > atime) @@ -408,7 +407,7 @@ public class ChatStorage { } }); } - + for (LinphoneChatRoom chatroom : rooms) { chatList.add(chatroom.getPeerAddress().asStringUriOnly()); } @@ -423,7 +422,7 @@ public class ChatStorage { } c.close(); } - + return chatList; } @@ -440,7 +439,7 @@ public class ChatStorage { db.delete(TABLE_NAME, "id LIKE " + id, null); } } - + public void markMessageAsRead(int id) { if (!useNativeAPI) { ContentValues values = new ContentValues(); @@ -448,13 +447,13 @@ public class ChatStorage { db.update(TABLE_NAME, values, "id LIKE " + id, null); } } - + public void markConversationAsRead(LinphoneChatRoom chatroom) { if (useNativeAPI) { chatroom.markAsRead(); } } - + public int getUnreadMessageCount() { int count; if (!useNativeAPI) { @@ -489,10 +488,10 @@ public class ChatStorage { //Handled before this point return null; } - + String[] columns = { "image" }; Cursor c = db.query(TABLE_NAME, columns, "id LIKE " + id + "", null, null, null, null); - + if (c.moveToFirst()) { byte[] rawImage = c.getBlob(c.getColumnIndex("image")); c.close(); @@ -504,20 +503,20 @@ public class ChatStorage { } class ChatHelper extends SQLiteOpenHelper { - + private static final int DATABASE_VERSION = 15; private static final String DATABASE_NAME = "linphone-android"; - + ChatHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } - + @Override public void onCreate(SQLiteDatabase db) { db.execSQL("CREATE TABLE " + TABLE_NAME + " (id INTEGER PRIMARY KEY AUTOINCREMENT, localContact TEXT NOT NULL, remoteContact TEXT NOT NULL, direction INTEGER, message TEXT, image BLOB, url TEXT, time NUMERIC, read INTEGER, status INTEGER);"); db.execSQL("CREATE TABLE " + DRAFT_TABLE_NAME + " (id INTEGER PRIMARY KEY AUTOINCREMENT, remoteContact TEXT NOT NULL, message TEXT);"); } - + @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME + ";"); @@ -525,4 +524,4 @@ public class ChatStorage { onCreate(db); } } -} \ No newline at end of file +} From b61c49f9a16666361cf84064e021ff86d3f950f4 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Wed, 29 Apr 2015 11:04:26 +0200 Subject: [PATCH 07/29] Fix wizard --- res/values/non_localizable_custom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/values/non_localizable_custom.xml b/res/values/non_localizable_custom.xml index 23776f7fe..4e144a698 100644 --- a/res/values/non_localizable_custom.xml +++ b/res/values/non_localizable_custom.xml @@ -33,7 +33,7 @@ false true true - true + false false From e076acb2511d4fc9b0d89c43a6eab99352dc9859 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Wed, 29 Apr 2015 11:05:55 +0200 Subject: [PATCH 08/29] Fix contacts --- src/org/linphone/Contact.java | 12 ++++++++---- src/org/linphone/DialerFragment.java | 2 +- src/org/linphone/EditContactFragment.java | 9 ++++++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/org/linphone/Contact.java b/src/org/linphone/Contact.java index bbb4ebf13..ac9b04c4b 100644 --- a/src/org/linphone/Contact.java +++ b/src/org/linphone/Contact.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import org.linphone.compatibility.Compatibility; +import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneFriend; import android.content.ContentResolver; @@ -104,10 +105,13 @@ public class Contact implements Serializable { public void refresh(ContentResolver cr) { this.numbersOrAddresses = Compatibility.extractContactNumbersAndAddresses(id, cr); - for(LinphoneFriend friend : LinphoneManager.getLcIfManagerNotDestroyedOrNull().getFriendList()) { - if (friend.getRefKey().equals(id)) { - hasFriends = true; - this.numbersOrAddresses.add(friend.getAddress().asStringUriOnly()); + LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull(); + if(lc != null && lc.getFriendList() != null) { + for (LinphoneFriend friend :lc.getFriendList()){ + if (friend.getRefKey().equals(id)) { + hasFriends = true; + this.numbersOrAddresses.add(friend.getAddress().asStringUriOnly()); + } } } this.name = Compatibility.refreshContactName(cr, id); diff --git a/src/org/linphone/DialerFragment.java b/src/org/linphone/DialerFragment.java index 07ed122c8..61319cc6e 100644 --- a/src/org/linphone/DialerFragment.java +++ b/src/org/linphone/DialerFragment.java @@ -199,7 +199,7 @@ public class DialerFragment extends Fragment { mAddress.setText(intent.getData().getSchemeSpecificPart()); } else { Uri contactUri = intent.getData(); - String address = ContactsManager.getInstance().queryAddressOrNumber(getActivity().getContentResolver(),contactUri); + String address = ContactsManager.getInstance().queryAddressOrNumber(LinphoneService.instance().getContentResolver(),contactUri); if(address != null) { mAddress.setText(address); } else { diff --git a/src/org/linphone/EditContactFragment.java b/src/org/linphone/EditContactFragment.java index b63bd5cad..4200ac548 100644 --- a/src/org/linphone/EditContactFragment.java +++ b/src/org/linphone/EditContactFragment.java @@ -53,8 +53,11 @@ public class EditContactFragment extends Fragment { isNewContact = false; contactID = Integer.parseInt(contact.getID()); contact.refresh(getActivity().getContentResolver()); - } - if (getArguments().getString("NewSipAdress") != null) { + if (getArguments().getString("NewSipAdress") != null) { + newSipOrNumberToAdd = getArguments().getString("NewSipAdress"); + } + + } else if (getArguments().getString("NewSipAdress") != null) { newSipOrNumberToAdd = getArguments().getString("NewSipAdress"); isNewContact = true; } @@ -257,7 +260,7 @@ public class EditContactFragment extends Fragment { if (forceAddNumber) { tempNounoa = new NewOrUpdatedNumberOrAddress(isSip); } else { - if(isNewContact) { + if(isNewContact || newSipOrNumberToAdd != null) { tempNounoa = new NewOrUpdatedNumberOrAddress(isSip, numberOrAddress); } else { tempNounoa = new NewOrUpdatedNumberOrAddress(numberOrAddress, isSip); From bfe4941c5c10fec07aff6eec5fb59fcbe25acdec Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Wed, 29 Apr 2015 11:06:16 +0200 Subject: [PATCH 09/29] Fix notification chat for tablets --- src/org/linphone/LinphoneActivity.java | 10 ++++++++-- src/org/linphone/LinphoneManager.java | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 71605d991..85b0ac8ef 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -178,6 +178,9 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene mListener = new LinphoneCoreListenerBase(){ @Override public void messageReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message) { + if(!displayChatMessageNotification(message.getFrom().asStringUriOnly())) { + cr.markAsRead(); + } displayMissedChats(getChatStorage().getUnreadMessageCount()); if (messageListFragment != null && messageListFragment.isVisible()) { ((ChatListFragment) messageListFragment).refresh(); @@ -603,10 +606,10 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene public boolean displayChatMessageNotification(String address){ if(chatFragment != null) { if(chatFragment.getSipUri().equals(address)){ - return true; + return false; } } - return false; + return true; } public void displayChat(String sipUri) { @@ -651,6 +654,9 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene changeCurrentFragment(FragmentsAvailable.CHATLIST, null); displayChat(sipUri); } + if (messageListFragment != null && messageListFragment.isVisible()) { + ((ChatListFragment) messageListFragment).refresh(); + } } else { Intent intent = new Intent(this, ChatActivity.class); intent.putExtra("SipUri", sipUri); diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 52b038723..ea5ff88bc 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -717,7 +717,7 @@ public class LinphoneManager implements LinphoneCoreListener { try { Contact contact = ContactsManager.getInstance().findContactWithAddress(mServiceContext.getContentResolver(),from); if (!mServiceContext.getResources().getBoolean(R.bool.disable_chat__message_notification)) { - if(LinphoneActivity.isInstanciated() && !LinphoneActivity.instance().displayChatMessageNotification(from.asStringUriOnly())) { + if(LinphoneActivity.isInstanciated() && LinphoneActivity.instance().displayChatMessageNotification(from.asStringUriOnly())) { if (contact != null) { LinphoneService.instance().displayMessageNotification(from.asStringUriOnly(), contact.getName(), textMessage); } else { From 4396c1ea6a7c115e24ada24cbbea4187ed539256 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Wed, 29 Apr 2015 11:07:03 +0200 Subject: [PATCH 10/29] Fix tablet incoming call --- res/layout/incoming.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/res/layout/incoming.xml b/res/layout/incoming.xml index 1446ab81e..edab449f9 100644 --- a/res/layout/incoming.xml +++ b/res/layout/incoming.xml @@ -16,7 +16,7 @@ + android:layout_height="75dp"> - + Date: Thu, 30 Apr 2015 11:17:13 +0200 Subject: [PATCH 11/29] Use isPhoneNumber from ProxyConfig --- src/org/linphone/setup/WizardFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/linphone/setup/WizardFragment.java b/src/org/linphone/setup/WizardFragment.java index 571f56bdb..d9b642d16 100644 --- a/src/org/linphone/setup/WizardFragment.java +++ b/src/org/linphone/setup/WizardFragment.java @@ -157,7 +157,8 @@ public class WizardFragment extends Fragment { private boolean isUsernameCorrect(String username) { if (getResources().getBoolean(R.bool.allow_only_phone_numbers_in_wizard)) { - return username.matches("^(\\+)?(\\d-)?(\\d{3}-)?(\\d{3}-)?\\d{4,}$"); + LinphoneProxyConfig lpc = LinphoneManager.getLc().createProxyConfig(); + return lpc.isPhoneNumber(username); } else { return username.matches("^[a-zA-Z]+[a-zA-Z0-9.\\-_]{2,}$"); } From 9abe56939d80fbac998954e52fba3d2c50b20806 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Thu, 30 Apr 2015 15:50:02 +0200 Subject: [PATCH 12/29] Settings selected when go in about page --- src/org/linphone/LinphoneActivity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 85b0ac8ef..f29081502 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -601,6 +601,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene public void displayAbout() { changeCurrentFragment(FragmentsAvailable.ABOUT, null); + settings.setSelected(true); } public boolean displayChatMessageNotification(String address){ From e208bae8d9b916a1a1dfc449755cc796d7faa6aa Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Thu, 30 Apr 2015 16:15:31 +0200 Subject: [PATCH 13/29] Update tests in contacts --- tests/src/org/linphone/test/Contacts.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/src/org/linphone/test/Contacts.java b/tests/src/org/linphone/test/Contacts.java index 7e009de35..e55bf44df 100644 --- a/tests/src/org/linphone/test/Contacts.java +++ b/tests/src/org/linphone/test/Contacts.java @@ -4,6 +4,7 @@ import junit.framework.Assert; import org.linphone.ContactsFragment; import org.linphone.LinphoneActivity; +import org.linphone.R; import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.MediumTest; @@ -34,6 +35,8 @@ public class Contacts extends SampleTest { solo.clickOnText(iContext.getString(org.linphone.test.R.string.contact_name)); solo.clickOnText(aContext.getString(org.linphone.R.string.delete_contact)); + solo.sleep(1000); + solo.clickOnText(aContext.getString(R.string.button_ok)); Assert.assertFalse(solo.searchText(iContext.getString(org.linphone.test.R.string.contact_name))); } @@ -70,6 +73,7 @@ public class Contacts extends SampleTest { @LargeTest public void testDEditContactAddSipAddressAndRemoveNumber() { goToContacts(); + solo.clickOnText(aContext.getString(org.linphone.R.string.button_all_contacts)); solo.clickOnText(iContext.getString(org.linphone.test.R.string.contact_name)); solo.clickOnText(aContext.getString(org.linphone.R.string.button_edit)); @@ -110,6 +114,8 @@ public class Contacts extends SampleTest { solo.clickOnText(iContext.getString(org.linphone.test.R.string.contact_name)); solo.clickOnText(aContext.getString(org.linphone.R.string.delete_contact)); + solo.sleep(1000); + solo.clickOnText(aContext.getString(R.string.button_ok)); Assert.assertFalse(solo.searchText(iContext.getString(org.linphone.test.R.string.contact_name))); } From e1bdf48d20815de0a079abf28d95ae2d30a99484 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Thu, 30 Apr 2015 16:34:31 +0200 Subject: [PATCH 14/29] Update instruction link --- res/values-ar/custom.xml | 2 +- res/values-fr/custom.xml | 2 +- res/values-ja/custom.xml | 2 +- res/values-nl/custom.xml | 2 +- res/values-ru/custom.xml | 2 +- res/values-sr/custom.xml | 2 +- res/values/custom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/res/values-ar/custom.xml b/res/values-ar/custom.xml index 6caf982b4..537faaccf 100644 --- a/res/values-ar/custom.xml +++ b/res/values-ar/custom.xml @@ -13,7 +13,7 @@ مُسجَّل في %s فشِل التسجيل في %s لِنْفُونْ %s الهاتف الموافق لـ SIP (rfc 3261) برخصة جْنُو العمومية الإصدار 2 - http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications + http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/user-guide.html\n\n© 2015 Belledonne Communications سيمكنك هذا المرشد من إعداد حسابك SIP لإجراء المكالمات. إنشاء حساب في linphone.org أتوفر على حساب في linphone.org diff --git a/res/values-fr/custom.xml b/res/values-fr/custom.xml index 3b7e3c970..07a4feb90 100644 --- a/res/values-fr/custom.xml +++ b/res/values-fr/custom.xml @@ -13,7 +13,7 @@ Enregistré sur %s Échec d\'enregistrement sur %s Linphone %s SIP (rfc 3261) compatible téléphone, sous licence GNU Public License V2 - http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications + http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/user-guide.html\n\n© 2015 Belledonne Communications Cet assistant va vous guider pour réaliser des appels à l\'aide d\'un compte SIP. Créer un compte sur linphone.org J\'ai déjà un compte sur linphone.org diff --git a/res/values-ja/custom.xml b/res/values-ja/custom.xml index 272b162cd..f7590f37a 100644 --- a/res/values-ja/custom.xml +++ b/res/values-ja/custom.xml @@ -13,7 +13,7 @@ %s に登録しました %s への登録に失敗しました Linphone %s SIP (rfc 3261) compatible phone under GNU Public License V2 - http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications + http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/user-guide.html\n\n© 2015 Belledonne Communications アシスタントがSIPアカウントを使ってあなたの通話を助けます。 linphone.orgのアカウントを作成する linphone.orgのアカウントをすでに持っている diff --git a/res/values-nl/custom.xml b/res/values-nl/custom.xml index 9a01a01ac..63058ac6e 100644 --- a/res/values-nl/custom.xml +++ b/res/values-nl/custom.xml @@ -13,7 +13,7 @@ Geregistreerd naar %s Het registreren naar %s is mislukt Linphone %s SIP (rfc 3261)-compatibele telefoonapp onder de licentie van GNU Public License V2 - http://www.linphone.org\n\nGebruikershandleidingen\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications + http://www.linphone.org\n\nGebruikershandleidingen\nhttp://www.linphone.org/user-guide.html\n\n© 2015 Belledonne Communications Deze wizard zal u helpen bij het gebruiken van een SIP-account voor uw oproepen. Creëer een account op linphone.org Ik heb al een linphone.org-account diff --git a/res/values-ru/custom.xml b/res/values-ru/custom.xml index 87cdfe729..beed19a4d 100755 --- a/res/values-ru/custom.xml +++ b/res/values-ru/custom.xml @@ -8,7 +8,7 @@ Зарегистрирован в %s Ошибка регистрации в %s Linphone %s SIP (rfc 3261) совместимый телефон под GPL V2 лицензией - http://www.linphone.org\n\nИнструкции\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications + http://www.linphone.org\n\nИнструкции\nhttp://www.linphone.org/user-guide.html\n\n© 2015 Belledonne Communications Этот помощник поможет Вам настроить учётную запись SIP для звонков. Создать учётную запись на linphone.org Уже есть учётная запись на linphone.org diff --git a/res/values-sr/custom.xml b/res/values-sr/custom.xml index 11472e817..0d003a3e4 100644 --- a/res/values-sr/custom.xml +++ b/res/values-sr/custom.xml @@ -13,7 +13,7 @@ Уписан на „%s“ Нисам успео да се упишем на „%s“ Линфон %s телефон сагласан са СИП-ом (rfc 3261) под Гнуовом Јавном Лиценцом и2 - http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications + http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/user-guide.html\n\n© 2015 Belledonne Communications Овај помоћник ће вам помоћи да користите СИП налог за ваше позиве. Направи налог на линфон.орг-у Већ имам налог линфон.орг-а diff --git a/res/values/custom.xml b/res/values/custom.xml index 4101234c4..ae5743ca8 100644 --- a/res/values/custom.xml +++ b/res/values/custom.xml @@ -17,7 +17,7 @@ Registered to %s Fails to register to %s Linphone %s SIP (rfc 3261) compatible phone under GNU Public License V2 - http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications + http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/user-guide.html\n\n© 2015 Belledonne Communications This assistant will help you to use a SIP account for your calls. Create an account on linphone.org From ab79d2fa19cf88147a0173210ebc5908fa0c82e3 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Thu, 30 Apr 2015 16:35:47 +0200 Subject: [PATCH 15/29] refresh new proxy config --- src/org/linphone/setup/SetupActivity.java | 3 ++- src/org/linphone/setup/WizardConfirmFragment.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/org/linphone/setup/SetupActivity.java b/src/org/linphone/setup/SetupActivity.java index dacdf2642..6ae353d12 100644 --- a/src/org/linphone/setup/SetupActivity.java +++ b/src/org/linphone/setup/SetupActivity.java @@ -381,8 +381,9 @@ public class SetupActivity extends FragmentActivity implements OnClickListener { back.setVisibility(View.GONE); } - public void isAccountVerified() { + public void isAccountVerified(String username) { Toast.makeText(this, getString(R.string.setup_account_validated), Toast.LENGTH_LONG).show(); + LinphoneManager.getLcIfManagerNotDestroyedOrNull().refreshRegisters(); launchEchoCancellerCalibration(true); } diff --git a/src/org/linphone/setup/WizardConfirmFragment.java b/src/org/linphone/setup/WizardConfirmFragment.java index 0575afc83..0fbcbb482 100644 --- a/src/org/linphone/setup/WizardConfirmFragment.java +++ b/src/org/linphone/setup/WizardConfirmFragment.java @@ -59,7 +59,7 @@ public class WizardConfirmFragment extends Fragment { return view; } - private void isAccountVerified(String username) { + private void isAccountVerified(final String username) { final Runnable runNotReachable = new Runnable() { public void run() { Toast.makeText(getActivity(), getString(R.string.wizard_server_unavailable), Toast.LENGTH_LONG).show(); @@ -78,7 +78,7 @@ public class WizardConfirmFragment extends Fragment { Runnable runOk = new Runnable() { public void run() { - SetupActivity.instance().isAccountVerified(); + SetupActivity.instance().isAccountVerified(username); } }; From 581791fee518a6e19cdb543814761e7833d734f4 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Thu, 30 Apr 2015 16:46:36 +0200 Subject: [PATCH 16/29] Update linphone & belle-sip --- submodules/belle-sip | 2 +- submodules/linphone | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/belle-sip b/submodules/belle-sip index 7d27eb87c..6fd479005 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit 7d27eb87c5dbd530e1c0a95cd0da2e233fb4d6b5 +Subproject commit 6fd479005cf9e9be15449cab34717fe17bda6dc5 diff --git a/submodules/linphone b/submodules/linphone index 7b31dd3c5..6eda32d77 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 7b31dd3c55380194a54c542a8f976fb1d3bb1a3c +Subproject commit 6eda32d77244d5bdd4c8496891dfde8ca6f6069a From 985f9869a4437607011ef61c9221ffec880f56bb Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Thu, 30 Apr 2015 17:33:14 +0200 Subject: [PATCH 17/29] Version 2.4 --- AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 6776daa4e..745437b78 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="2400" android:installLocation="auto"> From d0fd28803d9a5f6bca147df3ad613fef6e4eca1f Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 4 May 2015 12:24:04 +0200 Subject: [PATCH 18/29] Release step can now be done without any user input --- .gitignore | 1 + Makefile | 3 --- README | 9 ++++++--- ant.properties | 1 + build.xml | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 06c6024eb..2c6cd49a5 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ submodules/externals/build/openh264/x86 tests/*$py.class tests/build.xml tests/project.properties +ant_password.properties diff --git a/Makefile b/Makefile index 948f110d2..1cad73c7c 100644 --- a/Makefile +++ b/Makefile @@ -462,9 +462,6 @@ install-apk: release: update-project $(ANT) clean - echo "What is the version name for the release ?"; \ - read version; \ - echo "version.name=$$version" > default.properties patch -p1 < release.patch $(ANT) release git checkout HEAD AndroidManifest.xml diff --git a/README b/README index b38f48131..42c287a8e 100644 --- a/README +++ b/README @@ -25,9 +25,12 @@ To build liblinphone for Android, you must: $ make mediastreamer2-sdk 7) (Optional) To generate a signed apk to publish on the Google Play, run $ make release -It will ask you for the version number that will be displayed in the about page of the app. -Make sure you filled the ant.properties values for key.store and key.alias in order to correctly -sign the generated apk (it will ask you the password during the process) +Make sure you filled the ant.properties values for version.name, key.store and key.alias in order to correctly +sign the generated apk. +You also may want to create a file name ant_password.properties with the following: +key.store.password=[your_password] +key.alias.password=[your_password] +If you don't, the passwords will be asked at the signing phase. To run the tutorials: -------------------- diff --git a/ant.properties b/ant.properties index 7f65258e5..d2cc146d1 100644 --- a/ant.properties +++ b/ant.properties @@ -1,3 +1,4 @@ source.dir=src:submodules/linphone/mediastreamer2/java/src:submodules/linphone/java/j2se:submodules/linphone/java/common:submodules/linphone/java/impl:submodules/linphone/coreapi/help/java:submodules/externals/axmlrpc/src/main/java key.store=bc-android.keystore key.alias=nw8000 +version.name=2.4.0 diff --git a/build.xml b/build.xml index cc1aeac67..c7297b2ab 100644 --- a/build.xml +++ b/build.xml @@ -27,7 +27,7 @@ --> - + + From 61ac3f2b30bf40a9a22bb235981f0288ea4f7c13 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 6 May 2015 15:51:51 +0200 Subject: [PATCH 24/29] Fix video disabled in settings issue --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index befec1fd9..8e7bb644d 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit befec1fd9344c901ceb1aca05be54c02386aef69 +Subproject commit 8e7bb644da3c3f84dfdb6da8aeca06e22a58ccc3 From 452a8b857eda06d86b26231b25fe3d4e71e3e724 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 6 May 2015 16:20:03 +0200 Subject: [PATCH 25/29] Fix debug mode setting changes not applies until app restart --- src/org/linphone/LinphonePreferences.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/linphone/LinphonePreferences.java b/src/org/linphone/LinphonePreferences.java index bdb89344a..ab43efba8 100644 --- a/src/org/linphone/LinphonePreferences.java +++ b/src/org/linphone/LinphonePreferences.java @@ -965,8 +965,8 @@ public class LinphonePreferences { // Advanced settings public void setDebugEnabled(boolean enabled) { getConfig().setBool("app", "debug", enabled); - LinphoneCoreFactory.instance().setDebugMode(enabled, getString(R.string.app_name)); LinphoneCoreFactory.instance().enableLogCollection(enabled); + LinphoneCoreFactory.instance().setDebugMode(enabled, getString(R.string.app_name)); } public boolean isDebugEnabled() { From d8bb551e7242ee2338b75585526131408e80e950 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 7 May 2015 10:45:58 +0200 Subject: [PATCH 26/29] Updated tester with new way of checking CPU ABIs --- .../src/org/linphone/tester/Tester.java | 46 ++++++++++++------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/liblinphone_tester/src/org/linphone/tester/Tester.java b/liblinphone_tester/src/org/linphone/tester/Tester.java index b01b73d79..5359cf58a 100644 --- a/liblinphone_tester/src/org/linphone/tester/Tester.java +++ b/liblinphone_tester/src/org/linphone/tester/Tester.java @@ -1,5 +1,7 @@ package org.linphone.tester; +import java.util.List; + import org.linphone.core.LinphoneCoreFactory; import org.linphone.mediastream.Version; @@ -23,25 +25,35 @@ public class Tester { } static { - - LinphoneCoreFactory.instance(); - - System.loadLibrary("cunit"); - String eabi = "armeabi"; - if (Version.isX86()) { - eabi = "x86"; - } else if (Version.isArmv7()) { - eabi = "armeabi-v7a"; + List cpuabis=Version.getCpuAbis(); + String ffmpegAbi; + boolean libLoaded=false; + Throwable firstException=null; + for (String abi : cpuabis){ + Log.i("LinphoneCoreFactoryImpl","Trying to load liblinphone for " + abi); + ffmpegAbi=abi; + // FFMPEG (audio/video) + if (abi.startsWith("armeabi")) { + ffmpegAbi="arm"; + } + loadOptionalLibrary("ffmpeg-linphone-"+ffmpegAbi); + //Main library + try { + System.loadLibrary("linphone-" + abi); + Log.i("LinphoneCoreFactoryImpl","Loading done with " + abi); + libLoaded=true; + break; + }catch(Throwable e) { + if (firstException == null) firstException=e; + } } - try { - System.loadLibrary("linphone_tester-"+eabi); - - } catch (UnsatisfiedLinkError ule) { - Log.w("linphone", "Failed to load liblinphone_tester-"+eabi); - System.loadLibrary("linphone_tester"); + + if (!libLoaded){ + throw new RuntimeException(firstException); + + }else{ + Version.dumpCapabilities(); } - - Version.dumpCapabilities(); } public native int run(String args[]); From a958c841eeb589f66a01df45eff14f8e1bb5fa50 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 7 May 2015 11:42:09 +0200 Subject: [PATCH 27/29] Updated linphone to fix video setting disabled on 64bits CPUs --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 8e7bb644d..7a5f88122 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 8e7bb644da3c3f84dfdb6da8aeca06e22a58ccc3 +Subproject commit 7a5f881221815f2621e876d3a677840053969d54 From 2f512441f0f7db1368761a718f8e7ef015922ea4 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 7 May 2015 12:06:06 +0200 Subject: [PATCH 28/29] Log the correct CPU ABI when service starts --- src/org/linphone/LinphoneService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index 45284019d..8dbe2c88a 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -494,7 +494,7 @@ public final class LinphoneService extends Service { //MANUFACTURER doesn't exist in android 1.5. //sb.append("MANUFACTURER=").append(Build.MANUFACTURER).append("\n"); sb.append("SDK=").append(Build.VERSION.SDK_INT).append("\n"); - sb.append("EABI=").append(Build.CPU_ABI).append("\n"); + sb.append("EABI=").append(Version.getCpuAbis().get(0)).append("\n"); Log.i(sb.toString()); } From 8bf79e4e13fae4c24da95ca835a07ceb625b5cee Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Mon, 11 May 2015 15:19:47 +0200 Subject: [PATCH 29/29] Fix bugs crash nullPointer --- res/layout-small/setup_wizard.xml | 80 +++++++++++++++------------ src/org/linphone/ContactsManager.java | 3 +- src/org/linphone/ui/Digit.java | 2 +- 3 files changed, 47 insertions(+), 38 deletions(-) diff --git a/res/layout-small/setup_wizard.xml b/res/layout-small/setup_wizard.xml index dd7d80908..addb837a7 100644 --- a/res/layout-small/setup_wizard.xml +++ b/res/layout-small/setup_wizard.xml @@ -78,35 +78,51 @@ android:singleLine="true" android:textColor="@android:color/black" android:background="@drawable/setup_field_background" /> - - - - + + + + + + + + + + - - - - + + \ No newline at end of file diff --git a/src/org/linphone/ContactsManager.java b/src/org/linphone/ContactsManager.java index 9fbc50d84..1e86f6958 100644 --- a/src/org/linphone/ContactsManager.java +++ b/src/org/linphone/ContactsManager.java @@ -593,9 +593,8 @@ public class ContactsManager { c.close(); return address; } + c.close(); } - - c.close(); return null; } diff --git a/src/org/linphone/ui/Digit.java b/src/org/linphone/ui/Digit.java index bd5294cb7..191026039 100644 --- a/src/org/linphone/ui/Digit.java +++ b/src/org/linphone/ui/Digit.java @@ -155,8 +155,8 @@ public class Digit extends Button implements AddressAware { if(id == R.id.Digit1 && lc.getCalls().length == 0){ String voiceMail = LinphonePreferences.instance().getVoiceMailUri(); mAddress.getEditableText().clear(); - mAddress.getEditableText().append(voiceMail); if(voiceMail != null){ + mAddress.getEditableText().append(voiceMail); LinphoneManager.getInstance().newOutgoingCall(mAddress); } return true;