diff --git a/Makefile b/Makefile index 5751ad57e..97732eac6 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,8 @@ ifneq ($(CHECK_MSG),) endif include check_tools.mk +NDK_BUILD_OPTIONS=NDK_DEBUG=$(NDK_DEBUG) LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_UPNP=$(BUILD_UPNP) BUILD_REMOTE_PROVISIONING=$(BUILD_REMOTE_PROVISIONING) BUILD_X264=$(BUILD_X264) BUILD_AMRNB=$(BUILD_AMRNB) BUILD_AMRWB=$(BUILD_AMRWB) BUILD_GPLV3_ZRTP=$(BUILD_GPLV3_ZRTP) BUILD_SILK=$(BUILD_SILK) BUILD_G729=$(BUILD_G729) BUILD_TUNNEL=$(BUILD_TUNNEL) BUILD_WEBRTC_AECM=$(BUILD_WEBRTC_AECM) BUILD_FOR_X86=$(BUILD_FOR_X86) USE_JAVAH=$(USE_JAVAH) -j$(NUMCPUS) + all: update-project prepare-sources generate-apk install: install-apk run-linphone diff --git a/README b/README index ac015f199..a655c6113 100644 --- a/README +++ b/README @@ -34,3 +34,5 @@ BUILD_TUNNEL 0 (don't build tunnel), 1 (build tunnel) [requires a tunne BUILD_WEBRTC_AECM 0 (don't build echo canceler), 1 (build echo canceler) | 1 USE_JAVAH 0 (don't generate header), 1 (generate header for linphone_core_jni) [used to check errors at liblinphone compilation] | 1 BUILD_FOR_X86 0 (don't generate liblinphone libraries for x86 architecture), 1 (build liblinphone libraries for x86 architecture) | 1 + +If you encounter troubles with the make clean target and you are using the 8e android ndk, the solution can be found here: https://groups.google.com/forum/?fromgroups=#!topic/android-ndk/3wIbb-h3nDU diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index c1625c4da..0f0f23927 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -106,7 +106,6 @@ public class LinphoneActivity extends FragmentActivity implements private FragmentsAvailable currentFragment, nextFragment; private Fragment dialerFragment, messageListenerFragment, messageListFragment, friendStatusListenerFragment; private SavedState dialerSavedState; - private ChatStorage chatStorage; private boolean preferLinphoneContacts = false, isAnimationDisabled = false, isContactPresenceDisabled = true; private Handler mHandler = new Handler(); private List contactList, sipContactList; @@ -1170,10 +1169,10 @@ public class LinphoneActivity extends FragmentActivity implements } public ChatStorage getChatStorage() { - if (chatStorage == null) { - chatStorage = new ChatStorage(this); + if (LinphoneManager.getInstance().chatStorage == null) { + return new ChatStorage(this); } - return chatStorage; + return LinphoneManager.getInstance().chatStorage; } public void addContact(String displayName, String sipUri) @@ -1255,11 +1254,6 @@ public class LinphoneActivity extends FragmentActivity implements prepareContactsInBackground(); - if (chatStorage != null) { - chatStorage.close(); - } - chatStorage = new ChatStorage(this); - updateMissedChatCount(); displayMissedCalls(LinphoneManager.getLc().getMissedCallsCount()); @@ -1284,11 +1278,6 @@ public class LinphoneActivity extends FragmentActivity implements @Override protected void onDestroy() { LinphoneManager.removeListener(this); - - if (chatStorage != null) { - chatStorage.close(); - chatStorage = null; - } if (mOrientationHelper != null) { mOrientationHelper.disable(); diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index fdec64407..e7eba0bb6 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -49,6 +49,7 @@ import org.linphone.LinphoneSimpleListener.LinphoneOnAudioChangedListener.AudioS import org.linphone.LinphoneSimpleListener.LinphoneOnDTMFReceivedListener; import org.linphone.LinphoneSimpleListener.LinphoneOnMessageReceivedListener; import org.linphone.LinphoneSimpleListener.LinphoneServiceListener; +import org.linphone.compatibility.Compatibility; import org.linphone.core.CallDirection; import org.linphone.core.LinphoneAddress; import org.linphone.core.LinphoneAuthInfo; @@ -157,6 +158,8 @@ public final class LinphoneManager implements LinphoneCoreListener { private BroadcastReceiver bluetoothReiceiver = new BluetoothManager(); public boolean isBluetoothScoConnected; public boolean isUsingBluetoothAudioRoute; + + public ChatStorage chatStorage; private static List simpleListeners = new ArrayList(); public static void addListener(LinphoneSimpleListener listener) { @@ -188,6 +191,8 @@ public final class LinphoneManager implements LinphoneCoreListener { mPowerManager = (PowerManager) c.getSystemService(Context.POWER_SERVICE); mConnectivityManager = (ConnectivityManager) c.getSystemService(Context.CONNECTIVITY_SERVICE); mR = c.getResources(); + + chatStorage = new ChatStorage(mServiceContext); } private static final int LINPHONE_VOLUME_STREAM = STREAM_VOICE_CALL; @@ -907,7 +912,7 @@ public final class LinphoneManager implements LinphoneCoreListener { boolean useRandomPort = getPrefBoolean(R.string.pref_transport_use_random_ports_key, mR.getBoolean(R.bool.pref_transport_use_random_ports_default)); int lPreviousPort = tryToParseIntValue(getPrefString(R.string.pref_sip_port_key, getString(R.string.pref_sip_port_default)), 5060); if (lPreviousPort>0xFFFF || useRandomPort) { - lPreviousPort=(0xDFFF & (int)Math.random())+1024; + lPreviousPort=(int)(Math.random() * (0xFFFF - 1024)) + 1024; Log.w("Using random port " + lPreviousPort); } @@ -975,6 +980,11 @@ public final class LinphoneManager implements LinphoneCoreListener { @TargetApi(Build.VERSION_CODES.HONEYCOMB) private void doDestroy() { + if (chatStorage != null) { + chatStorage.close(); + chatStorage = null; + } + try { if (Version.sdkAboveOrEqual(Version.API11_HONEYCOMB_30)) mBluetoothAdapter.closeProfileProxy(BluetoothProfile.HEADSET, mBluetoothHeadset); @@ -1115,7 +1125,6 @@ public final class LinphoneManager implements LinphoneCoreListener { } LinphoneAddress from = message.getFrom(); - ChatStorage chatStorage = new ChatStorage(mServiceContext); String textMessage = message.getText(); String url = message.getExternalBodyUrl(); @@ -1515,9 +1524,11 @@ public final class LinphoneManager implements LinphoneCoreListener { if (nearby) { params.screenBrightness = 0.1f; view.setVisibility(View.INVISIBLE); + Compatibility.hideNavigationBar(activity); } else { params.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE; view.setVisibility(View.VISIBLE); + Compatibility.showNavigationBar(activity); } window.setAttributes(params); } diff --git a/src/org/linphone/RemoteProvisioning.java b/src/org/linphone/RemoteProvisioning.java index c44af7ad2..e654e391c 100644 --- a/src/org/linphone/RemoteProvisioning.java +++ b/src/org/linphone/RemoteProvisioning.java @@ -1,6 +1,7 @@ package org.linphone; import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; @@ -38,11 +39,14 @@ public class RemoteProvisioning { byte[] contents = new byte[1024]; int bytesRead = 0; - String strFileContents = ""; - while( (bytesRead = bis.read(contents)) != -1){ - strFileContents = new String(contents, 0, bytesRead); + ByteArrayOutputStream fileContents = new ByteArrayOutputStream(); + while( (bytesRead = bis.read(contents)) != -1) { + fileContents.write(contents, 0, bytesRead); } + + String strFileContents = fileContents.toString(); Log.i("Download Success"); + Log.i(strFileContents); // Initialize converter LpConfig lp = LinphoneCoreFactory.instance().createLpConfig(mLocalLP); diff --git a/src/org/linphone/compatibility/ApiFourteenPlus.java b/src/org/linphone/compatibility/ApiFourteenPlus.java index 04cd075d2..1c65fc8f2 100644 --- a/src/org/linphone/compatibility/ApiFourteenPlus.java +++ b/src/org/linphone/compatibility/ApiFourteenPlus.java @@ -1,8 +1,10 @@ package org.linphone.compatibility; import android.annotation.TargetApi; +import android.app.Activity; import android.preference.Preference; import android.preference.TwoStatePreference; +import android.view.View; /* ApiFourteenPlus.java @@ -35,4 +37,12 @@ public class ApiFourteenPlus { public static boolean isPreferenceChecked(Preference preference) { return ((TwoStatePreference) preference).isChecked(); } + + public static void hideNavigationBar(Activity activity) { + activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + } + + public static void showNavigationBar(Activity activity) { + activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); + } } diff --git a/src/org/linphone/compatibility/Compatibility.java b/src/org/linphone/compatibility/Compatibility.java index 9d5f4f416..35f015b76 100644 --- a/src/org/linphone/compatibility/Compatibility.java +++ b/src/org/linphone/compatibility/Compatibility.java @@ -248,10 +248,24 @@ public class Compatibility { public static void removeGlobalLayoutListener(ViewTreeObserver viewTreeObserver, OnGlobalLayoutListener keyboardListener) { - if (Version.sdkAboveOrEqual(16)) { + if (Version.sdkAboveOrEqual(Version.API16_JELLY_BEAN_41)) { ApiSixteenPlus.removeGlobalLayoutListener(viewTreeObserver, keyboardListener); } else { ApiFivePlus.removeGlobalLayoutListener(viewTreeObserver, keyboardListener); } } + + public static void hideNavigationBar(Activity activity) + { + if (Version.sdkAboveOrEqual(Version.API14_ICE_CREAM_SANDWICH_40)) { + ApiFourteenPlus.hideNavigationBar(activity); + } + } + + public static void showNavigationBar(Activity activity) + { + if (Version.sdkAboveOrEqual(Version.API14_ICE_CREAM_SANDWICH_40)) { + ApiFourteenPlus.showNavigationBar(activity); + } + } } diff --git a/submodules/belle-sip b/submodules/belle-sip index 4aa1a8114..db7440f29 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit 4aa1a81145039018194efe70d0718cf928406ff7 +Subproject commit db7440f29b1f632df236170f9b796f903df12e3b diff --git a/submodules/linphone b/submodules/linphone index 8e124bc7f..25f44cc7c 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 8e124bc7f8dce5555d74c66bc60424678faa0b13 +Subproject commit 25f44cc7c90bcde78f97d51f489e91f5094827f1 diff --git a/tests/libs/robotium-solo-3.6-javadoc.jar b/tests/libs/robotium-solo-3.6-javadoc.jar deleted file mode 100644 index db4e75b2c..000000000 Binary files a/tests/libs/robotium-solo-3.6-javadoc.jar and /dev/null differ diff --git a/tests/libs/robotium-solo-3.6.jar b/tests/libs/robotium-solo-3.6.jar deleted file mode 100644 index 4280906d1..000000000 Binary files a/tests/libs/robotium-solo-3.6.jar and /dev/null differ diff --git a/tests/libs/robotium-solo-4.1-javadoc.jar b/tests/libs/robotium-solo-4.1-javadoc.jar new file mode 100644 index 000000000..24b84e6f9 Binary files /dev/null and b/tests/libs/robotium-solo-4.1-javadoc.jar differ diff --git a/tests/libs/robotium-solo-4.1.jar b/tests/libs/robotium-solo-4.1.jar new file mode 100644 index 000000000..bc6270ea8 Binary files /dev/null and b/tests/libs/robotium-solo-4.1.jar differ