From 7f9f75768ac253b6ea8cae0c10be4f60ace6fc9d Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 28 Dec 2011 13:23:24 +0100 Subject: [PATCH 1/7] Ant script for buildbot --- .classpath | 4 +-- build.xml | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 build.xml diff --git a/.classpath b/.classpath index 442e71149..be759ecd4 100644 --- a/.classpath +++ b/.classpath @@ -1,11 +1,11 @@ - + - + diff --git a/build.xml b/build.xml new file mode 100644 index 000000000..8a4d9369c --- /dev/null +++ b/build.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c3004ce6a1bb6e9c9b35fe72e7c8cae7aedb7d68 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 28 Dec 2011 14:38:14 +0100 Subject: [PATCH 2/7] updated build.xml --- build.xml | 171 ++++++++++++++++++++++++++---------------------------- 1 file changed, 81 insertions(+), 90 deletions(-) diff --git a/build.xml b/build.xml index 8a4d9369c..a692a36aa 100644 --- a/build.xml +++ b/build.xml @@ -1,94 +1,85 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + From e68972794fda958b30014b02c1723c42337a4b4c Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 28 Dec 2011 15:29:13 +0100 Subject: [PATCH 3/7] ant script for buildbot --- build.xml | 1255 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1252 insertions(+), 3 deletions(-) diff --git a/build.xml b/build.xml index a692a36aa..271c019b3 100644 --- a/build.xml +++ b/build.xml @@ -1,5 +1,5 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @{elseText} + + + + + + + + + + + + + + + + + + + + + @{elseText} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Running tests ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Uninstalling @{app.package} from the default emulator or device... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gathering info for ${ant.project.name}... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Building Libraries + + + ############################################ + **** Back to project ${ant.project.name} **** + ############################################ + + + + + + + + + + + + Building tested project at ${tested.project.absolute.dir} + + + + + ############################################ + **** 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 RenderScript files... + + + + + ---------- + Handling Resources... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creating library output jar file... + + + + + + + Custom jar packaging exclusion: ${android.package.excludes} + + + + + + + + + + + + + Instrumenting classes from ${out.absolute.dir}/classes... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @${proguard.config} + -injars ${project.jars} + -outjars "${obfuscated.jar.file}" + -libraryjars ${android.libraryjars} + -dump "${obfuscate.absolute.dir}/dump.txt" + -printseeds "${obfuscate.absolute.dir}/seeds.txt" + -printusage "${obfuscate.absolute.dir}/usage.txt" + -printmapping "${obfuscate.absolute.dir}/mapping.txt" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Debug Package: ${out.final.file} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ************************************************* + **** Android Manifest has debuggable=true **** + **** Doing DEBUG packaging with RELEASE keys **** + ************************************************* + + + + + + + + + + + + + + + + + + Signing final apk... + + + + + Release Package: ${out.final.file} + + + + + + + + + + + + + + + + + + + + + + + + Instrumented Package: ${out.final.file} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WARNING: Code Coverage is currently only supported on the emulator and rooted devices. + + + + + + + + Downloading coverage file into project directory... + + + + + + + Extracting coverage report... + + + + + + + + + + + + Cleaning up temporary files... + + + Saving the report file in ${basedir}/coverage/coverage.html + + + + + + + + + + + + + + + + + + + + + + + + + + Installing ${out.final.file} onto default emulator or device... + + + + + + + + + + + + + + Install file not specified. + + 'ant install' now requires the build target to be specified as well. + + + ant debug install + ant release install + ant instrument install + This will build the given package and install it. + + Alternatively, you can use + ant installd + ant installr + ant installi + ant installt + to only install an existing package (this will not rebuild the package.) + + + + + + + + + + + + + + + + + + + + + + + + + + Could not find application package in manifest. Cannot run 'adb uninstall'. + + + + + + + + + + + + + + + + + + Could not find tested application package in manifest. Cannot run 'adb uninstall'. + + + + + + + + + + + Android Ant Build. Available targets: + help: Displays this help. + clean: Removes output files created by other targets. + The 'all' target can be used to clean dependencies + (tested projects and libraries)at the same time + using: 'ant all clean' + debug: Builds the application and signs it with a debug key. + release: Builds the application. The generated apk file must be + signed before it is published. + 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 + emma: Transiently enables code coverage for subsequent + targets. + install: Installs the newly build package. Must either be used + in conjunction with a build target (debug/release/ + instrument) or with the proper suffix indicating + which package to install (see below). + If the application was previously installed, the + application is reinstalled if the signature matches. + 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. + uninstall: Uninstalls the application from a running emulator or + device. + From 38a3dec60fada79cd4698569df6fb6553b400005 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 30 Dec 2011 17:00:28 +0100 Subject: [PATCH 4/7] Show who is talking in conf view --- res/drawable/conf_speaking.png | Bin 0 -> 1112 bytes res/layout/conf_callee.xml | 5 +-- src/org/linphone/AbstractCalleesActivity.java | 32 +++++++++++++++--- .../linphone/ConferenceDetailsActivity.java | 3 ++ src/org/linphone/IncallActivity.java | 2 +- src/org/linphone/core/LinphoneCallImpl.java | 5 +++ 6 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 res/drawable/conf_speaking.png diff --git a/res/drawable/conf_speaking.png b/res/drawable/conf_speaking.png new file mode 100644 index 0000000000000000000000000000000000000000..2324d81c34df87d3e64cd06db6e0972fe1e1234c GIT binary patch literal 1112 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*s0wiy+h|2>hrX+877Y2q^y~;*F9%q3^WHFHT z0Ash4*>)hovI56+APv^b(7sV=3j+glf~SjPh{fsNDbXEMLq(3)XTN8WaMu$R|!V9LoC5JgS6=LJ{kYZbi>Ev`*>>&ny*Kyk-*3I{y5mfoy0WsOfWb146CY2d zE`M_AX?Mz;#jP$;8IxMhWV_6N;J#UVhgs3)%=(g7 zoZZ>e>NgoJpVpcg!Yr!3b;GWzPgnX^ip6-&icmN&@$2GgZ!V$Njsiml$O#?LV%z$2mkRQHAGOS*d(g`)|`u-ko_F4d$QJSa;qk zp6khZY0ZY6%j+Z7wuqb;TORe7;kT;(+iRx;r|9kAIHb|7X}EQd#qvrGo7mes!?QlV zJr(U!6cc>5a>JhaDJ`j&+piwq!rCqTzVzP47mjuEyp^W~SQyVwT z|1MJhO^{dj;!42?!|I*pZOk%HC1!3p87N$};~m%2I>lqLB7)1dJQ1Dke*6E6$@>{2 zb>~U0@o>8e%y_CLt`Q|Ei6yC4$wjF^iowXh&`{UVNY~gP#L&RX#L&vnQrE!L%D^CW z=cg$s8glbfGSez?YfyROr2*6+39=zLKdq!Zu_%?nF(p4KRlzeiF+DXXH8G{K@MNkD PP!WTttDnm{r-UW|*0<$l literal 0 HcmV?d00001 diff --git a/res/layout/conf_callee.xml b/res/layout/conf_callee.xml index f2fa06a33..e3792b58d 100644 --- a/res/layout/conf_callee.xml +++ b/res/layout/conf_callee.xml @@ -23,8 +23,9 @@ android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerVertical="true"> - - + + + diff --git a/src/org/linphone/AbstractCalleesActivity.java b/src/org/linphone/AbstractCalleesActivity.java index 3b40cb296..c88db583b 100644 --- a/src/org/linphone/AbstractCalleesActivity.java +++ b/src/org/linphone/AbstractCalleesActivity.java @@ -67,6 +67,7 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li private Handler callqualityHandler; private List viewsToUpdateCallQuality; + private boolean shouldDisplayWhoIsTalking = false; @Override /** * Called by the child classes AFTER their own onCreate. @@ -215,6 +216,12 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li } protected final void initCallQualityListener() { + final int timeToRefresh; + if (shouldDisplayWhoIsTalking) + timeToRefresh = 100; + else + timeToRefresh = 1000; + callqualityHandler = new Handler(); viewsToUpdateCallQuality = new ArrayList(); callqualityHandler.postDelayed(new Runnable() { @@ -222,16 +229,24 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li if (viewsToUpdateCallQuality == null) { return; } - + for (View v : viewsToUpdateCallQuality) { LinphoneCall call = (LinphoneCall) v.getTag(); float newQuality = call.getCurrentQuality(); - updateQualityOfSignalIcon(v, newQuality); + updateQualityOfSignalIcon(v, newQuality); + + // We also use this handler to display the ones who speaks + ImageView speaking = (ImageView) v.findViewById(R.id.callee_status_speeking); + if (shouldDisplayWhoIsTalking && call.getPlayVolume() >= -20) { + speaking.setVisibility(View.VISIBLE); + } else if (speaking.getVisibility() != View.GONE) { + speaking.setVisibility(View.GONE); + } } - callqualityHandler.postDelayed(this, 1000); + callqualityHandler.postDelayed(this, timeToRefresh); } - },1000); + },timeToRefresh); } protected final void registerCallQualityListener(final View v, final LinphoneCall call) { @@ -241,6 +256,10 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li v.setTag(call); viewsToUpdateCallQuality.add(v); } + + protected final void registerCallSpeakerListener() { + shouldDisplayWhoIsTalking = true; + } } @Override @@ -282,7 +301,10 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li void updateQualityOfSignalIcon(View v, float quality) { - ImageView qos = (ImageView) v.findViewById(R.id.QoS); + ImageView qos = (ImageView) v.findViewById(R.id.callee_status_qos); + if (!(qos.getVisibility() == View.VISIBLE)) { + qos.setVisibility(View.VISIBLE); + } if (quality >= 4) // Good Quality { qos.setImageDrawable(getResources().getDrawable(R.drawable.stat_sys_signal_4)); diff --git a/src/org/linphone/ConferenceDetailsActivity.java b/src/org/linphone/ConferenceDetailsActivity.java index 08bcea633..a0bb02d8b 100644 --- a/src/org/linphone/ConferenceDetailsActivity.java +++ b/src/org/linphone/ConferenceDetailsActivity.java @@ -95,6 +95,8 @@ public class ConferenceDetailsActivity extends AbstractCalleesActivity { dialog.show(); } }); + + setVisibility(v, R.id.callee_status_qos, true); // May be greatly sped up using a drawable cache ImageView pictureView = (ImageView) v.findViewById(R.id.picture); @@ -102,6 +104,7 @@ public class ConferenceDetailsActivity extends AbstractCalleesActivity { registerCallDurationTimer(v, call); registerCallQualityListener(v, call); + registerCallSpeakerListener(); return v; } diff --git a/src/org/linphone/IncallActivity.java b/src/org/linphone/IncallActivity.java index 91cda16cd..0f7738f8b 100644 --- a/src/org/linphone/IncallActivity.java +++ b/src/org/linphone/IncallActivity.java @@ -456,7 +456,7 @@ public class IncallActivity extends AbstractCalleesActivity implements boolean statusPaused = state== State.Paused || state == State.PausedByRemote; setVisibility(v, R.id.callee_status_paused, statusPaused); - setVisibility(v, R.id.QoS, !statusPaused); + setVisibility(v, R.id.callee_status_qos, !statusPaused); final OnLongClickListener showCallActionsLongListener = new OnLongClickListener() { public boolean onLongClick(View v) { diff --git a/src/org/linphone/core/LinphoneCallImpl.java b/src/org/linphone/core/LinphoneCallImpl.java index 802801155..b2b71dcb5 100644 --- a/src/org/linphone/core/LinphoneCallImpl.java +++ b/src/org/linphone/core/LinphoneCallImpl.java @@ -147,4 +147,9 @@ class LinphoneCallImpl implements LinphoneCall { public String toString() { return "Call " + nativePtr; } + + private native float getPlayVolume(long nativePtr); + public float getPlayVolume() { + return getPlayVolume(nativePtr); + } } From edd684356fd107b55b8cd92655f2cd620f994f41 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 30 Dec 2011 17:07:13 +0100 Subject: [PATCH 5/7] Updated linphone submodule --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 5bf95231b..29e89fc9d 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 5bf95231b51641ce095af49a864cf00fa6837750 +Subproject commit 29e89fc9de102f88b8ebf36a5fe7449a26a8bbff From dadec7e60b8af426fa97c13a80892fa2d3ba2899 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 2 Jan 2012 16:49:23 +0100 Subject: [PATCH 6/7] build.xml updated to take in charge R.java package name --- build.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build.xml b/build.xml index 271c019b3..e77878e4d 100644 --- a/build.xml +++ b/build.xml @@ -102,6 +102,8 @@ - help target --> + + - + @@ -644,7 +646,7 @@ rfolder="${gen.absolute.dir}" nonConstantId="${android.library}" projectLibrariesResName="project.libraries.res" - projectLibrariesPackageName="project.libraries.package"> + projectLibrariesPackageName="${linphone.package.name}"> @@ -859,7 +861,7 @@ resourcefilename="${resource.package.file.name}" resourcefilter="${aapt.resource.filter}" projectLibrariesResName="project.libraries.res" - projectLibrariesPackageName="project.libraries.package" + projectLibrariesPackageName="${linphone.package.name}" previousBuildType="${build.last.target}" buildType="${build.target}"> From c0e63e2af20b3b1dbf8af5d78b8a98f166df4607 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 4 Jan 2012 16:10:58 +0100 Subject: [PATCH 7/7] aquire wifi lock during call to avoid netorking slow down --- src/org/linphone/LinphoneService.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index c1a479ab2..b3103987f 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -38,6 +38,7 @@ import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; +import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; @@ -48,6 +49,8 @@ import android.os.Build; import android.os.Handler; import android.os.IBinder; import android.preference.PreferenceManager; +import android.net.wifi.WifiManager.WifiLock; +import android.net.wifi.WifiManager; /** * @@ -73,7 +76,8 @@ public final class LinphoneService extends Service implements LinphoneServiceLis // private boolean mTestDelayElapsed; // add a timer for testing private boolean mTestDelayElapsed = true; // no timer - + private WifiManager mWifiManager ; + private WifiLock mWifiLock ; public static boolean isReady() { return instance!=null && instance.mTestDelayElapsed; } @@ -136,8 +140,11 @@ public final class LinphoneService extends Service implements LinphoneServiceLis LinphoneManager.createAndStart(this, this); LinphoneManager.getLc().setPresenceInfo(0, null, OnlineStatus.Online); + mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); + mWifiLock = mWifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, this.getPackageName()+"-wifi-call-lock"); + mWifiLock.setReferenceCounted(false); instance = this; // instance is ready once linphone manager has been created - + // Retrieve methods to publish notification and keep Android // from killing us and keep the audio quality high. @@ -365,7 +372,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis // Make sure our notification is gone. stopForegroundCompat(NOTIF_ID); mNM.cancel(INCALL_NOTIF_ID); - + mWifiLock.release(); super.onDestroy(); } @@ -444,10 +451,13 @@ public final class LinphoneService extends Service implements LinphoneServiceLis if (state == State.StreamsRunning) { // Workaround bug current call seems to be updated after state changed to streams running refreshIncallIcon(call); + mWifiLock.acquire(); } else { refreshIncallIcon(LinphoneManager.getLc().getCurrentCall()); } - + if ((state == State.CallEnd || state == State.Error) && LinphoneManager.getLc().getCallsNb() < 1) { + mWifiLock.release(); + } mHandler.post(new Runnable() { public void run() { if (guiListener() != null)