diff --git a/.gitignore b/.gitignore index 83bec1ac8..3a33fd217 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ obj gen bin doc +ant.properties +local.properties +project.properties diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 2812e1ef4..3271c482f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,9 +1,27 @@ + android:versionCode="1320" android:versionName="1.3.2" android:installLocation="auto"> - + + + + + + + + + + + + + + + + + + + @@ -197,23 +215,4 @@ - - - - - - - - - - - - - - - - - - - diff --git a/Makefile b/Makefile index 256f3606c..78a934236 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,6 @@ prepare-sources: prepare-ffmpeg prepare-ilbc prepare-vpx prepare-silk prepare-sr generate-libs: $(NDK_PATH)/ndk-build BUILD_SILK=1 -j$(NUMCPUS) - rm $(TOPDIR)/libs/armeabi/liblinphone.so update-project: $(SDK_PATH)/android update project --path . diff --git a/build.xml b/build.xml index 5d36bb5e7..7a9ce0db0 100644 --- a/build.xml +++ b/build.xml @@ -1,92 +1,13 @@ - - - - - - - - - - - - - - - - - - - + + + - - - + + + + + + + + + + + + + + + + + + + - + - + + + @@ -141,41 +94,7 @@ - - - - - - - - - - - - - - - - - + @@ -187,7 +106,9 @@ - + + + @@ -196,16 +117,22 @@ - + + + + + + + @@ -217,8 +144,13 @@ - + + + + + + + @@ -255,7 +187,20 @@ - + + + + + + + + + + + + + @@ -268,7 +213,7 @@ - @{elseText} + @{elseText} @@ -290,7 +235,7 @@ - @{elseText} + @{elseText} @@ -317,7 +262,7 @@ - + @@ -325,9 +270,7 @@ + verbose="${verbose}"> @@ -359,9 +302,9 @@ buildType="${build.is.packaging.debug}/${build.is.signing.debug}"> - + - + @@ -385,7 +328,7 @@ - Running tests ... + Running tests ... @@ -396,7 +339,7 @@ - + @@ -423,7 +366,7 @@ - Uninstalling @{app.package} from the default emulator or device... + Uninstalling @{app.package} from the default emulator or device... @@ -432,88 +375,126 @@ - + + + - - + + + + + + + + + + + + + Project Name: ${ant.project.name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Switching between debug and non debug build: Deleting previous compilation output... + + + + + + + + + + + + + Switching from instrumented to non-instrumented build: Deleting previous compilation output... + + + + + + + + + + + + + + - + - + - + - - - + - - - - - - - - - - - - - - - - - Gathering info for ${ant.project.name}... - - - - - - - - - - - - - + + + + + - + + + + + @@ -525,30 +506,79 @@ - - - - - - + + + + + + + Resolving Build Target for ${ant.project.name}... + + + + + + + ---------- + Creating output directories if needed... + + + + + + + + + + ---------- + Resolving Dependencies for ${ant.project.name}... + - + + + + - Building Libraries - - - ############################################ - **** Back to project ${ant.project.name} **** - ############################################ + + + + + + ---------- + Building Libraries with '${project.libraries.target}'... + + + + + + + @@ -561,53 +591,24 @@ - Building tested project at ${tested.project.absolute.dir} + ---------- + Building tested project at ${tested.project.absolute.dir} with '${tested.project.target}'... - - ############################################ - **** Back to project ${ant.project.name} **** - ############################################ + + + + + + + - - - - - - - - - - - - - - - - - - - - Switching from instrumented to non-instrumented build. - Deleting previous compilation output: - - - - - Creating output directories if needed... - - - - - - - - + + + + + - ---------- - Handling aidl files... - + Handling aidl files... + - ---------- - Handling RenderScript files... + ---------- + Handling RenderScript files... + resFolder="${out.res.absolute.dir}/raw" + targetApi="${project.minSdkVersion}" + optLevel="${renderscript.opt.level}" + buildType="${build.is.packaging.debug}" + previousBuildType="${build.last.is.packaging.debug}"> - ---------- - Handling Resources... + ---------- + Handling Resources... + libraryResFolderPathRefid="project.library.res.folder.path" + libraryPackagesRefid="project.library.packages" + ignoreAssets="${aapt.ignore.assets}" + proguardFile="${out.absolute.dir}/proguard.txt"> + + ---------- + Handling BuildConfig class... + + @@ -660,68 +685,78 @@ - - - - - - - + + + + + + classpathref="project.javac.classpath" + fork="${need.javac.fork}"> - - - + + + + + + Instrumenting classes from ${out.absolute.dir}/classes... + + + + + + + + + + + + + + + + + - Creating library output jar file... + Creating library output jar file... - Custom jar packaging exclusion: ${android.package.excludes} + Custom jar packaging exclusion: ${android.package.excludes} + + + - + - - - - Instrumenting classes from ${out.absolute.dir}/classes... - - - - - - - - @@ -762,7 +797,7 @@ all the jar files separated by a platform path-separator. Each path must be quoted if it contains spaces. --> - + @@ -772,31 +807,43 @@ - + - + - + + + + + + + - @${proguard.config} - -injars ${project.jars} + -include "${proguard.configcmd}" + -include "${out.absolute.dir}/proguard.txt" + -injars ${project.all.classes.value} -outjars "${obfuscated.jar.file}" - -libraryjars ${android.libraryjars} + -libraryjars ${project.target.classpath.value} -dump "${obfuscate.absolute.dir}/dump.txt" -printseeds "${obfuscate.absolute.dir}/seeds.txt" -printusage "${obfuscate.absolute.dir}/usage.txt" @@ -846,33 +893,55 @@ Some custom apk with specific configuration have been declared in default.properties. --> - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -896,25 +965,44 @@ + + + - - + + + + - + - + + + + + + + + + + + + + + @@ -922,6 +1010,9 @@ + + + @@ -930,14 +1021,15 @@ - + - Debug Package: ${out.final.file} + Debug Package: ${out.final.file} + @@ -964,16 +1056,27 @@ - + - - - + + + + + + + + + + + - + + + @@ -993,15 +1096,16 @@ - No key.store and key.alias properties found in build.properties. - Please sign ${out.packaged.file} manually - and run zipalign from the Android SDK tools. + No key.store and key.alias properties found in build.properties. + Please sign ${out.packaged.file} manually + and run zipalign from the Android SDK tools. + proguard.config is ${proguard.config} @@ -1010,6 +1114,7 @@ + Proguard.config is enabled @@ -1020,6 +1125,7 @@ + @@ -1028,12 +1134,15 @@ - + + + ************************************************* @@ -1049,54 +1158,44 @@ - - - - - - - - - - - - - - - + - Signing final apk... - Signing final apk... + + keypass="${key.alias.password}"/> - - Release Package: ${out.final.file} + + Release Package: ${out.final.file} - + + + + + + + @@ -1117,13 +1217,15 @@ - Instrumented Package: ${out.final.file} + Instrumented Package: ${out.final.file} - + + + @@ -1131,43 +1233,67 @@ - - + - + + + + - + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + value="/data/data/${tested.project.app.package}/coverage.ec" /> @@ -1179,30 +1305,37 @@ - Downloading coverage file into project directory... + Downloading coverage file into project directory... - + - Extracting coverage report... + Extracting coverage report... + + + + + + + + + - + - - - - + + - + - Cleaning up temporary files... - - - Saving the report file in ${basedir}/coverage/coverage.html + Cleaning up temporary files... + + + Saving the report file in ${out.absolute.dir}/coverage.html @@ -1211,7 +1344,9 @@ - + + + - + - Installing ${out.final.file} onto default emulator or device... + Installing ${out.final.file} onto default emulator or device... + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -1273,45 +1432,50 @@ description="Installs (only) the release package." /> - - - - - - + - + - Could not find application package in manifest. Cannot run 'adb uninstall'. + - + + + + + + + + + + + expression="/manifest/@package" output="tested.project.app.package" /> - + - + - Could not find tested application package in manifest. Cannot run 'adb uninstall'. + @@ -1320,6 +1484,10 @@ + + + + @@ -1330,13 +1498,19 @@ (tested projects and libraries)at the same time using: 'ant all clean' debug: Builds the application and signs it with a debug key. + The 'nodeps' target can be used to only build the + current project and ignore the libraries using: + 'ant nodeps debug' release: Builds the application. The generated apk file must be signed before it is published. + The 'nodeps' target can be used to only build the + current project and ignore the libraries using: + 'ant nodeps release' instrument:Builds an instrumented package and signs it with a debug key. test: Runs the tests. Project must be a test project and must have been built. Typical usage would be: - ant [emma] debug installt test + ant [emma] debug install test emma: Transiently enables code coverage for subsequent targets. install: Installs the newly build package. Must either be used @@ -1348,8 +1522,10 @@ installd: Installs (only) the debug package. installr: Installs (only) the release package. installi: Installs (only) the instrumented package. - installt: Installs (only) the test and tested packages. + installt: Installs (only) the test and tested packages (unless + nodeps is used as well. uninstall: Uninstalls the application from a running emulator or - device. + device. Also uninstall tested package if applicable + unless 'nodeps' is used as well. diff --git a/jni/Android.mk b/jni/Android.mk index 766543a96..35e56b068 100755 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -116,8 +116,9 @@ ifeq ($(BUILD_SRTP), 1) include $(linphone-root-dir)/submodules/externals/build/srtp/Android.mk endif - +ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) include $(linphone-root-dir)/submodules/linphone/build/android/Android.mk +endif include $(linphone-root-dir)/submodules/linphone/build/android/Android-no-neon.mk _BUILD_AMR=0 diff --git a/res/layout/simplified_dialer.xml b/res/layout/simplified_dialer.xml index 264caf1df..7159abdb1 100644 --- a/res/layout/simplified_dialer.xml +++ b/res/layout/simplified_dialer.xml @@ -1,6 +1,6 @@ diff --git a/res/values/strings.xml b/res/values/strings.xml index 63a57e0f9..3ee1e4190 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -259,6 +259,8 @@ Confirmation Check -Redirect registrar packets to this server -Redirect all traffic to proxy server +SIP proxy hostname or ip address (optional) +Route all calls through SIP proxy +Example: john if your account is john@sip.linphone.org +sip.linphone.org if your account is john@sip.linphone.org diff --git a/src/org/linphone/AbstractCalleesActivity.java b/src/org/linphone/AbstractCalleesActivity.java index c20fbe4dd..9c2058d8f 100644 --- a/src/org/linphone/AbstractCalleesActivity.java +++ b/src/org/linphone/AbstractCalleesActivity.java @@ -268,19 +268,16 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li @Override public void onClick(View v) { - switch (v.getId()) { - case R.id.toggleMuteMic: + int id = v.getId(); + if (id == R.id.toggleMuteMic) { lc().muteMic(((Checkable) v).isChecked()); - break; - case R.id.toggleSpeaker: + } + else if (id == R.id.toggleSpeaker) { if (((Checkable) v).isChecked()) { LinphoneManager.getInstance().routeAudioToSpeaker(); } else { LinphoneManager.getInstance().routeAudioToReceiver(); } - break; - default: - break; } } diff --git a/src/org/linphone/ConferenceDetailsActivity.java b/src/org/linphone/ConferenceDetailsActivity.java index a0bb02d8b..f9ebc4763 100644 --- a/src/org/linphone/ConferenceDetailsActivity.java +++ b/src/org/linphone/ConferenceDetailsActivity.java @@ -119,17 +119,17 @@ public class ConferenceDetailsActivity extends AbstractCalleesActivity { this.dialog = dialog; } public void onClick(View v) { - switch (v.getId()) { - case R.id.terminate_call: + int id = v.getId(); + if (id == R.id.terminate_call) { lc().terminateCall(call); - break; - case R.id.remove_from_conference: + } + else if (id == R.id.remove_from_conference) { lc().removeFromConference(call); if (LinphoneUtils.countConferenceCalls(lc()) == 0) { finish(); } - break; - default: + } + else { throw new RuntimeException("unknown id " + v.getId()); } if (dialog != null) dialog.dismiss(); diff --git a/src/org/linphone/HistoryActivity.java b/src/org/linphone/HistoryActivity.java index ffa379697..8be51601e 100644 --- a/src/org/linphone/HistoryActivity.java +++ b/src/org/linphone/HistoryActivity.java @@ -95,15 +95,13 @@ public class HistoryActivity extends ListActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case R.id.menu_clear_history: + int id = item.getItemId(); + if (id == R.id.menu_clear_history) { LinphoneManager.getLc().clearCallLogs(); setListAdapter(new CallHistoryAdapter(this)); - - break; - default: + } + else { Log.e("Unknown menu item [",item,"]"); - break; } return false; diff --git a/src/org/linphone/IncallActivity.java b/src/org/linphone/IncallActivity.java index 3f2c3fdaf..f18a81b3e 100644 --- a/src/org/linphone/IncallActivity.java +++ b/src/org/linphone/IncallActivity.java @@ -332,29 +332,29 @@ public class IncallActivity extends AbstractCalleesActivity implements } public void onClick(View v) { - switch (v.getId()) { - case R.id.addCall: + int id = v.getId(); + if (id == R.id.addCall) { finish(); - break; - case R.id.incallHang: + } + else if (id == R.id.incallHang) { terminateCurrentCallOrConferenceOrAll(); - break; - case R.id.conf_header: + } + else if (id == R.id.conf_header) { boolean enterConf = !lc().isInConference(); enterConferenceAndVirtualConfView(enterConf); - break; - case R.id.conf_header_details: + } + else if (id == R.id.conf_header_details) { onLongClick(v); - break; - case R.id.incallNumpadShow: + } + else if (id == R.id.incallNumpadShow) { showDialog(numpadDialogId); - break; - case R.id.conf_simple_merge: + } + else if (id == R.id.conf_simple_merge) { if (!lc().soundResourcesLocked()) { lc().addAllToConference(); } - break; - case R.id.conf_simple_pause: + } + else if (id == R.id.conf_simple_pause) { LinphoneCall call = lc().getCurrentCall(); if (call != null) { lc().pauseCall(call); @@ -366,8 +366,8 @@ public class IncallActivity extends AbstractCalleesActivity implements lc().resumeCall(callToResume); } } - break; - case R.id.conf_simple_video: + } + else if (id == R.id.conf_simple_video) { LinphoneCall vCall = lc().getCurrentCall(); if (vCall != null) { if (!vCall.cameraEnabled() && vCall.getCurrentParamsCopy().getVideoEnabled()) { @@ -378,8 +378,8 @@ public class IncallActivity extends AbstractCalleesActivity implements LinphoneActivity.instance().startVideoActivity(vCall, 0); } } - break; - default: + } + else { // mic, speaker super.onClick(v); } @@ -431,21 +431,21 @@ public class IncallActivity extends AbstractCalleesActivity implements this.dialog = dialog; } public void onClick(View v) { - switch (v.getId()) { - case R.id.merge_to_conference: + int id =v.getId(); + if (id == R.id.merge_to_conference) { lc().addToConference(call); - break; - case R.id.terminate_call: + } + else if (id == R.id.terminate_call) { lc().terminateCall(call); - break; - case R.id.transfer_existing: + } + else if (id == R.id.transfer_existing) { prepareForTransferingExistingOrNewCall(call); - break; - case R.id.transfer_new: + } + else if (id == R.id.transfer_new) { openUriPicker(UriPickerActivity.EXTRA_PICKER_TYPE_TRANSFER, transferCallId); mCallToTransfer = call; - break; - case R.id.addVideo: + } + else if (id == R.id.addVideo) { if (!call.cameraEnabled() && call.getCurrentParamsCopy().getVideoEnabled()) { // NoWebcam mode, we let it this way LinphoneActivity.instance().startVideoActivity(call, 0); @@ -453,17 +453,17 @@ public class IncallActivity extends AbstractCalleesActivity implements else if (!LinphoneManager.getInstance().addVideo()) { LinphoneActivity.instance().startVideoActivity(call, 0); } - break; - case R.id.set_auth_token_verified: + } + else if (id == R.id.set_auth_token_verified) { call.setAuthenticationTokenVerified(true); - break; - case R.id.set_auth_token_not_verified: + } + else if (id == R.id.set_auth_token_not_verified) { call.setAuthenticationTokenVerified(false); - break; - case R.id.encrypted: + } + else if (id == R.id.encrypted) { call.setAuthenticationTokenVerified(!call.isAuthenticationTokenVerified()); - break; - default: + } + else { throw new RuntimeException("unknown id " + v.getId()); } if (dialog != null) dialog.dismiss(); diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 628065d67..755b9b0a9 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -22,6 +22,7 @@ package org.linphone; import static android.content.Intent.ACTION_MAIN; import org.linphone.LinphoneSimpleListener.LinphoneOnCallStateChangedListener; +import org.linphone.compatibility.Compatibility; import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCore; @@ -101,7 +102,8 @@ public class LinphoneActivity extends TabActivity implements ContactPicked instance = this; setContentView(R.layout.main); - int rotation = getWindowManager().getDefaultDisplay().getRotation() * 90; + @SuppressWarnings("deprecation") + int rotation = Compatibility.getRotation(getWindowManager().getDefaultDisplay()); // Inverse landscape rotation to initiate linphoneCore correctly if (rotation == 270) rotation = 90; @@ -263,21 +265,22 @@ public class LinphoneActivity extends TabActivity implements ContactPicked @Override public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case R.id.menu_settings: + int id = item.getItemId(); + if (id == R.id.menu_settings) { startprefActivity(); return true; - case R.id.menu_exit: + } + else if (id == R.id.menu_exit) { finish(); stopService(new Intent(ACTION_MAIN) .setClass(this, LinphoneService.class)); - break; - case R.id.menu_about: + } + else if (id == R.id.menu_about) { startActivity(new Intent(ACTION_MAIN) .setClass(this, AboutActivity.class)); - default: + } + else { Log.e("Unknown menu item [",item,"]"); - break; } return false; diff --git a/src/org/linphone/LinphoneLauncherActivity.java b/src/org/linphone/LinphoneLauncherActivity.java index 5de13dbde..36537a443 100644 --- a/src/org/linphone/LinphoneLauncherActivity.java +++ b/src/org/linphone/LinphoneLauncherActivity.java @@ -52,7 +52,9 @@ public class LinphoneLauncherActivity extends Activity { } } - private void onServiceReady() { + protected void onServiceReady() { + LinphoneService.instance().setActivityToLaunchOnIncomingReceived(LinphoneActivity.class); + startActivity(new Intent() .setClass(this, LinphoneActivity.class) .setData(getIntent().getData())); diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index a82485f53..a6ebb5315 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -1050,11 +1050,21 @@ public final class LinphoneManager implements LinphoneCoreListener { private boolean isRinging; + private boolean disableRinging = false; + + public void disableRinging() { + disableRinging = true; + } + private synchronized void startRinging() { + if (disableRinging ) { + return; + } + if (Hacks.needGalaxySAudioHack()) { mAudioManager.setMode(MODE_RINGTONE); } - + try { if (mAudioManager.shouldVibrate(VIBRATE_TYPE_RINGER) && mVibrator !=null) { long[] patern = {0,1000,1000}; @@ -1428,4 +1438,10 @@ public final class LinphoneManager implements LinphoneCoreListener { super(throwable); } } + + @Override + public void notifyReceived(LinphoneCore lc, LinphoneCall call, + LinphoneAddress from, byte[] event) { + + } } diff --git a/src/org/linphone/LinphonePreferencesSIPAccountActivity.java b/src/org/linphone/LinphonePreferencesSIPAccountActivity.java index 1de114bf8..c61762e1d 100644 --- a/src/org/linphone/LinphonePreferencesSIPAccountActivity.java +++ b/src/org/linphone/LinphonePreferencesSIPAccountActivity.java @@ -57,7 +57,7 @@ public class LinphonePreferencesSIPAccountActivity extends PreferenceActivity { username.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS); username.setTitle(getString(R.string.pref_username)); username.setPersistent(true); - username.setDialogMessage("Example: toto if your account is toto@sip.linphone.org"); + username.setDialogMessage(getString(R.string.pref_help_username)); username.setKey(getString(R.string.pref_username_key) + getAccountNumber(n)); username.setOnPreferenceChangeListener(preferenceChangedListener); @@ -71,7 +71,7 @@ public class LinphonePreferencesSIPAccountActivity extends PreferenceActivity { domain.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS); domain.setTitle(getString(R.string.pref_domain)); domain.setPersistent(true); - domain.setDialogMessage("Example: sip.linphone.org if your account is toto@sip.linphone.org"); + domain.setDialogMessage(getString(R.string.pref_help_domain)); domain.setKey(getString(R.string.pref_domain_key) + getAccountNumber(n)); domain.setOnPreferenceChangeListener(preferenceChangedListener); diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index 57d8694a7..09240f529 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -35,6 +35,7 @@ import org.linphone.core.Log; import org.linphone.core.OnlineStatus; import org.linphone.mediastream.Version; +import android.app.Activity; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; @@ -86,7 +87,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis /** * @throws RuntimeException service not instantiated */ - static LinphoneService instance() { + public static LinphoneService instance() { if (isReady()) return instance; throw new RuntimeException("LinphoneService not instantiated yet"); @@ -242,6 +243,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis private Object[] mSetForegroundArgs = new Object[1]; private Object[] mStartForegroundArgs = new Object[2]; private Object[] mStopForegroundArgs = new Object[1]; + private Class incomingReceivedActivity = LinphoneActivity.class; void invokeMethod(Method method, Object[] args) { try { @@ -438,7 +440,21 @@ public final class LinphoneService extends Service implements LinphoneServiceLis }); } } - + + public void setActivityToLaunchOnIncomingReceived(Class activity) { + incomingReceivedActivity = activity; + + Intent notifIntent = new Intent(this, incomingReceivedActivity); + mNotifContentIntent = PendingIntent.getActivity(this, 0, notifIntent, 0); + mNotif.setLatestEventInfo(this, mNotificationTitle,"", mNotifContentIntent); + } + + protected void onIncomingReceived() { + //wakeup linphone + startActivity(new Intent() + .setClass(this, incomingReceivedActivity) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); + } public void onCallStateChanged(final LinphoneCall call, final State state, final String message) { if (instance == null) { @@ -446,10 +462,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis return; } if (state == LinphoneCall.State.IncomingReceived) { - //wakeup linphone - startActivity(new Intent() - .setClass(this, LinphoneActivity.class) - .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); + onIncomingReceived(); } if (state == State.CallUpdatedByRemote) { diff --git a/src/org/linphone/VideoCallActivity.java b/src/org/linphone/VideoCallActivity.java index 49e4b1a5d..7551bc229 100755 --- a/src/org/linphone/VideoCallActivity.java +++ b/src/org/linphone/VideoCallActivity.java @@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package org.linphone; import org.linphone.LinphoneSimpleListener.LinphoneOnCallStateChangedListener; +import org.linphone.compatibility.Compatibility; import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCallParams; @@ -260,12 +261,12 @@ public class VideoCallActivity extends Activity implements @Override public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case R.id.videocall_menu_back_to_dialer: + int id = item.getItemId(); + if (id == R.id.videocall_menu_back_to_dialer) { finish(); LinphoneActivity.instance().startIncallActivity(); - break; - case R.id.videocall_menu_change_resolution: + } + else if (id == R.id.videocall_menu_change_resolution) { LinphoneManager.getInstance().changeResolution(); // previous call will cause graph reconstruction -> regive preview // window @@ -273,11 +274,11 @@ public class VideoCallActivity extends Activity implements LinphoneManager.getLc() .setPreviewWindow(mVideoCaptureViewReady); rewriteChangeResolutionItem(item); - break; - case R.id.videocall_menu_terminate_call: + } + else if (id == R.id.videocall_menu_terminate_call) { LinphoneManager.getInstance().terminateCall(); - break; - case R.id.videocall_menu_toggle_camera: + } + else if (id == R.id.videocall_menu_toggle_camera) { boolean camEnabled = LinphoneManager.getInstance() .toggleEnableCamera(); updatePreview(camEnabled); @@ -291,21 +292,20 @@ public class VideoCallActivity extends Activity implements mVideoCaptureViewReady); } else LinphoneManager.getLc().setPreviewWindow(null); - break; - case R.id.videocall_menu_switch_camera: - int id = LinphoneManager.getLc().getVideoDevice(); - id = (id + 1) % AndroidCameraConfiguration.retrieveCameras().length; - LinphoneManager.getLc().setVideoDevice(id); + } + else if (id == R.id.videocall_menu_switch_camera) { + int videoDeviceId = LinphoneManager.getLc().getVideoDevice(); + videoDeviceId = (videoDeviceId + 1) % AndroidCameraConfiguration.retrieveCameras().length; + LinphoneManager.getLc().setVideoDevice(videoDeviceId); CallManager.getInstance().updateCall(); // previous call will cause graph reconstruction -> regive preview // window if (mVideoCaptureViewReady != null) LinphoneManager.getLc() .setPreviewWindow(mVideoCaptureViewReady); - break; - default: + } + else { Log.e("Unknown menu item [", item, "]"); - break; } return true; } @@ -457,7 +457,8 @@ public class VideoCallActivity extends Activity implements private void resizePreview() { Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)) .getDefaultDisplay(); - int rotation = display.getRotation(); + + int rotation = Compatibility.getRotation(display); LayoutParams params; int w, h; @@ -500,48 +501,47 @@ public class VideoCallActivity extends Activity implements public void onClick(View v) { resetControlsLayoutExpiration(); - switch (v.getId()) { - case R.id.incallHang: + int id = v.getId(); + if (id == R.id.incallHang) { terminateCurrentCallOrConferenceOrAll(); - break; - case R.id.toggleSpeaker: + } + else if (id == R.id.toggleSpeaker) { if (((Checkable) v).isChecked()) { LinphoneManager.getInstance().routeAudioToSpeaker(); } else { LinphoneManager.getInstance().routeAudioToReceiver(); } - break; - case R.id.incallNumpadShow: + } + else if (id == R.id.incallNumpadShow) { showDialog(numpadDialogId); - break; - case R.id.toggleMuteMic: + } + else if (id == R.id.toggleMuteMic) { LinphoneManager.getLc().muteMic(((Checkable) v).isChecked()); - break; - case R.id.switch_camera: - int id = LinphoneManager.getLc().getVideoDevice(); - id = (id + 1) % AndroidCameraConfiguration.retrieveCameras().length; - LinphoneManager.getLc().setVideoDevice(id); + } + else if (id == R.id.switch_camera) { + int videoDeviceId = LinphoneManager.getLc().getVideoDevice(); + videoDeviceId = (videoDeviceId + 1) % AndroidCameraConfiguration.retrieveCameras().length; + LinphoneManager.getLc().setVideoDevice(videoDeviceId); CallManager.getInstance().updateCall(); // previous call will cause graph reconstruction -> regive preview // window if (mVideoCaptureViewReady != null) LinphoneManager.getLc() .setPreviewWindow(mVideoCaptureViewReady); - break; - case R.id.conf_simple_pause: + } + else if (id == R.id.conf_simple_pause) { finish(); LinphoneActivity.instance().startIncallActivity(); LinphoneManager.getLc().pauseCall(videoCall); - break; - case R.id.conf_simple_video: + } + else if (id == R.id.conf_simple_video) { LinphoneCallParams params = videoCall.getCurrentParamsCopy(); params.setVideoEnabled(false); LinphoneManager.getLc().updateCall(videoCall, params); - break; - case R.id.back: + } + else if (id == R.id.back) { finish(); LinphoneActivity.instance().startIncallActivity(); - break; } } diff --git a/src/org/linphone/compatibility/API4Compatibility.java b/src/org/linphone/compatibility/API4Compatibility.java new file mode 100644 index 000000000..62aad0f7b --- /dev/null +++ b/src/org/linphone/compatibility/API4Compatibility.java @@ -0,0 +1,10 @@ +package org.linphone.compatibility; + +import android.view.Display; + +public class API4Compatibility { + + public static int getRotation(Display display) { + return display.getOrientation(); + } +} diff --git a/src/org/linphone/compatibility/API8Compatibility.java b/src/org/linphone/compatibility/API8Compatibility.java new file mode 100644 index 000000000..07567b09d --- /dev/null +++ b/src/org/linphone/compatibility/API8Compatibility.java @@ -0,0 +1,10 @@ +package org.linphone.compatibility; + +import android.view.Display; + +public class API8Compatibility { + + public static int getRotation(Display display) { + return display.getRotation(); + } +} diff --git a/src/org/linphone/compatibility/Compatibility.java b/src/org/linphone/compatibility/Compatibility.java new file mode 100644 index 000000000..ce05a237d --- /dev/null +++ b/src/org/linphone/compatibility/Compatibility.java @@ -0,0 +1,17 @@ +package org.linphone.compatibility; + +import org.linphone.mediastream.Version; + +import android.view.Display; + +public class Compatibility { + + public static int getRotation(Display display) { + if (Version.sdkStrictlyBelow(8)) { + return API4Compatibility.getRotation(display); + } else { + return API8Compatibility.getRotation(display); + } + } + +} diff --git a/src/org/linphone/core/LinphoneCallImpl.java b/src/org/linphone/core/LinphoneCallImpl.java index 008b19df4..27ed253ef 100644 --- a/src/org/linphone/core/LinphoneCallImpl.java +++ b/src/org/linphone/core/LinphoneCallImpl.java @@ -155,4 +155,14 @@ class LinphoneCallImpl implements LinphoneCall { public float getPlayVolume() { return getPlayVolume(nativePtr); } + + private native void takeSnapshot(long nativePtr, String path); + public void takeSnapshot(String path) { + takeSnapshot(nativePtr, path); + } + + private native void zoomVideo(long nativePtr, float factor, float cx, float cy); + public void zoomVideo(float factor, float cx, float cy) { + zoomVideo(nativePtr, factor, cx, cy); + } } diff --git a/src/org/linphone/core/LinphoneCallLogImpl.java b/src/org/linphone/core/LinphoneCallLogImpl.java index 1bdb84720..895e27a38 100644 --- a/src/org/linphone/core/LinphoneCallLogImpl.java +++ b/src/org/linphone/core/LinphoneCallLogImpl.java @@ -45,5 +45,15 @@ class LinphoneCallLogImpl implements LinphoneCallLog { public CallStatus getStatus() { throw new RuntimeException("not implemented yet"); } + @Override + public String getStartDate() { + // TODO Auto-generated method stub + return null; + } + @Override + public int getCallDuration() { + // TODO Auto-generated method stub + return 0; + } } diff --git a/src/org/linphone/core/LinphoneCoreImpl.java b/src/org/linphone/core/LinphoneCoreImpl.java index 54f6383a0..4a962e52e 100644 --- a/src/org/linphone/core/LinphoneCoreImpl.java +++ b/src/org/linphone/core/LinphoneCoreImpl.java @@ -20,7 +20,6 @@ package org.linphone.core; import java.io.File; import java.io.IOException; -import java.util.Vector; class LinphoneCoreImpl implements LinphoneCore { @@ -704,4 +703,30 @@ class LinphoneCoreImpl implements LinphoneCore { { setCpuCountNative(count); } + private native void tunnelSetHttpProxyNative(long nativePtr, String proxy_host, int port, String username, String password); + @Override + public void tunnelSetHttpProxy(String proxy_host, int port, + String username, String password) { + tunnelSetHttpProxyNative(nativePtr,proxy_host, port, username, password); + } + + private native void removeCallLog(long nativePtr, LinphoneCallLog log); + public void removeCallLog(LinphoneCallLog log) { + removeCallLog(nativePtr, log); + } + + private native int getMissedCallsCount(long nativePtr); + public int getMissedCallsCount() { + return getMissedCallsCount(nativePtr); + } + + private native void resetMissedCallsCount(long nativePtr); + public void resetMissedCallsCount() { + resetMissedCallsCount(nativePtr); + } + + private native void refreshRegisters(long nativePtr); + public void refreshRegisters() { + refreshRegisters(nativePtr); + } } diff --git a/submodules/externals/build/ffmpeg/Android_libavcodec.mk b/submodules/externals/build/ffmpeg/Android_libavcodec.mk index ef2de0ac0..dab39a7e8 100755 --- a/submodules/externals/build/ffmpeg/Android_libavcodec.mk +++ b/submodules/externals/build/ffmpeg/Android_libavcodec.mk @@ -70,6 +70,7 @@ LOCAL_SRC_FILES = \ libavcodec/jrevdct.c \ libavcodec/mjpeg.c.arm \ libavcodec/mjpegdec.c.arm \ + libavcodec/mjpegenc.c.arm \ libavcodec/motion_est.c.arm \ libavcodec/mpeg12data.c \ libavcodec/mpeg4video.c.arm \ diff --git a/submodules/externals/build/ffmpeg/config.h b/submodules/externals/build/ffmpeg/config.h index 7a9591f6a..86eb0bae3 100644 --- a/submodules/externals/build/ffmpeg/config.h +++ b/submodules/externals/build/ffmpeg/config.h @@ -515,7 +515,7 @@ #define CONFIG_HUFFYUV_ENCODER 0 #define CONFIG_JPEGLS_ENCODER 0 #define CONFIG_LJPEG_ENCODER 0 -#define CONFIG_MJPEG_ENCODER 0 +#define CONFIG_MJPEG_ENCODER 1 #define CONFIG_MPEG1VIDEO_ENCODER 0 #define CONFIG_MPEG2VIDEO_ENCODER 0 #define CONFIG_MPEG4_ENCODER 1 diff --git a/submodules/libilbc-rfc3951 b/submodules/libilbc-rfc3951 index af32518af..a70714c2e 160000 --- a/submodules/libilbc-rfc3951 +++ b/submodules/libilbc-rfc3951 @@ -1 +1 @@ -Subproject commit af32518af41f97caee07070234a3475409b9a27d +Subproject commit a70714c2e8a1f6f9958450cb612e3dc9895981e7 diff --git a/submodules/linphone b/submodules/linphone index e2379a670..9f02a12f4 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit e2379a67051d30fb061ce738cf83e4d81f45bb14 +Subproject commit 9f02a12f4641989a225ee77bf6f403cd1c57d9e6