diff --git a/.classpath b/.classpath
index 1e0614575..b6af78b2d 100644
--- a/.classpath
+++ b/.classpath
@@ -1,16 +1,17 @@
+
+
-
-
-
+
+
diff --git a/Makefile b/Makefile
index 97732eac6..3ce7fe652 100644
--- a/Makefile
+++ b/Makefile
@@ -163,7 +163,7 @@ run-tests:
$(SDK_PATH)/android update test-project --path . -m ../ && \
ant debug && \
ant installd && \
- ant test
+ adb shell am instrument -w -e size small org.linphone.test/android.test.InstrumentationTestRunner
clean:
$(NDK_PATH)/ndk-build clean $(LIBLINPHONE_OPTIONS)
diff --git a/jni/Android.mk b/jni/Android.mk
index db618e930..48395a229 100755
--- a/jni/Android.mk
+++ b/jni/Android.mk
@@ -11,12 +11,12 @@ ifeq ($(BUILD_G729),)
BUILD_G729=0
endif
BUILD_SRTP=1
+
+BUILD_X264=0
+LINPHONE_VIDEO=0
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
BUILD_X264=1
LINPHONE_VIDEO=1
-else
-LINPHONE_VIDEO=0
-BUILD_X264=0
endif
include $(linphone-root-dir)/submodules/linphone/mediastreamer2/src/android/libneon/Android.mk
diff --git a/res/layout-small/about.xml b/res/layout-small/about.xml
new file mode 100644
index 000000000..ec5bfef5a
--- /dev/null
+++ b/res/layout-small/about.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout-small/setup_linphone_login.xml b/res/layout-small/setup_linphone_login.xml
index 3ac5e20e8..43fb7145f 100644
--- a/res/layout-small/setup_linphone_login.xml
+++ b/res/layout-small/setup_linphone_login.xml
@@ -57,6 +57,7 @@
android:background="@drawable/setup_field_background" />
diff --git a/res/layout-small/status.xml b/res/layout-small/status.xml
index d3cc1c1ec..2606a4ef8 100644
--- a/res/layout-small/status.xml
+++ b/res/layout-small/status.xml
@@ -216,18 +216,6 @@
android:adjustViewBounds="true"
android:visibility="gone"
android:layout_alignParentRight="true" />
-
-
diff --git a/res/layout/chat_bubble_alt_incoming.xml b/res/layout/chat_bubble_alt_incoming.xml
index de8d7bb5b..50919279b 100644
--- a/res/layout/chat_bubble_alt_incoming.xml
+++ b/res/layout/chat_bubble_alt_incoming.xml
@@ -18,6 +18,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
+
+
+
+
diff --git a/res/values-FR/custom.xml b/res/values-FR/custom.xml
index c6281c118..1fc54f5d0 100644
--- a/res/values-FR/custom.xml
+++ b/res/values-FR/custom.xml
@@ -10,7 +10,16 @@
Erreur lors de l\'enregistrement en tant que %s
Linphone %s téléphone compatible SIP (rfc 3261) sous licence GPL V2\n http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications
+ Cet assistant va vous aider à configurer un compte SIP pour vos appels.
+ Créer un compte linphone.org
+ J\'ai déjà un compte linphone.org
+ J\'ai déjà un compte SIP
+ Entrez votre nom d\'utilisateur et votre mot de passe linphone.org
+ Entrez votre nom d\'utilisateur, votre mot de passe et le domaine de votre compte SIP
+
+ nom d\'utilisateur
+
@string/tunnel_mode_entry_value_disabled
-
\ No newline at end of file
+
diff --git a/res/values-FR/strings.xml b/res/values-FR/strings.xml
index 014f1bc56..6f902ca3b 100644
--- a/res/values-FR/strings.xml
+++ b/res/values-FR/strings.xml
@@ -152,8 +152,6 @@
Continuer
Ne plus me le rapeller
%s, voulez-vous aller dans les paramètres ?
- <P ALIGN=CENTER>Aucun compte SIP configuré, voulez-vous aller dans les paramètres ?<br/><br/> Besoin d\'aide ?<br/> "http://www.linphone.org/m/help"</p>
- <P ALIGN=CENTER>Bienvenue dans le téléphone SIP Linphone<br/><br/> Si vous êtes nouveau, jetez un oeil à <br/> "http://www.linphone.org/m/help"</p>
Démarrage de la calibration de l\'annulateur d\'écho
Impossible de démarrer un nouvel appel, un appel est en cours
Historique
@@ -271,14 +269,7 @@
Assistant de configuration des comptes
- Cet assistant va vous aider à configurer un compte SIP pour vos appels.
- Créer un compte linphone.org
- J\'ai déjà un compte linphone.org
- J\'ai déjà un compte SIP
- Entrez votre nom d\'utilisateur et votre mot de passe linphone.org
- Entrez votre nom d\'utilisateur, votre mot de passe et le domaine de votre compte SIP
Appliquer
- nom d\'utilisateur
mot de passe
domaine
confirmez le mot de passe
@@ -377,4 +368,7 @@
Reçu
Actif en arrière plan
+
+ Télécharger
+ Téléchargement échoué. Vérifiez votre connexion internet ou reéssayez plus tard.
diff --git a/res/values-RU/custom.xml b/res/values-RU/custom.xml
index 33ce90630..f920a5a65 100755
--- a/res/values-RU/custom.xml
+++ b/res/values-RU/custom.xml
@@ -10,6 +10,13 @@
Ошибка регистрации в %s
Linphone %s SIP (rfc 3261) совместимый телефон под GPL V2 лицензией\n http://www.linphone.org\n\nИнструкции\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications
+ Этот помощник поможет Вам настроить учётную запись SIP для звонков.
+ Создать учётную запись на linphone.org
+ Уже есть учётная запись на linphone.org
+ Уже есть учётная запись SIP
+ Введите имя пользователя и пароль учётной записи linphone.org
+ Введите имя пользователя, пароль и сервер учётной записи SIP
+
@string/tunnel_mode_entry_value_disabled
diff --git a/res/values-RU/strings.xml b/res/values-RU/strings.xml
index 8e399dde9..a25ef7733 100755
--- a/res/values-RU/strings.xml
+++ b/res/values-RU/strings.xml
@@ -197,8 +197,6 @@
Продолжить
Больше не напоминать
%s, хотите ли вы перейти к настройкам ?
- <P ALIGN=CENTER>Учётная запись SIP не настроена, хотите ли вы перейти к настройкам page ?<br/><br/> Нужна помощь ?<br/> "http://www.linphone.org/m/help"</p>
- <P ALIGN=CENTER>Добро пожаловать в SIP телефон Linphone<br/><br/> Если Вы новичок SIP, посетите<br/> "http://www.linphone.org/m/help"</p>
Начинаем автоматическую настройку шумоподавления
Невозможно начать новый звонок, звонок уже идёт
История
@@ -319,12 +317,6 @@
Помощник Настройки учётной записи
- Этот помощник поможет Вам настроить учётную запись SIP для звонков.
- Создать учётную запись на linphone.org
- Уже есть учётная запись на linphone.org
- Уже есть учётная запись SIP
- Введите имя пользователя и пароль учётной записи linphone.org
- Введите имя пользователя, пароль и сервер учётной записи SIP
Применить
имя пользователя
пароль
diff --git a/res/values/custom.xml b/res/values/custom.xml
index ad865d8d9..b96131b80 100644
--- a/res/values/custom.xml
+++ b/res/values/custom.xml
@@ -15,6 +15,15 @@
Fails to register to %s
Linphone %s SIP (rfc 3261) compatible phone under GNU Public License V2\n http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/m/help\n\n© 2011 Belledonne Communications
+ This assistant will help you to use a SIP account for your calls.
+ Create an account on linphone.org
+ I already have a linphone.org account
+ I already have a SIP account
+ Enter your linphone.org username and password
+ Enter your SIP account username, password and domain
+
+ username
+
-
\ No newline at end of file
+
diff --git a/res/values/non_localizable_custom.xml b/res/values/non_localizable_custom.xml
index 0b8446b57..f322106a4 100644
--- a/res/values/non_localizable_custom.xml
+++ b/res/values/non_localizable_custom.xml
@@ -8,6 +8,7 @@
622464153529
sip.linphone.org
+ false
https://www.linphone.org/wizard.php
@@ -19,10 +20,14 @@
false
false
false
+
+ false
+ false
+ false
false
false
false
- true
+ true
false
@@ -35,14 +40,15 @@
false
true
true
+ false
true
false
- true
-
false
+ true
false
+ false
false
@@ -52,11 +58,11 @@
true
false
false
+ false
true
- true
-
+ false
false
false
false
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1df892115..bd11295fe 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -197,8 +197,6 @@
Continue
Never remind me
%s, do you want to go to the settings page ?
- <P ALIGN=CENTER>No SIP account has been configured yet, do you want to go to the settings page ?<br/><br/> Need help ?<br/> "http://www.linphone.org/m/help"</p>
- <P ALIGN=CENTER>Welcome to Linphone SIP phone<br/><br/> If you are new to SIP, have a look at<br/> "http://www.linphone.org/m/help"</p>
Starting echo cancelation audio calibration
Cannot initiate a new call because a call is already engaged
History
@@ -319,14 +317,7 @@
Account Setup Assistant
- This assistant will help you to use a SIP account for your calls.
- Create an account on linphone.org
- I already have a linphone.org account
- I already have a SIP account
- Enter your linphone.org username and password
- Enter your SIP account username, password and domain
Apply
- username
password
domain
confirm password
@@ -426,9 +417,12 @@
Background mode
+ Download
+ Download failed. Please check your internet access or try again later.
+
Auth userid*
Enter authentication userid (optionnal)
- Enable UPNP
+ Enable UPNP
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index b4518b8f7..2767bec72 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -1,7 +1,7 @@
-
@@ -226,7 +226,9 @@
+
+
diff --git a/src/org/linphone/AboutFragment.java b/src/org/linphone/AboutFragment.java
index 1d1d2617a..7a8130d8a 100644
--- a/src/org/linphone/AboutFragment.java
+++ b/src/org/linphone/AboutFragment.java
@@ -69,7 +69,12 @@ public class AboutFragment extends Fragment implements OnClickListener {
@Override
public void onClick(View v) {
if (LinphoneActivity.isInstanciated()) {
- LinphoneActivity.instance().exit();
+
+ if (getResources().getBoolean(R.bool.enable_log_collect)) {
+ LinphoneUtils.collectLogs(getString(R.string.app_name), getString(R.string.about_bugreport_email));
+ } else {
+ LinphoneActivity.instance().exit();
+ }
}
}
}
diff --git a/src/org/linphone/BluetoothManager.java b/src/org/linphone/BluetoothManager.java
index 86c5b7070..3d3d6badf 100644
--- a/src/org/linphone/BluetoothManager.java
+++ b/src/org/linphone/BluetoothManager.java
@@ -1,5 +1,22 @@
package org.linphone;
+/*
+BluetoothManager.java
+Copyright (C) 2012 Belledonne Communications, Grenoble, France
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
import org.linphone.mediastream.Log;
import android.annotation.TargetApi;
@@ -10,14 +27,19 @@ import android.content.Intent;
import android.media.AudioManager;
import android.os.Build;
+/**
+ * @author Sylvain Berfini
+ */
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public class BluetoothManager extends BroadcastReceiver {
- @SuppressWarnings("deprecation")
+ @SuppressWarnings("deprecation")
public void onReceive(Context context, Intent intent) {
+ if (!LinphoneManager.isInstanciated())
+ return;
+
String action = intent.getAction();
LinphoneManager lm = LinphoneManager.getInstance();
- String actionScoConnected = AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED;
if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) {
Log.e("Bluetooth Received Event" + " ACTION_ACL_DISCONNECTED" );
@@ -33,7 +55,7 @@ public class BluetoothManager extends BroadcastReceiver {
lm.scoConnected();
}
}
- else if (actionScoConnected.equals(action)) {
+ else if (AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED.equals(action)) {
int state = intent.getIntExtra(AudioManager.EXTRA_SCO_AUDIO_STATE, 0);
Log.e("Bluetooth sco state changed : " + state);
if (state == AudioManager.SCO_AUDIO_STATE_CONNECTED) {
diff --git a/src/org/linphone/CallManager.java b/src/org/linphone/CallManager.java
index 9009a24d4..319b238fa 100644
--- a/src/org/linphone/CallManager.java
+++ b/src/org/linphone/CallManager.java
@@ -49,7 +49,7 @@ public class CallManager {
- void inviteAddress(LinphoneAddress lAddress, boolean videoEnabled, boolean lowBandwidth) throws LinphoneCoreException {
+ public void inviteAddress(LinphoneAddress lAddress, boolean videoEnabled, boolean lowBandwidth) throws LinphoneCoreException {
LinphoneCore lc = LinphoneManager.getLc();
LinphoneCallParams params = lc.createDefaultCallParameters();
diff --git a/src/org/linphone/ChatFragment.java b/src/org/linphone/ChatFragment.java
index 8ef341230..2e30b64c7 100644
--- a/src/org/linphone/ChatFragment.java
+++ b/src/org/linphone/ChatFragment.java
@@ -156,13 +156,17 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
progressBar = (ProgressBar) view.findViewById(R.id.progressbar);
sendImage = (TextView) view.findViewById(R.id.sendPicture);
- registerForContextMenu(sendImage);
- sendImage.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- pickImage();
- }
- });
+ if (!getResources().getBoolean(R.bool.disable_chat_send_file)) {
+ registerForContextMenu(sendImage);
+ sendImage.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ pickImage();
+ }
+ });
+ } else {
+ sendImage.setEnabled(false);
+ }
cancelUpload = (ImageView) view.findViewById(R.id.cancelUpload);
cancelUpload.setOnClickListener(new OnClickListener() {
@@ -308,10 +312,10 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
if (msg.getMessage() != null) {
displayMessage(msg.getId(), msg.getMessage(), msg.getTimestamp(), msg.isIncoming(), msg.getStatus(), messagesLayout);
} else {
- displayImageMessage(msg.getId(), msg.getImage(), msg.getTimestamp(), msg.isIncoming(), msg.getStatus(), messagesLayout);
+ displayImageMessage(msg.getId(), msg.getImage(), msg.getTimestamp(), msg.isIncoming(), msg.getStatus(), messagesLayout, msg.getUrl());
}
- if (!msg.isRed())
+ if (!msg.isRead())
chatStorage.markMessageAsRead(msg.getId());
}
LinphoneActivity.instance().updateMissedChatCount();
@@ -373,13 +377,43 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
registerForContextMenu(v);
}
- private void displayImageMessage(int id, Bitmap image, String time, boolean isIncoming, LinphoneChatMessage.State status, RelativeLayout layout) {
+ private void displayImageMessage(final int id, Bitmap image, String time, boolean isIncoming, LinphoneChatMessage.State status, RelativeLayout layout, final String url) {
BubbleChat bubble = new BubbleChat(layout.getContext(), id, null, image, time, isIncoming, status, previousMessageID);
if (!isIncoming) {
lastSentMessageBubble = bubble;
}
+
+ final View v = bubble.getView();
+ bubble.setDownloadImageButtonListener(new OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ final Bitmap bm = ChatFragment.downloadImage(url);
+ if (bm != null) {
+ LinphoneActivity.instance().getChatStorage().saveImage(id, bm);
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ ((ImageView)v.findViewById(R.id.image)).setImageBitmap(bm);
+ v.findViewById(R.id.image).setVisibility(View.VISIBLE);
+ v.findViewById(R.id.download).setVisibility(View.GONE);
+ }
+ });
+ } else {
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ LinphoneActivity.instance().displayCustomToast(getString(R.string.download_image_failed), Toast.LENGTH_LONG);
+ }
+ });
+ }
+ }
+ }).start();
+ }
+ });
- View v = bubble.getView();
previousMessageID = id;
layout.addView(v);
registerForContextMenu(v);
@@ -541,7 +575,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
}
latestImageMessages.put(newId, url);
- displayImageMessage(newId, bitmap, String.valueOf(System.currentTimeMillis()), false, State.InProgress, messagesLayout);
+ displayImageMessage(newId, bitmap, String.valueOf(System.currentTimeMillis()), false, State.InProgress, messagesLayout, url);
scrollToEnd();
} else if (!isNetworkReachable && LinphoneActivity.isInstanciated()) {
LinphoneActivity.instance().displayCustomToast(getString(R.string.error_network_unreachable), Toast.LENGTH_LONG);
@@ -576,13 +610,22 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
});
} else if (message.getExternalBodyUrl() != null) {
byte[] rawImage = LinphoneActivity.instance().getChatStorage().getRawImageFromMessage(id);
- final Bitmap bm = BitmapFactory.decodeByteArray(rawImage, 0, rawImage.length);
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- displayImageMessage(id, bm, String.valueOf(message.getTime()), true, null, messagesLayout);
- }
- });
+ if (rawImage == null) {
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ displayImageMessage(id, null, String.valueOf(message.getTime()), true, null, messagesLayout, message.getExternalBodyUrl());
+ }
+ });
+ } else {
+ final Bitmap bm = BitmapFactory.decodeByteArray(rawImage, 0, rawImage.length);
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ displayImageMessage(id, bm, String.valueOf(message.getTime()), true, null, messagesLayout, "");
+ }
+ });
+ }
}
scrollToEnd();
}
diff --git a/src/org/linphone/ChatMessage.java b/src/org/linphone/ChatMessage.java
index 185e3f474..eb45e3b4c 100644
--- a/src/org/linphone/ChatMessage.java
+++ b/src/org/linphone/ChatMessage.java
@@ -29,13 +29,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
public class ChatMessage {
private String message;
private String timestamp;
+ private String url;
private boolean incoming;
private int status;
private int id;
private Bitmap image;
- private boolean isRed;
+ private boolean isRead;
- public ChatMessage(int id, String message, byte[] rawImage, String timestamp, boolean incoming, int status, boolean red) {
+ public ChatMessage(int id, String message, byte[] rawImage, String timestamp, boolean incoming, int status, boolean read) {
super();
this.id = id;
this.message = message;
@@ -43,7 +44,7 @@ public class ChatMessage {
this.incoming = incoming;
this.status = status;
this.image = rawImage != null ? BitmapFactory.decodeByteArray(rawImage, 0, rawImage.length) : null;
- this.isRed = red;
+ this.isRead = read;
}
public int getId() {
@@ -86,7 +87,15 @@ public class ChatMessage {
return image;
}
- public boolean isRed() {
- return isRed;
+ public boolean isRead() {
+ return isRead;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
}
}
diff --git a/src/org/linphone/ChatStorage.java b/src/org/linphone/ChatStorage.java
index b082d43b5..e8bd64de0 100644
--- a/src/org/linphone/ChatStorage.java
+++ b/src/org/linphone/ChatStorage.java
@@ -81,7 +81,7 @@ public class ChatStorage {
db.update(TABLE_NAME, values, "id LIKE " + id, null);
}
- public int saveMessage(String from, String to, String message, long time) {
+ public int saveTextMessage(String from, String to, String message, long time) {
ContentValues values = new ContentValues();
if (from.equals("")) {
values.put("localContact", from);
@@ -101,10 +101,7 @@ public class ChatStorage {
return (int) db.insert(TABLE_NAME, null, values);
}
- public int saveMessage(String from, String to, Bitmap image, long time) {
- if (image == null)
- return -1;
-
+ public int saveImageMessage(String from, String to, Bitmap image, String url, long time) {
ContentValues values = new ContentValues();
if (from.equals("")) {
values.put("localContact", from);
@@ -119,13 +116,28 @@ public class ChatStorage {
values.put("read", NOT_READ);
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 (image == null)
+ return;
+
+ ContentValues values = new ContentValues();
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);
+ db.update(TABLE_NAME, values, "id LIKE " + id, null);
}
public int saveDraft(String to, String message) {
@@ -186,7 +198,7 @@ public class ChatStorage {
while (c.moveToNext()) {
try {
- String message, timestamp;
+ String message, timestamp, url;
int id = c.getInt(c.getColumnIndex("id"));
int direction = c.getInt(c.getColumnIndex("direction"));
message = c.getString(c.getColumnIndex("message"));
@@ -194,8 +206,10 @@ public class ChatStorage {
int status = c.getInt(c.getColumnIndex("status"));
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);
} catch (Exception e) {
e.printStackTrace();
@@ -253,11 +267,18 @@ public class ChatStorage {
}
public int getUnreadMessageCount() {
- return db.query(TABLE_NAME, null, "read LIKE " + NOT_READ, null, null, null, null).getCount();
+ Cursor c = db.query(TABLE_NAME, null, "read LIKE " + NOT_READ, null, null, null, null);
+ int count = c.getCount();
+ c.close();
+ return count;
+
}
public int getUnreadMessageCount(String contact) {
- return db.query(TABLE_NAME, null, "remoteContact LIKE \"" + contact + "\" AND read LIKE " + NOT_READ, null, null, null, null).getCount();
+ Cursor c = db.query(TABLE_NAME, null, "remoteContact LIKE \"" + contact + "\" AND read LIKE " + NOT_READ, null, null, null, null);
+ int count = c.getCount();
+ c.close();
+ return count;
}
public byte[] getRawImageFromMessage(int id) {
@@ -267,7 +288,7 @@ public class ChatStorage {
if (c.moveToFirst()) {
byte[] rawImage = c.getBlob(c.getColumnIndex("image"));
c.close();
- return rawImage;
+ return (rawImage == null || rawImage.length == 0) ? null : rawImage;
}
c.close();
@@ -276,7 +297,7 @@ public class ChatStorage {
class ChatHelper extends SQLiteOpenHelper {
- private static final int DATABASE_VERSION = 14;
+ private static final int DATABASE_VERSION = 15;
private static final String DATABASE_NAME = "linphone-android";
ChatHelper(Context context) {
@@ -285,7 +306,7 @@ public class ChatStorage {
@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, time NUMERIC, read INTEGER, status INTEGER);");
+ 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);");
}
diff --git a/src/org/linphone/ContactFragment.java b/src/org/linphone/ContactFragment.java
index d42603fcb..a8d341709 100644
--- a/src/org/linphone/ContactFragment.java
+++ b/src/org/linphone/ContactFragment.java
@@ -101,7 +101,7 @@ public class ContactFragment extends Fragment implements OnClickListener {
String displayednumberOrAddress = numberOrAddress;
if (numberOrAddress.startsWith("sip:")) {
- displayednumberOrAddress = displayednumberOrAddress.substring(4);
+ displayednumberOrAddress = displayednumberOrAddress.replace("sip:", "");
}
TextView tv = (TextView) v.findViewById(R.id.numeroOrAddress);
@@ -116,16 +116,19 @@ public class ContactFragment extends Fragment implements OnClickListener {
}
v.findViewById(R.id.chat).setOnClickListener(chatListener);
- if (LinphoneUtils.isSipAddress(numberOrAddress)) {
- v.findViewById(R.id.chat).setTag(numberOrAddress);
- } else {
- LinphoneProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig();
- if (lpc != null) {
- if (!numberOrAddress.startsWith("sip:")) {
- numberOrAddress = "sip:" + numberOrAddress;
- }
- v.findViewById(R.id.chat).setTag(numberOrAddress + "@" + lpc.getDomain());
+ LinphoneProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig();
+ if (lpc != null) {
+ if (!displayednumberOrAddress.startsWith("sip:")) {
+ numberOrAddress = "sip:" + displayednumberOrAddress;
}
+
+ String tag = numberOrAddress;
+ if (!numberOrAddress.contains("@")) {
+ tag = numberOrAddress + "@" + lpc.getDomain();
+ }
+ v.findViewById(R.id.chat).setTag(tag);
+ } else {
+ v.findViewById(R.id.chat).setTag(numberOrAddress);
}
final String finalNumberOrAddress = numberOrAddress;
diff --git a/src/org/linphone/EditContactFragment.java b/src/org/linphone/EditContactFragment.java
index c9e34268a..a358262d0 100644
--- a/src/org/linphone/EditContactFragment.java
+++ b/src/org/linphone/EditContactFragment.java
@@ -99,10 +99,7 @@ public class EditContactFragment extends Fragment {
try {
getActivity().getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
-
- if (isNewContact) {
- LinphoneActivity.instance().prepareContactsInBackground();
- }
+ LinphoneActivity.instance().prepareContactsInBackground();
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/src/org/linphone/HistoryDetailFragment.java b/src/org/linphone/HistoryDetailFragment.java
index 921b89f9d..ebbfbe432 100644
--- a/src/org/linphone/HistoryDetailFragment.java
+++ b/src/org/linphone/HistoryDetailFragment.java
@@ -23,8 +23,6 @@ import java.util.Calendar;
import org.linphone.core.LinphoneAddress;
import org.linphone.core.LinphoneCoreException;
import org.linphone.core.LinphoneCoreFactory;
-import org.linphone.mediastream.Log;
-import org.linphone.ui.AvatarWithShadow;
import android.annotation.SuppressLint;
import android.net.Uri;
@@ -42,7 +40,6 @@ import android.widget.TextView;
*/
public class HistoryDetailFragment extends Fragment implements OnClickListener {
private ImageView dialBack, chat, addToContacts;
- private AvatarWithShadow contactPicture;
private View view;
private TextView contactName, contactAddress, callDirection, time, date;
private String sipUri, displayName, pictureUri;
@@ -59,8 +56,6 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
view = inflater.inflate(R.layout.history_detail, container, false);
- contactPicture = (AvatarWithShadow) view.findViewById(R.id.contactPicture);
-
dialBack = (ImageView) view.findViewById(R.id.dialBack);
dialBack.setOnClickListener(this);
@@ -91,7 +86,11 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
private void displayHistory(String status, String callTime, String callDate) {
contactName.setText(displayName == null ? sipUri : displayName);
- contactAddress.setText(sipUri);
+ if (getResources().getBoolean(R.bool.never_display_sip_addresses)) {
+ contactAddress.setText(LinphoneUtils.getUsernameFromAddress(sipUri));
+ } else {
+ contactAddress.setText(sipUri);
+ }
if (status.equals("Missed")) {
callDirection.setText(getString(R.string.call_state_missed));
@@ -109,14 +108,13 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
LinphoneAddress lAddress;
try {
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
+ LinphoneUtils.findUriPictureOfContactAndSetDisplayName(lAddress, view.getContext().getContentResolver());
+ String displayName = lAddress.getDisplayName();
+ if (displayName != null) {
+ view.findViewById(R.id.addContactRow).setVisibility(View.GONE);
+ }
} catch (LinphoneCoreException e) {
- Log.e("History details error",e);
- return;
- }
- LinphoneUtils.findUriPictureOfContactAndSetDisplayName(lAddress, view.getContext().getContentResolver());
- String displayName = lAddress.getDisplayName();
- if (displayName != null) {
- view.findViewById(R.id.addContactRow).setVisibility(View.GONE);
+ e.printStackTrace();
}
}
@@ -148,7 +146,11 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
} else if (id == R.id.chat) {
LinphoneActivity.instance().displayChat(sipUri);
} else if (id == R.id.addToContacts) {
- LinphoneActivity.instance().displayContactsForEdition(sipUri);
+ String uriToAdd = sipUri;
+ if (getResources().getBoolean(R.bool.never_display_sip_addresses)) {
+ uriToAdd = LinphoneUtils.getUsernameFromAddress(sipUri);
+ }
+ LinphoneActivity.instance().displayContactsForEdition(uriToAdd);
}
}
diff --git a/src/org/linphone/InCallActivity.java b/src/org/linphone/InCallActivity.java
index 2e23a38f9..1d6d6f30c 100644
--- a/src/org/linphone/InCallActivity.java
+++ b/src/org/linphone/InCallActivity.java
@@ -248,6 +248,20 @@ public class InCallActivity extends FragmentActivity implements
slideOutBottomToTop = AnimationUtils.loadAnimation(this, R.anim.slide_out_bottom_to_top);
slideOutTopToBottom = AnimationUtils.loadAnimation(this, R.anim.slide_out_top_to_bottom);
}
+
+ if (LinphoneManager.getInstance().isBluetoothScoConnected) {
+ try {
+ routeLayout.setVisibility(View.VISIBLE);
+ } catch (NullPointerException npe) {}
+ audioRoute.setVisibility(View.VISIBLE);
+ speaker.setVisibility(View.GONE);
+ } else {
+ try {
+ routeLayout.setVisibility(View.GONE);
+ } catch (NullPointerException npe) {}
+ audioRoute.setVisibility(View.GONE);
+ speaker.setVisibility(View.VISIBLE);
+ }
}
private void refreshInCallActions() {
@@ -267,20 +281,6 @@ public class InCallActivity extends FragmentActivity implements
}
}
- if (LinphoneManager.getInstance().isBluetoothScoConnected) {
- try {
- routeLayout.setVisibility(View.VISIBLE);
- } catch (NullPointerException npe) {}
- audioRoute.setVisibility(View.VISIBLE);
- speaker.setVisibility(View.GONE);
- } else {
- try {
- routeLayout.setVisibility(View.GONE);
- } catch (NullPointerException npe) {}
- audioRoute.setVisibility(View.GONE);
- speaker.setVisibility(View.VISIBLE);
- }
-
try {
if (isSpeakerEnabled) {
speaker.setBackgroundResource(R.drawable.speaker_on);
@@ -333,11 +333,13 @@ public class InCallActivity extends FragmentActivity implements
mHandler.post(new Runnable() {
@Override
public void run() {
- options.setEnabled(true);
+ addCall.setEnabled(LinphoneManager.getLc().getCallsNb() < LinphoneManager.getLc().getMaxCalls());
+ transfer.setEnabled(getResources().getBoolean(R.bool.allow_transfers));
+ options.setEnabled(!getResources().getBoolean(R.bool.disable_options_in_call) && (addCall.isEnabled() || transfer.isEnabled()));
+
video.setEnabled(true);
micro.setEnabled(true);
speaker.setEnabled(true);
- addCall.setEnabled(true);
transfer.setEnabled(true);
pause.setEnabled(true);
dialer.setEnabled(true);
diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java
index d38498726..9d94401b5 100644
--- a/src/org/linphone/LinphoneActivity.java
+++ b/src/org/linphone/LinphoneActivity.java
@@ -138,7 +138,7 @@ public class LinphoneActivity extends FragmentActivity implements
return;
}
- boolean useFirstLoginActivity = getResources().getBoolean(R.bool.use_first_login_activity);
+ boolean useFirstLoginActivity = getResources().getBoolean(R.bool.display_account_wizard_at_first_start);
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
if (useFirstLoginActivity && !pref.getBoolean(getString(R.string.first_launch_suceeded_once_key), false)) {
if (pref.getInt(getString(R.string.pref_extra_accounts), -1) > -1) {
@@ -157,7 +157,7 @@ public class LinphoneActivity extends FragmentActivity implements
if (findViewById(R.id.fragmentContainer) != null) {
dialerFragment = new DialerFragment();
dialerFragment.setArguments(getIntent().getExtras());
- getSupportFragmentManager().beginTransaction().add(R.id.fragmentContainer, dialerFragment).commit();
+ getSupportFragmentManager().beginTransaction().add(R.id.fragmentContainer, dialerFragment, currentFragment.toString()).commit();
selectMenu(FragmentsAvailable.DIALER);
}
}
@@ -367,7 +367,7 @@ public class LinphoneActivity extends FragmentActivity implements
}
transaction.addToBackStack(newFragmentType.toString());
- transaction.replace(R.id.fragmentContainer, newFragment);
+ transaction.replace(R.id.fragmentContainer, newFragment, newFragmentType.toString());
transaction.commitAllowingStateLoss();
getSupportFragmentManager().executePendingTransactions();
@@ -751,12 +751,12 @@ public class LinphoneActivity extends FragmentActivity implements
public int onMessageSent(String to, String message) {
getChatStorage().deleteDraft(to);
- return getChatStorage().saveMessage("", to, message, System.currentTimeMillis());
+ return getChatStorage().saveTextMessage("", to, message, System.currentTimeMillis());
}
public int onMessageSent(String to, Bitmap image, String imageURL) {
getChatStorage().deleteDraft(to);
- return getChatStorage().saveMessage("", to, image, System.currentTimeMillis());
+ return getChatStorage().saveImageMessage("", to, image, imageURL, System.currentTimeMillis());
}
public void onMessageStateChanged(String to, String message, int newState) {
@@ -1375,19 +1375,26 @@ public class LinphoneActivity extends FragmentActivity implements
} else if (LinphoneUtils.onKeyBackGoHome(this, keyCode, event)) {
return true;
}
- } else if (!isTablet()) {
- int backStackEntryCount = getSupportFragmentManager().getBackStackEntryCount();
- if (backStackEntryCount <= 1) {
- showStatusBar();
- }
-
- if (currentFragment == FragmentsAvailable.SETTINGS) {
- showStatusBar();
- reloadConfig();
- updateAnimationsState();
- } else if (currentFragment == FragmentsAvailable.CHATLIST) {
- //Hack to ensure display the status bar on some devices
- showStatusBar();
+ } else {
+ if (!isTablet()) {
+ int backStackEntryCount = getSupportFragmentManager().getBackStackEntryCount();
+ if (backStackEntryCount <= 1) {
+ showStatusBar();
+ }
+
+ if (currentFragment == FragmentsAvailable.SETTINGS) {
+ showStatusBar();
+ reloadConfig();
+ updateAnimationsState();
+ } else if (currentFragment == FragmentsAvailable.CHATLIST) {
+ //Hack to ensure display the status bar on some devices
+ showStatusBar();
+ }
+ } else {
+ if (currentFragment == FragmentsAvailable.SETTINGS) {
+ reloadConfig();
+ updateAnimationsState();
+ }
}
}
} else if (keyCode == KeyEvent.KEYCODE_MENU && statusFragment != null) {
diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java
index deeb5b029..59f7a8531 100644
--- a/src/org/linphone/LinphoneManager.java
+++ b/src/org/linphone/LinphoneManager.java
@@ -18,7 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.linphone;
-import static android.media.AudioManager.MODE_NORMAL;
import static android.media.AudioManager.MODE_RINGTONE;
import static android.media.AudioManager.STREAM_RING;
import static android.media.AudioManager.STREAM_VOICE_CALL;
@@ -98,7 +97,6 @@ import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
-import android.graphics.Bitmap;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
@@ -136,7 +134,7 @@ import android.widget.Toast;
* @author Guillaume Beraudo
*
*/
-public final class LinphoneManager implements LinphoneCoreListener {
+public class LinphoneManager implements LinphoneCoreListener {
private static LinphoneManager instance;
private Context mServiceContext;
@@ -174,7 +172,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
simpleListeners.remove(listener);
}
- private LinphoneManager(final Context c, LinphoneServiceListener listener) {
+ protected LinphoneManager(final Context c, LinphoneServiceListener listener) {
sExited=false;
mServiceContext = c;
mListenerDispatcher = new ListenerDispatcher(listener);
@@ -216,7 +214,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
private void routeAudioToSpeakerHelper(boolean speakerOn) {
isUsingBluetoothAudioRoute = false;
if (mAudioManager != null) {
- mAudioManager.setMode(AudioManager.MODE_NORMAL);
+ Compatibility.setAudioManagerInCallMode(mAudioManager);
mAudioManager.stopBluetoothSco();
mAudioManager.setBluetoothScoOn(false);
}
@@ -253,6 +251,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ @SuppressWarnings("deprecation")
public void startBluetooth() {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter.isEnabled()) {
@@ -263,7 +262,6 @@ public final class LinphoneManager implements LinphoneCoreListener {
if (profile == BluetoothProfile.HEADSET) {
mBluetoothHeadset = (BluetoothHeadset) proxy;
Log.d("Bluetooth headset connected");
- isBluetoothScoConnected = true;
}
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@@ -278,9 +276,11 @@ public final class LinphoneManager implements LinphoneCoreListener {
};
mBluetoothAdapter.getProfileProxy(mServiceContext, mProfileListener, BluetoothProfile.HEADSET);
} else {
- @SuppressWarnings("deprecation")
- String actionScoConnected = AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED;
- Intent currentValue = mServiceContext.registerReceiver(bluetoothReiceiver, new IntentFilter(actionScoConnected));
+ try {
+ mServiceContext.unregisterReceiver(bluetoothReiceiver);
+ } catch (Exception e) {}
+
+ Intent currentValue = mServiceContext.registerReceiver(bluetoothReiceiver, new IntentFilter(AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED));
int state = currentValue == null ? 0 : currentValue.getIntExtra(AudioManager.EXTRA_SCO_AUDIO_STATE, 0);
if (state == AudioManager.SCO_AUDIO_STATE_CONNECTED) {
isBluetoothScoConnected = true;
@@ -345,7 +345,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
Context c, LinphoneServiceListener listener) {
if (instance != null)
throw new RuntimeException("Linphone Manager is already initialized");
-
+
instance = new LinphoneManager(c, listener);
instance.startLibLinphone(c);
TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE);
@@ -386,6 +386,9 @@ public final class LinphoneManager implements LinphoneCoreListener {
LinphoneAddress lAddress;
try {
lAddress = mLc.interpretUrl(to);
+ if (mServiceContext.getResources().getBoolean(R.bool.override_domain_using_default_one)) {
+ lAddress.setDomain(mServiceContext.getString(R.string.default_domain));
+ }
LinphoneProxyConfig lpc = mLc.getDefaultProxyConfig();
if (mR.getBoolean(R.bool.forbid_self_call) && lpc!=null && lAddress.asStringUriOnly().equals(lpc.getIdentity())) {
@@ -540,7 +543,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
copyAssetsFromPackage();
//traces alway start with traces enable to not missed first initialization
- boolean isDebugLogEnabled = true;//!(mR.getBoolean(R.bool.disable_every_log)) && getPrefBoolean(R.string.pref_debug_key, mR.getBoolean(R.bool.pref_debug_default));
+ boolean isDebugLogEnabled = !(mR.getBoolean(R.bool.disable_every_log)) && getPrefBoolean(R.string.pref_debug_key, mR.getBoolean(R.bool.pref_debug_default));
LinphoneCoreFactory.instance().setDebugMode(isDebugLogEnabled, getString(R.string.app_name));
// Try to get remote provisioning
@@ -578,10 +581,6 @@ public final class LinphoneManager implements LinphoneCoreListener {
} catch (LinphoneException e) {
Log.w("no config ready yet");
}
- boolean routeToBT = mServiceContext.getResources().getBoolean(R.bool.route_audio_to_bluetooth_if_available);
- if (routeToBT) {
- startBluetooth();
- }
TimerTask lTask = new TimerTask() {
@Override
@@ -596,6 +595,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
lFilter.addAction(Intent.ACTION_SCREEN_OFF);
mServiceContext.registerReceiver(mKeepAliveReceiver, lFilter);
+ startBluetooth();
resetCameraFromPreferences();
}
catch (Exception e) {
@@ -987,6 +987,10 @@ public final class LinphoneManager implements LinphoneCoreListener {
chatStorage.close();
chatStorage = null;
}
+
+ try {
+ mServiceContext.unregisterReceiver(bluetoothReiceiver);
+ } catch (Exception e) {}
try {
if (Version.sdkAboveOrEqual(Version.API11_HONEYCOMB_30))
@@ -1134,11 +1138,11 @@ public final class LinphoneManager implements LinphoneCoreListener {
String notificationText = null;
int id = -1;
if (textMessage != null && textMessage.length() > 0) {
- id = chatStorage.saveMessage(from.asStringUriOnly(), "", textMessage, message.getTime());
+ id = chatStorage.saveTextMessage(from.asStringUriOnly(), "", textMessage, message.getTime());
notificationText = textMessage;
} else if (url != null && url.length() > 0) {
- Bitmap bm = ChatFragment.downloadImage(url);
- id = chatStorage.saveMessage(from.asStringUriOnly(), "", bm, message.getTime());
+ //Bitmap bm = ChatFragment.downloadImage(url);
+ id = chatStorage.saveImageMessage(from.asStringUriOnly(), "", null, message.getExternalBodyUrl(), message.getTime());
notificationText = url;
}
@@ -1225,6 +1229,12 @@ public final class LinphoneManager implements LinphoneCoreListener {
return;
}
}
+
+ if (state == LinphoneCall.State.Connected) {
+ if (mLc.getCallsNb() == 1) {
+ Log.d("Audio focus requested: " + (mAudioManager.requestAudioFocus(null, AudioManager.STREAM_VOICE_CALL, AudioManager.AUDIOFOCUS_GAIN) == AudioManager.AUDIOFOCUS_REQUEST_GRANTED ? "Granted" : "Denied"));
+ }
+ }
if (state == IncomingReceived || (state == State.CallIncomingEarlyMedia && mR.getBoolean(R.bool.allow_ringing_while_early_media))) {
// Brighten screen for at least 10 seconds
@@ -1239,11 +1249,15 @@ public final class LinphoneManager implements LinphoneCoreListener {
}
if (state == CallEnd || state == Error) {
+ if (mLc.getCallsNb() == 0) {
+ Log.d("Audio focus released: " + (mAudioManager.abandonAudioFocus(null) == AudioManager.AUDIOFOCUS_REQUEST_GRANTED ? "Granted" : "Denied"));
+ mAudioManager.setMode(AudioManager.MODE_NORMAL);
+ }
Context activity = getContext();
if (activity != null) {
TelephonyManager tm = (TelephonyManager) activity.getSystemService(Context.TELEPHONY_SERVICE);
if (tm.getCallState() == TelephonyManager.CALL_STATE_IDLE) {
- mAudioManager.setMode(MODE_NORMAL);
+ mAudioManager.setMode(AudioManager.MODE_NORMAL);
}
}
}
@@ -1273,6 +1287,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
} else {
Log.i("New call active while incall (CPU only) wake lock already active");
}
+ Compatibility.setAudioManagerInCallMode(mAudioManager);
}
mListenerDispatcher.onCallStateChanged(call, state, message);
}
@@ -1641,7 +1656,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
public void onRegistrationStateChanged(RegistrationState state,
String message) {
if (serviceListener != null) serviceListener.onRegistrationStateChanged(state, message);
- for (LinphoneOnRegistrationStateChangedListener listener : getSimpleListeners(LinphoneActivity.class)) {
+ for (LinphoneOnRegistrationStateChangedListener listener : getSimpleListeners(LinphoneOnRegistrationStateChangedListener.class)) {
listener.onRegistrationStateChanged(state);
}
}
diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java
index dac5682b5..cee623128 100644
--- a/src/org/linphone/LinphoneService.java
+++ b/src/org/linphone/LinphoneService.java
@@ -82,7 +82,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
* setLatestEventInfo and startActivity() which needs a context.
*/
- private Handler mHandler = new Handler();
+ public Handler mHandler = new Handler();
private static LinphoneService instance;
// private boolean mTestDelayElapsed; // add a timer for testing
diff --git a/src/org/linphone/LinphoneUtils.java b/src/org/linphone/LinphoneUtils.java
index 187aa4524..ad848b22e 100644
--- a/src/org/linphone/LinphoneUtils.java
+++ b/src/org/linphone/LinphoneUtils.java
@@ -21,8 +21,10 @@ package org.linphone;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
+import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
@@ -331,5 +333,42 @@ public final class LinphoneUtils {
return false;
}
}
+
+ public static void clearLogs() {
+ try {
+ Runtime.getRuntime().exec(new String[] { "logcat", "-c" });
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void collectLogs(String logTag, String email) {
+ BufferedReader br = null;
+ Process p = null;
+ StringBuilder sb = new StringBuilder();
+
+ try {
+ p = Runtime.getRuntime().exec(new String[] { "logcat", "-d", "|", "grep", "`adb shell ps | grep org.linphone | cut -c10-15`" });
+ br = new BufferedReader(new InputStreamReader(p.getInputStream()), 2048);
+
+ String line;
+ while ((line = br.readLine()) != null) {
+ sb.append(line);
+ sb.append("\r\n");
+ }
+
+ Intent i = new Intent(Intent.ACTION_SEND);
+ i.setType("message/rfc822");
+ i.putExtra(Intent.EXTRA_EMAIL, new String[]{email});
+ i.putExtra(Intent.EXTRA_SUBJECT, "Linphone Logs");
+ i.putExtra(Intent.EXTRA_TEXT, sb.toString());
+ try {
+ LinphoneActivity.instance().startActivity(Intent.createChooser(i, "Send mail..."));
+ } catch (android.content.ActivityNotFoundException ex) {
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
diff --git a/src/org/linphone/VideoCallFragment.java b/src/org/linphone/VideoCallFragment.java
index 5cb9f76ba..cb32628b5 100644
--- a/src/org/linphone/VideoCallFragment.java
+++ b/src/org/linphone/VideoCallFragment.java
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import org.linphone.compatibility.Compatibility;
import org.linphone.compatibility.CompatibilityScaleGestureDetector;
import org.linphone.compatibility.CompatibilityScaleGestureListener;
+import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCore;
import org.linphone.mediastream.Log;
import org.linphone.mediastream.video.AndroidVideoWindowImpl;
@@ -177,8 +178,12 @@ public class VideoCallFragment extends Fragment implements OnGestureListener, On
float landscapeZoomFactor = ((float) mVideoView.getWidth()) / (float) ((3 * mVideoView.getHeight()) / 4);
mZoomFactor = Math.max(0.1f, Math.min(mZoomFactor, Math.max(portraitZoomFactor, landscapeZoomFactor)));
- LinphoneManager.getLc().getCurrentCall().zoomVideo(mZoomFactor, mZoomCenterX, mZoomCenterY);
- return true;
+ LinphoneCall currentCall = LinphoneManager.getLc().getCurrentCall();
+ if (currentCall != null) {
+ currentCall.zoomVideo(mZoomFactor, mZoomCenterX, mZoomCenterY);
+ return true;
+ }
+ return false;
}
@Override
diff --git a/src/org/linphone/compatibility/ApiElevenPlus.java b/src/org/linphone/compatibility/ApiElevenPlus.java
index 23d7e8293..66e70f516 100644
--- a/src/org/linphone/compatibility/ApiElevenPlus.java
+++ b/src/org/linphone/compatibility/ApiElevenPlus.java
@@ -9,6 +9,7 @@ import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Bitmap;
+import android.media.AudioManager;
/*
ApiElevenPlus.java
@@ -88,4 +89,8 @@ public class ApiElevenPlus {
ClipData clip = android.content.ClipData.newPlainText("Message", msg);
clipboard.setPrimaryClip(clip);
}
+
+ public static void setAudioManagerInCallMode(AudioManager manager) {
+ manager.setMode(AudioManager.MODE_IN_COMMUNICATION);
+ }
}
diff --git a/src/org/linphone/compatibility/ApiFivePlus.java b/src/org/linphone/compatibility/ApiFivePlus.java
index 1a9e4f769..7809702ca 100644
--- a/src/org/linphone/compatibility/ApiFivePlus.java
+++ b/src/org/linphone/compatibility/ApiFivePlus.java
@@ -25,6 +25,7 @@ import android.database.Cursor;
import android.database.MatrixCursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
+import android.media.AudioManager;
import android.net.Uri;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
@@ -227,7 +228,7 @@ public class ApiFivePlus {
String[] projection = new String[] { Data.CONTACT_ID, Data.DISPLAY_NAME };
String query = Data.DISPLAY_NAME + " IS NOT NULL AND (" + select + ")";
- Cursor cursor = cr.query(Data.CONTENT_URI, projection, query, null, Data.DISPLAY_NAME + " ASC");
+ Cursor cursor = cr.query(Data.CONTENT_URI, projection, query, null, Data.DISPLAY_NAME + " COLLATE NOCASE ASC");
if (!shouldGroupBy || cursor == null) {
return cursor;
@@ -432,4 +433,8 @@ public class ApiFivePlus {
public static void removeGlobalLayoutListener(ViewTreeObserver viewTreeObserver, OnGlobalLayoutListener keyboardListener) {
viewTreeObserver.removeGlobalOnLayoutListener(keyboardListener);
}
+
+ public static void setAudioManagerInCallMode(AudioManager manager) {
+ manager.setMode(AudioManager.MODE_IN_CALL);
+ }
}
diff --git a/src/org/linphone/compatibility/Compatibility.java b/src/org/linphone/compatibility/Compatibility.java
index 35f015b76..45cf16173 100644
--- a/src/org/linphone/compatibility/Compatibility.java
+++ b/src/org/linphone/compatibility/Compatibility.java
@@ -34,6 +34,7 @@ import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
+import android.media.AudioManager;
import android.net.Uri;
import android.preference.Preference;
import android.view.Display;
@@ -268,4 +269,12 @@ public class Compatibility {
ApiFourteenPlus.showNavigationBar(activity);
}
}
+
+ public static void setAudioManagerInCallMode(AudioManager manager) {
+ if (Version.sdkAboveOrEqual(Version.API11_HONEYCOMB_30)) {
+ ApiElevenPlus.setAudioManagerInCallMode(manager);
+ } else {
+ ApiFivePlus.setAudioManagerInCallMode(manager);
+ }
+ }
}
diff --git a/src/org/linphone/setup/LinphoneLoginFragment.java b/src/org/linphone/setup/LinphoneLoginFragment.java
index 198da57cb..69180a2c1 100644
--- a/src/org/linphone/setup/LinphoneLoginFragment.java
+++ b/src/org/linphone/setup/LinphoneLoginFragment.java
@@ -45,20 +45,28 @@ public class LinphoneLoginFragment extends Fragment implements OnClickListener {
apply = (ImageView) view.findViewById(R.id.setup_apply);
apply.setOnClickListener(this);
+ if (getResources().getBoolean(R.bool.setup_use_linphone_as_first_fragment)) {
+ view.findViewById(R.id.setup_apply_button).setVisibility(View.GONE);
+ }
+
return view;
}
+
+ public void linphoneLogIn() {
+ if (login.getText() == null || login.length() == 0 || password.getText() == null || password.length() == 0) {
+ Toast.makeText(getActivity(), getString(R.string.first_launch_no_login_password), Toast.LENGTH_LONG).show();
+ return;
+ }
+
+ SetupActivity.instance().linphoneLogIn(login.getText().toString(), password.getText().toString(), getResources().getBoolean(R.bool.setup_account_validation_mandatory));
+ }
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.setup_apply) {
- if (login.getText() == null || login.length() == 0 || password.getText() == null || password.length() == 0) {
- Toast.makeText(getActivity(), getString(R.string.first_launch_no_login_password), Toast.LENGTH_LONG).show();
- return;
- }
-
- SetupActivity.instance().linphoneLogIn(login.getText().toString(), password.getText().toString());
+ linphoneLogIn();
}
}
}
diff --git a/src/org/linphone/setup/SetupActivity.java b/src/org/linphone/setup/SetupActivity.java
index 3c0e5bde8..cfb8644f9 100644
--- a/src/org/linphone/setup/SetupActivity.java
+++ b/src/org/linphone/setup/SetupActivity.java
@@ -18,7 +18,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import org.linphone.LinphoneManager;
+import org.linphone.LinphoneSimpleListener.LinphoneOnRegistrationStateChangedListener;
import org.linphone.R;
+import org.linphone.core.LinphoneCore.RegistrationState;
import org.linphone.mediastream.Log;
import android.app.Activity;
@@ -26,11 +28,12 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
+import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
-import android.view.KeyEvent;
+import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
@@ -42,8 +45,12 @@ import android.widget.Toast;
public class SetupActivity extends FragmentActivity implements OnClickListener {
private static SetupActivity instance;
private RelativeLayout back, next, cancel;
- private SetupFragments currentFragment;
+ private SetupFragmentsEnum currentFragment;
private SharedPreferences mPref;
+ private SetupFragmentsEnum firstFragment;
+ private Fragment fragment;
+ private boolean accountCreated = false;
+ private Handler mHandler = new Handler();
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -53,14 +60,13 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
}
setContentView(R.layout.setup);
-
+ firstFragment = getResources().getBoolean(R.bool.setup_use_linphone_as_first_fragment) ?
+ SetupFragmentsEnum.LINPHONE_LOGIN : SetupFragmentsEnum.WELCOME;
if (findViewById(R.id.fragmentContainer) != null) {
if (savedInstanceState == null) {
- WelcomeFragment welcomeFragment = new WelcomeFragment();
- getSupportFragmentManager().beginTransaction().add(R.id.fragmentContainer, welcomeFragment).commit();
- currentFragment = SetupFragments.WELCOME;
+ display(firstFragment);
} else {
- currentFragment = (SetupFragments) savedInstanceState.getSerializable("CurrentFragment");
+ currentFragment = (SetupFragmentsEnum) savedInstanceState.getSerializable("CurrentFragment");
}
}
@@ -103,36 +109,53 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
int id = v.getId();
if (id == R.id.setup_cancel) {
- finish();
- } else if (id == R.id.setup_next) {
- if (currentFragment == SetupFragments.WELCOME) {
- MenuFragment fragment = new MenuFragment();
- changeFragment(fragment);
- currentFragment = SetupFragments.MENU;
-
- next.setVisibility(View.GONE);
- back.setVisibility(View.VISIBLE);
- } else if (currentFragment == SetupFragments.WIZARD_CONFIRM) {
+ if (getResources().getBoolean(R.bool.setup_cancel_move_to_back)) {
+ moveTaskToBack(true);
+ } else {
finish();
}
+ } else if (id == R.id.setup_next) {
+ if (firstFragment == SetupFragmentsEnum.LINPHONE_LOGIN) {
+ LinphoneLoginFragment linphoneFragment = (LinphoneLoginFragment) fragment;
+ linphoneFragment.linphoneLogIn();
+ } else {
+ if (currentFragment == SetupFragmentsEnum.WELCOME) {
+ MenuFragment fragment = new MenuFragment();
+ changeFragment(fragment);
+ currentFragment = SetupFragmentsEnum.MENU;
+
+ next.setVisibility(View.GONE);
+ back.setVisibility(View.VISIBLE);
+ } else if (currentFragment == SetupFragmentsEnum.WIZARD_CONFIRM) {
+ finish();
+ }
+ }
} else if (id == R.id.setup_back) {
- handleBackEvent();
+ onBackPressed();
}
}
-
- private void handleBackEvent() {
- if (currentFragment == SetupFragments.MENU) {
+
+ @Override
+ public void onBackPressed() {
+ if (currentFragment == firstFragment) {
+ if (getResources().getBoolean(R.bool.setup_cancel_move_to_back)) {
+ moveTaskToBack(true);
+ } else {
+ finish();
+ }
+ }
+ if (currentFragment == SetupFragmentsEnum.MENU) {
WelcomeFragment fragment = new WelcomeFragment();
changeFragment(fragment);
- currentFragment = SetupFragments.WELCOME;
+ currentFragment = SetupFragmentsEnum.WELCOME;
next.setVisibility(View.VISIBLE);
back.setVisibility(View.GONE);
- } else if (currentFragment == SetupFragments.GENERIC_LOGIN || currentFragment == SetupFragments.LINPHONE_LOGIN || currentFragment == SetupFragments.WIZARD) {
+ } else if (currentFragment == SetupFragmentsEnum.GENERIC_LOGIN || currentFragment == SetupFragmentsEnum.LINPHONE_LOGIN || currentFragment == SetupFragmentsEnum.WIZARD) {
MenuFragment fragment = new MenuFragment();
changeFragment(fragment);
- currentFragment = SetupFragments.MENU;
- } else if (currentFragment == SetupFragments.WELCOME) {
+ currentFragment = SetupFragmentsEnum.MENU;
+ } else if (currentFragment == SetupFragmentsEnum.WELCOME) {
finish();
}
}
@@ -142,7 +165,7 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
EchoCancellerCalibrationFragment fragment = new EchoCancellerCalibrationFragment();
fragment.enableEcCalibrationResultSending(sendEcCalibrationResult);
changeFragment(fragment);
- currentFragment = SetupFragments.ECHO_CANCELLER_CALIBRATION;
+ currentFragment = SetupFragmentsEnum.ECHO_CANCELLER_CALIBRATION;
back.setVisibility(View.VISIBLE);
next.setVisibility(View.GONE);
next.setEnabled(false);
@@ -172,9 +195,55 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
launchEchoCancellerCalibration(sendEcCalibrationResult);
}
}
+
+
+ private LinphoneOnRegistrationStateChangedListener registrationListener = new LinphoneOnRegistrationStateChangedListener() {
+ public void onRegistrationStateChanged(RegistrationState state) {
+ if (state == RegistrationState.RegistrationOk) {
+ LinphoneManager.removeListener(registrationListener);
+
+ if (LinphoneManager.getLc().getDefaultProxyConfig() != null) {
+ mHandler .post(new Runnable () {
+ public void run() {
+ launchEchoCancellerCalibration(true);
+ }
+ });
+ }
+ } else if (state == RegistrationState.RegistrationFailed) {
+ LinphoneManager.removeListener(registrationListener);
+ deleteCreatedAccount();
+ mHandler.post(new Runnable () {
+ public void run() {
+ Toast.makeText(SetupActivity.this, getString(R.string.first_launch_bad_login_password), Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ }
+ };
+ public void checkAccount(String username, String password, String domain) {
+ LinphoneManager.removeListener(registrationListener);
+ LinphoneManager.addListener(registrationListener);
+
+ saveCreatedAccount(username, password, domain);
+ LinphoneManager.getInstance().initializePayloads();
- public void linphoneLogIn(String username, String password) {
- logIn(username, password, getString(R.string.default_domain), true);
+ try {
+ LinphoneManager.getInstance().initFromConf();
+ } catch (Throwable e) {
+ LinphoneManager.removeListener(registrationListener);
+ deleteCreatedAccount();
+
+ Log.e(e, "Error while initializing from config in first login activity");
+ Toast.makeText(this, getString(R.string.error), Toast.LENGTH_LONG).show();
+ }
+ }
+
+ public void linphoneLogIn(String username, String password, boolean validate) {
+ if (validate) {
+ checkAccount(username, password, getString(R.string.default_domain));
+ } else {
+ logIn(username, password, getString(R.string.default_domain), true);
+ }
}
public void genericLogIn(String username, String password, String domain) {
@@ -197,25 +266,55 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
mPref.edit().putBoolean(getString(key), value).commit();
}
- public void displayLoginGeneric() {
- GenericLoginFragment fragment = new GenericLoginFragment();
+ private void display(SetupFragmentsEnum fragment) {
+ switch (fragment) {
+ case WELCOME:
+ displayWelcome();
+ break;
+ case LINPHONE_LOGIN:
+ displayLoginLinphone();
+ break;
+ default:
+ throw new IllegalStateException("Can't handle " + fragment);
+ }
+ }
+
+ public void displayWelcome() {
+ fragment = new WelcomeFragment();
changeFragment(fragment);
- currentFragment = SetupFragments.GENERIC_LOGIN;
+ currentFragment = SetupFragmentsEnum.WELCOME;
+ }
+
+ public void displayLoginGeneric() {
+ fragment = new GenericLoginFragment();
+ changeFragment(fragment);
+ currentFragment = SetupFragmentsEnum.GENERIC_LOGIN;
}
public void displayLoginLinphone() {
- LinphoneLoginFragment fragment = new LinphoneLoginFragment();
+ fragment = new LinphoneLoginFragment();
changeFragment(fragment);
- currentFragment = SetupFragments.LINPHONE_LOGIN;
+ currentFragment = SetupFragmentsEnum.LINPHONE_LOGIN;
}
public void displayWizard() {
- WizardFragment fragment = new WizardFragment();
+ fragment = new WizardFragment();
changeFragment(fragment);
- currentFragment = SetupFragments.WIZARD;
+ currentFragment = SetupFragmentsEnum.WIZARD;
+ }
+
+ public void deleteCreatedAccount() {
+ if (!accountCreated)
+ return;
+
+ writePreference(R.string.pref_extra_accounts, 0);
+ accountCreated = false;
}
public void saveCreatedAccount(String username, String password, String domain) {
+ if (accountCreated)
+ return;
+
int newAccountId = mPref.getInt(getString(R.string.pref_extra_accounts), 0);
if (newAccountId == -1)
newAccountId = 0;
@@ -248,6 +347,12 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
writePreference(getString(R.string.pref_passwd_key) + newAccountId, password);
writePreference(getString(R.string.pref_domain_key) + newAccountId, domain);
}
+ String forcedProxy=getResources().getString(R.string.setup_forced_proxy);
+ if (!TextUtils.isEmpty(forcedProxy)) {
+ writePreference(R.string.pref_enable_outbound_proxy_key, true);
+ writePreference(R.string.pref_proxy_key, forcedProxy);
+ }
+ accountCreated = true;
}
public void displayWizardConfirm(String username) {
@@ -258,7 +363,7 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
fragment.setArguments(extras);
changeFragment(fragment);
- currentFragment = SetupFragments.WIZARD_CONFIRM;
+ currentFragment = SetupFragmentsEnum.WIZARD_CONFIRM;
next.setVisibility(View.VISIBLE);
next.setEnabled(false);
@@ -284,14 +389,6 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
success();
}
- public boolean onKeyDown(int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK) {
- handleBackEvent();
- return true;
- }
- return super.onKeyDown(keyCode, event);
- }
-
public void success() {
writePreference(R.string.first_launch_suceeded_once_key, true);
setResult(Activity.RESULT_OK);
diff --git a/src/org/linphone/setup/SetupFragments.java b/src/org/linphone/setup/SetupFragmentsEnum.java
similarity index 96%
rename from src/org/linphone/setup/SetupFragments.java
rename to src/org/linphone/setup/SetupFragmentsEnum.java
index afd878dc4..91b8c2feb 100644
--- a/src/org/linphone/setup/SetupFragments.java
+++ b/src/org/linphone/setup/SetupFragmentsEnum.java
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/**
* @author Sylvain Berfini
*/
-public enum SetupFragments {
+public enum SetupFragmentsEnum {
WELCOME,
MENU,
WIZARD,
diff --git a/src/org/linphone/ui/BubbleChat.java b/src/org/linphone/ui/BubbleChat.java
index e443cbcf8..7df7792f7 100644
--- a/src/org/linphone/ui/BubbleChat.java
+++ b/src/org/linphone/ui/BubbleChat.java
@@ -26,6 +26,7 @@ import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.core.LinphoneChatMessage;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Color;
@@ -37,6 +38,8 @@ import android.text.method.LinkMovementMethod;
import android.text.style.ImageSpan;
import android.view.LayoutInflater;
import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
@@ -46,6 +49,7 @@ import android.widget.TextView;
/**
* @author Sylvain Berfini
*/
+@SuppressLint("SimpleDateFormat")
public class BubbleChat {
private static final HashMap emoticons = new HashMap();
static {
@@ -81,6 +85,7 @@ public class BubbleChat {
private RelativeLayout view;
private ImageView statusView;
+ private Button download;
public BubbleChat(Context context, int id, String message, Bitmap image, String time, boolean isIncoming, LinphoneChatMessage.State status, int previousID) {
view = new RelativeLayout(context);
@@ -144,6 +149,11 @@ public class BubbleChat {
imageView.setVisibility(View.GONE);
}
+ download = (Button) layout.findViewById(R.id.download);
+ if (download != null && image == null && message == null) {
+ download.setVisibility(View.VISIBLE);
+ }
+
TextView timeView = (TextView) layout.findViewById(R.id.time);
timeView.setText(timestampToHumanDate(context, time));
@@ -261,4 +271,10 @@ public class BubbleChat {
return Html.fromHtml(text);
}
+
+ public void setDownloadImageButtonListener(OnClickListener onClickListener) {
+ if (download != null) {
+ download.setOnClickListener(onClickListener);
+ }
+ }
}
diff --git a/submodules/externals/build/libvpx/Android.mk b/submodules/externals/build/libvpx/Android.mk
index 54881e091..9d6c2a9ce 100755
--- a/submodules/externals/build/libvpx/Android.mk
+++ b/submodules/externals/build/libvpx/Android.mk
@@ -19,9 +19,6 @@ SCALE_SRCS += vpx_scale/generic/yv12config.c
SCALE_SRCS += vpx_scale/generic/yv12extend.c
SCALE_SRCS += vpx_scale/generic/gen_scalers.c
-#arm
-SCALE_SRCS += vpx_scale/arm/scalesystemdependent.c
-
#neon
SCALE_SRCS += vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon$(ASM).neon
SCALE_SRCS += vpx_scale/arm/neon/vp8_vpxyv12_copyframe_func_neon$(ASM).neon
@@ -32,11 +29,8 @@ SCALE_SRCS += vpx_scale/arm/neon/yv12extend_arm.c
### vp8cx_arm
#File list for arm
# encoder
-VP8_CX_SRCS = vp8/encoder/arm/arm_csystemdependent.c
-
VP8_CX_SRCS += vp8/encoder/arm/dct_arm.c
VP8_CX_SRCS += vp8/encoder/arm/quantize_arm.c
-VP8_CX_SRCS += vp8/encoder/arm/variance_arm.c
#File list for armv5te
# encoder
@@ -51,28 +45,16 @@ VP8_CX_SRCS += vp8/encoder/arm/armv5te/vp8_packtokens_partitions_armv5$(ASM)
VP8_CX_SRCS += vp8/encoder/arm/armv6/vp8_subtract_armv6$(ASM)
VP8_CX_SRCS += vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6$(ASM)
VP8_CX_SRCS += vp8/encoder/arm/armv6/vp8_fast_quantize_b_armv6$(ASM)
-VP8_CX_SRCS += vp8/encoder/arm/armv6/vp8_sad16x16_armv6$(ASM)
-VP8_CX_SRCS += vp8/encoder/arm/armv6/vp8_variance16x16_armv6$(ASM)
-VP8_CX_SRCS += vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6$(ASM)
-VP8_CX_SRCS += vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6$(ASM)
-VP8_CX_SRCS += vp8/encoder/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6$(ASM)
VP8_CX_SRCS += vp8/encoder/arm/armv6/vp8_mse16x16_armv6$(ASM)
-VP8_CX_SRCS += vp8/encoder/arm/armv6/vp8_variance8x8_armv6$(ASM)
VP8_CX_SRCS += vp8/encoder/arm/armv6/walsh_v6$(ASM)
#File list for neon
# encoder
VP8_CX_SRCS += vp8/encoder/arm/neon/fastquantizeb_neon$(ASM).neon
VP8_CX_SRCS += vp8/encoder/arm/neon/picklpf_arm.c.neon
-VP8_CX_SRCS += vp8/encoder/arm/neon/sad8_neon$(ASM).neon
-VP8_CX_SRCS += vp8/encoder/arm/neon/sad16_neon$(ASM).neon
VP8_CX_SRCS += vp8/encoder/arm/neon/shortfdct_neon$(ASM).neon
VP8_CX_SRCS += vp8/encoder/arm/neon/subtract_neon$(ASM).neon
-VP8_CX_SRCS += vp8/encoder/arm/neon/variance_neon$(ASM).neon
VP8_CX_SRCS += vp8/encoder/arm/neon/vp8_mse16x16_neon$(ASM).neon
-VP8_CX_SRCS += vp8/encoder/arm/neon/vp8_subpixelvariance8x8_neon$(ASM).neon
-VP8_CX_SRCS += vp8/encoder/arm/neon/vp8_subpixelvariance16x16_neon$(ASM).neon
-VP8_CX_SRCS += vp8/encoder/arm/neon/vp8_subpixelvariance16x16s_neon$(ASM).neon
VP8_CX_SRCS += vp8/encoder/arm/neon/vp8_memcpy_neon$(ASM).neon
VP8_CX_SRCS += vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon$(ASM).neon
@@ -87,7 +69,7 @@ VP8_CX_SRCS += vp8/encoder/encodeintra.c
VP8_CX_SRCS += vp8/encoder/encodemb.c
VP8_CX_SRCS += vp8/encoder/encodemv.c
VP8_CX_SRCS += vp8/encoder/ethreading.c
-VP8_CX_SRCS += vp8/encoder/generic/csystemdependent.c
+VP8_CX_SRCS += vp8/encoder/denoising.c
VP8_CX_SRCS += vp8/encoder/lookahead.c
VP8_CX_SRCS += vp8/encoder/mcomp.c
VP8_CX_SRCS += vp8/encoder/modecosts.c
@@ -98,17 +80,16 @@ VP8_CX_SRCS += vp8/encoder/psnr.c
VP8_CX_SRCS += vp8/encoder/quantize.c
VP8_CX_SRCS += vp8/encoder/ratectrl.c
VP8_CX_SRCS += vp8/encoder/rdopt.c
-VP8_CX_SRCS += vp8/encoder/sad_c.c
VP8_CX_SRCS += vp8/encoder/segmentation.c
VP8_CX_SRCS += vp8/encoder/tokenize.c
VP8_CX_SRCS += vp8/encoder/treewriter.c
-VP8_CX_SRCS += vp8/encoder/variance_c.c
### vp8_common
VP8_COMMON_SRCS = vp8/common/alloccommon.c
VP8_COMMON_SRCS += vp8/common/asm_com_offsets.c
VP8_COMMON_SRCS += vp8/common/blockd.c
VP8_COMMON_SRCS += vp8/common/debugmodes.c
+VP8_COMMON_SRCS += vp8/common/dequantize.c
VP8_COMMON_SRCS += vp8/common/entropy.c
VP8_COMMON_SRCS += vp8/common/entropymode.c
VP8_COMMON_SRCS += vp8/common/entropymv.c
@@ -116,34 +97,32 @@ VP8_COMMON_SRCS += vp8/common/extend.c
VP8_COMMON_SRCS += vp8/common/filter.c
VP8_COMMON_SRCS += vp8/common/findnearmv.c
VP8_COMMON_SRCS += vp8/common/generic/systemdependent.c
+VP8_COMMON_SRCS += vp8/common/idct_blk.c
VP8_COMMON_SRCS += vp8/common/idctllm.c
-#VP8_COMMON_SRCS += vp8/common/invtrans.c
+VP8_COMMON_SRCS += vp8/common/rtcd.c
VP8_COMMON_SRCS += vp8/common/loopfilter.c
VP8_COMMON_SRCS += vp8/common/loopfilter_filters.c
VP8_COMMON_SRCS += vp8/common/mbpitch.c
VP8_COMMON_SRCS += vp8/common/modecont.c
-VP8_COMMON_SRCS += vp8/common/modecontext.c
VP8_COMMON_SRCS += vp8/common/quant_common.c
-#VP8_COMMON_SRCS += vp8/common/recon.c
VP8_COMMON_SRCS += vp8/common/reconinter.c
VP8_COMMON_SRCS += vp8/common/reconintra.c
VP8_COMMON_SRCS += vp8/common/reconintra4x4.c
+VP8_COMMON_SRCS += vp8/common/sad_c.c
VP8_COMMON_SRCS += vp8/common/setupintrarecon.c
VP8_COMMON_SRCS += vp8/common/swapyv12buffer.c
+VP8_COMMON_SRCS += vp8/common/variance_c.c
VP8_COMMON_SRCS += vp8/common/treecoder.c
-VP8_COMMON_SRCS += vp8/common/dequantize.c
-VP8_COMMON_SRCS += vp8/common/idct_blk.c
# common (c)
-VP8_COMMON_SRCS += vp8/common/arm/dequantize_arm.c
-VP8_COMMON_SRCS += vp8/common/arm/arm_systemdependent.c
-VP8_COMMON_SRCS += vp8/common/arm/bilinearfilter_arm.c
VP8_COMMON_SRCS += vp8/common/arm/filter_arm.c
VP8_COMMON_SRCS += vp8/common/arm/loopfilter_arm.c
VP8_COMMON_SRCS += vp8/common/arm/reconintra_arm.c
+VP8_COMMON_SRCS += vp8/common/arm/dequantize_arm.c
+VP8_COMMON_SRCS += vp8/common/arm/variance_arm.c
+VP8_COMMON_SRCS += vp8/common/arm/bilinearfilter_arm.c
# common (armv6)
-VP8_COMMON_SRCS += vp8/common/arm/armv6/intra4x4_predict_v6$(ASM)
VP8_COMMON_SRCS += vp8/common/arm/armv6/bilinearfilter_v6$(ASM)
VP8_COMMON_SRCS += vp8/common/arm/armv6/copymem8x4_v6$(ASM)
VP8_COMMON_SRCS += vp8/common/arm/armv6/copymem8x8_v6$(ASM)
@@ -153,12 +132,18 @@ VP8_COMMON_SRCS += vp8/common/arm/armv6/iwalsh_v6$(ASM)
VP8_COMMON_SRCS += vp8/common/arm/armv6/filter_v6$(ASM)
VP8_COMMON_SRCS += vp8/common/arm/armv6/idct_v6$(ASM)
VP8_COMMON_SRCS += vp8/common/arm/armv6/loopfilter_v6$(ASM)
-#VP8_COMMON_SRCS += vp8/common/arm/armv6/recon_v6$(ASM)
VP8_COMMON_SRCS += vp8/common/arm/armv6/simpleloopfilter_v6$(ASM)
VP8_COMMON_SRCS += vp8/common/arm/armv6/sixtappredict8x4_v6$(ASM)
-VP8_COMMON_SRCS += vp8/common/arm/armv6/idct_blk_v6.c
+VP8_COMMON_SRCS += vp8/common/arm/armv6/intra4x4_predict_v6$(ASM)
VP8_COMMON_SRCS += vp8/common/arm/armv6/dequant_idct_v6$(ASM)
VP8_COMMON_SRCS += vp8/common/arm/armv6/dequantize_v6$(ASM)
+VP8_COMMON_SRCS += vp8/common/arm/armv6/idct_blk_v6.c
+VP8_COMMON_SRCS += vp8/common/arm/armv6/vp8_sad16x16_armv6$(ASM)
+VP8_COMMON_SRCS += vp8/common/arm/armv6/vp8_variance8x8_armv6$(ASM)
+VP8_COMMON_SRCS += vp8/common/arm/armv6/vp8_variance16x16_armv6$(ASM)
+VP8_COMMON_SRCS += vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6$(ASM)
+VP8_COMMON_SRCS += vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6$(ASM)
+VP8_COMMON_SRCS += vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6$(ASM)
# common (neon)
VP8_COMMON_SRCS += vp8/common/arm/neon/bilinearpredict4x4_neon$(ASM).neon
@@ -174,50 +159,45 @@ VP8_COMMON_SRCS += vp8/common/arm/neon/loopfilter_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/loopfiltersimpleverticaledge_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/mbloopfilter_neon$(ASM).neon
-#VP8_COMMON_SRCS += vp8/common/arm/neon/recon2b_neon$(ASM).neon
-#VP8_COMMON_SRCS += vp8/common/arm/neon/recon4b_neon$(ASM).neon
-#VP8_COMMON_SRCS += vp8/common/arm/neon/reconb_neon$(ASM).neon
-#VP8_COMMON_SRCS += vp8/common/arm/neon/shortidct4x4llm_1_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/shortidct4x4llm_neon$(ASM).neon
+VP8_COMMON_SRCS += vp8/common/arm/neon/sad8_neon$(ASM).neon
+VP8_COMMON_SRCS += vp8/common/arm/neon/sad16_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/sixtappredict4x4_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/sixtappredict8x4_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/sixtappredict8x8_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/sixtappredict16x16_neon$(ASM).neon
-#VP8_COMMON_SRCS += vp8/common/arm/neon/recon16x16mb_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/buildintrapredictorsmby_neon$(ASM).neon
-VP8_COMMON_SRCS += vp8/common/arm/neon/save_neon_reg$(ASM).neon
+VP8_COMMON_SRCS += vp8/common/arm/neon/save_reg_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/dequant_idct_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/idct_dequant_full_2x_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/idct_dequant_0_2x_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/dequantizeb_neon$(ASM).neon
VP8_COMMON_SRCS += vp8/common/arm/neon/idct_blk_neon.c.neon
+VP8_COMMON_SRCS += vp8/common/arm/neon/variance_neon$(ASM).neon
+VP8_COMMON_SRCS += vp8/common/arm/neon/vp8_subpixelvariance8x8_neon$(ASM).neon
+VP8_COMMON_SRCS += vp8/common/arm/neon/vp8_subpixelvariance16x16_neon$(ASM).neon
+VP8_COMMON_SRCS += vp8/common/arm/neon/vp8_subpixelvariance16x16s_neon$(ASM).neon
-### vp8dx_arm
-VP8_DX_SRCS = vp8/decoder/arm/arm_dsystemdependent.c
#File list for armv6
### vp8dx
-VP8_DX_SRCS += vp8/vp8_dx_iface.c
+VP8_DX_SRCS = vp8/vp8_dx_iface.c
VP8_DX_SRCS += vp8/decoder/asm_dec_offsets.c
VP8_DX_SRCS += vp8/decoder/dboolhuff.c
VP8_DX_SRCS += vp8/decoder/decodemv.c
VP8_DX_SRCS += vp8/decoder/decodframe.c
VP8_DX_SRCS += vp8/decoder/detokenize.c
VP8_DX_SRCS += vp8/decoder/error_concealment.c
-VP8_DX_SRCS += vp8/decoder/generic/dsystemdependent.c
-VP8_DX_SRCS += vp8/decoder/reconintra_mt.c
-VP8_DX_SRCS += vp8/decoder/threading.c
VP8_DX_SRCS += vp8/decoder/onyxd_if.c
+VP8_DX_SRCS += vp8/decoder/threading.c
### vpx_codec
API_SRCS = vpx/src/vpx_decoder.c
-API_SRCS += vpx/src/vpx_decoder_compat.c
API_SRCS += vpx/src/vpx_encoder.c
API_SRCS += vpx/src/vpx_codec.c
API_SRCS += vpx/src/vpx_image.c
-API_SRCS += vpx_scale/generic/scalesystemdependent.c
LOCAL_SRC_FILES = $(MEM_SRCS)
LOCAL_SRC_FILES += $(SCALE_SRCS)
diff --git a/submodules/externals/libvpx b/submodules/externals/libvpx
index 2b0aee4b5..b9ce43029 160000
--- a/submodules/externals/libvpx
+++ b/submodules/externals/libvpx
@@ -1 +1 @@
-Subproject commit 2b0aee4b5def280d4e27c11d1b95ecd8545eed34
+Subproject commit b9ce43029298182668d4dcb0e0814189e4a63c2a