Merge branch 'master' of git.linphone.org:linphone-android
Conflicts: submodules/linphone
This commit is contained in:
commit
c0f07545df
6 changed files with 162 additions and 14 deletions
|
@ -103,7 +103,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<activity android:name="core.tutorials.video.TestVideoActivity"
|
<activity android:name="org.linphone.core.tutorials.TestVideoActivity"
|
||||||
android:label="Video test"
|
android:label="Video test"
|
||||||
android:theme="@android:style/Theme.NoTitleBar"
|
android:theme="@android:style/Theme.NoTitleBar"
|
||||||
android:enabled="false">
|
android:enabled="false">
|
||||||
|
|
149
deliver_sdk.sh
149
deliver_sdk.sh
|
@ -1,9 +1,150 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
rm ../liblinphone-android-sdk.zip
|
copy()
|
||||||
zip -r ../liblinphone-android-sdk.zip submodules/linphone/coreapi/help/java libs src/org/linphone/core submodules/linphone/java/j2se/ submodules/linphone/java/common res/layout/hello_world.xml res/layout/videotest.xml src/org/linphone/core/ src/org/linphone/Hacks.java
|
{
|
||||||
|
todir="$2/`dirname $1`"
|
||||||
|
echo "Copying $1 to $2/$1"
|
||||||
|
mkdir -p $todir
|
||||||
|
cp -r $1 $todir
|
||||||
|
}
|
||||||
|
|
||||||
javadoc -d liblinphone-android-javadoc "org.linphone" src/org/linphone/*.java src/org/linphone/core/*.java src/org/linphone/core/tutorials/* src/org/linphone/component/* submodules/linphone/java/common/org/linphone/core/*.java submodules/linphone/java/j2se/org/linphone/core/*.java
|
androidize()
|
||||||
rm ../liblinphone-android-javadoc.zip
|
{
|
||||||
|
D=$1
|
||||||
|
mkdir -p $D/gen
|
||||||
|
|
||||||
|
# Add sources to eclipse .classpath
|
||||||
|
cat > $D/.classpath <<EOF
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="src" path="gen"/>
|
||||||
|
<classpathentry kind="src" path="submodules/linphone/coreapi/help/java"/>
|
||||||
|
<classpathentry kind="src" path="submodules/linphone/java/common"/>
|
||||||
|
<classpathentry kind="src" path="submodules/linphone/java/j2se"/>
|
||||||
|
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Fix package name
|
||||||
|
{
|
||||||
|
cd $D
|
||||||
|
grep -R "org.linphone.R" . -l | grep java | xargs sed -i 's/org\.linphone\.R/org\.linphone\.sdk\.R/g'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create a basic AndroidManifest.xml
|
||||||
|
cat > $D/AndroidManifest.xml <<EOF
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="org.linphone.sdk" android:versionCode="1" android:versionName="1.0">
|
||||||
|
<application>
|
||||||
|
|
||||||
|
|
||||||
|
<activity android:name="org.linphone.core.tutorials.TestVideoActivity"
|
||||||
|
android:label="Video test"
|
||||||
|
android:theme="@android:style/Theme.NoTitleBar"
|
||||||
|
android:enabled="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name="org.linphone.core.tutorials.TutorialHelloWorldActivity"
|
||||||
|
android:label="Hello World"
|
||||||
|
android:enabled="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name="org.linphone.core.tutorials.TutorialRegistrationActivity"
|
||||||
|
android:label="Registration"
|
||||||
|
android:enabled="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name="org.linphone.core.tutorials.TutorialBuddyStatusActivity"
|
||||||
|
android:label="Buddy status"
|
||||||
|
android:enabled="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name="org.linphone.core.tutorials.TutorialChatRoomActivity"
|
||||||
|
android:label="Chat Room"
|
||||||
|
android:enabled="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
|
||||||
|
<uses-permission android:name="android.permission.RECORD_AUDIO"></uses-permission>
|
||||||
|
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||||
|
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
|
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||||
|
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"></uses-permission>
|
||||||
|
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
|
||||||
|
<uses-permission android:name="android.permission.BOOT_COMPLETED"></uses-permission>
|
||||||
|
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
|
||||||
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
|
||||||
|
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
|
||||||
|
</manifest>
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > $D/default.properties <<EOF
|
||||||
|
split.density=false
|
||||||
|
target=android-9
|
||||||
|
EOF
|
||||||
|
|
||||||
|
mkdir -p $D/.settings
|
||||||
|
cat > $D/.settings/org.eclipse.jdt.core.prefs <<EOF
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||||
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.5
|
||||||
|
EOF
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
DBASE="liblinphone-android-sdk"
|
||||||
|
D="../$DBASE"
|
||||||
|
rm -rf $D.zip $D
|
||||||
|
copy submodules/linphone/coreapi/help/java $D
|
||||||
|
copy libs $D
|
||||||
|
copy src/org/linphone/core $D
|
||||||
|
copy submodules/linphone/java/j2se/ $D
|
||||||
|
copy submodules/linphone/java/common $D
|
||||||
|
copy res/layout/hello_world.xml $D
|
||||||
|
copy res/layout/videotest.xml $D
|
||||||
|
|
||||||
|
androidize $D
|
||||||
|
|
||||||
|
echo "Creating zip $D"
|
||||||
|
{
|
||||||
|
cd ..
|
||||||
|
zip -r liblinphone-android-sdk.zip $DBASE
|
||||||
|
rm -rf $DBASE
|
||||||
|
}
|
||||||
|
|
||||||
|
javadoc -d liblinphone-android-javadoc src/org/linphone/*.java src/org/linphone/ui/*.java src/org/linphone/core/*.java src/org/linphone/core/video/*.java src/org/linphone/core/tutorials/* submodules/linphone/java/common/org/linphone/core/*.java submodules/linphone/java/j2se/org/linphone/core/*.java
|
||||||
|
rm -f ../liblinphone-android-javadoc.zip
|
||||||
zip -r ../liblinphone-android-javadoc.zip liblinphone-android-javadoc
|
zip -r ../liblinphone-android-javadoc.zip liblinphone-android-javadoc
|
||||||
rm -rf liblinphone-android-javadoc
|
rm -rf liblinphone-android-javadoc
|
||||||
|
|
|
@ -30,6 +30,7 @@ import static org.linphone.R.string.pref_codec_amr_key;
|
||||||
import static org.linphone.R.string.pref_codec_speex16_key;
|
import static org.linphone.R.string.pref_codec_speex16_key;
|
||||||
import static org.linphone.R.string.pref_codec_speex32_key;
|
import static org.linphone.R.string.pref_codec_speex32_key;
|
||||||
import static org.linphone.R.string.pref_echo_cancellation_key;
|
import static org.linphone.R.string.pref_echo_cancellation_key;
|
||||||
|
import static org.linphone.R.string.pref_video_enable_key;
|
||||||
import static org.linphone.core.LinphoneCall.State.CallEnd;
|
import static org.linphone.core.LinphoneCall.State.CallEnd;
|
||||||
import static org.linphone.core.LinphoneCall.State.Error;
|
import static org.linphone.core.LinphoneCall.State.Error;
|
||||||
import static org.linphone.core.LinphoneCall.State.IncomingReceived;
|
import static org.linphone.core.LinphoneCall.State.IncomingReceived;
|
||||||
|
@ -155,7 +156,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String TAG="Linphone";
|
public static final String TAG=Version.TAG;
|
||||||
private static final int LINPHONE_VOLUME_STREAM = STREAM_VOICE_CALL;
|
private static final int LINPHONE_VOLUME_STREAM = STREAM_VOICE_CALL;
|
||||||
private static final int dbStep = 4;
|
private static final int dbStep = 4;
|
||||||
/** Called when the activity is first created. */
|
/** Called when the activity is first created. */
|
||||||
|
@ -836,6 +837,10 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
.findPayloadType("AMR", 8000)!=null;
|
.findPayloadType("AMR", 8000)!=null;
|
||||||
e.putBoolean(getString(pref_codec_amr_key), amr);
|
e.putBoolean(getString(pref_codec_amr_key), amr);
|
||||||
|
|
||||||
|
if (Version.sdkStrictlyBelow(5) || !Version.hasNeon() || !LinphoneManager.getInstance().hasCamera()) {
|
||||||
|
e.putBoolean(getString(pref_video_enable_key), false);
|
||||||
|
}
|
||||||
|
|
||||||
e.commit();
|
e.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.core;
|
package org.linphone.core;
|
||||||
|
|
||||||
import org.linphone.LinphoneManager;
|
|
||||||
|
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -95,7 +93,7 @@ public final class Hacks {
|
||||||
//sb.append("MANUFACTURER=").append(Build.MANUFACTURER).append("\n");
|
//sb.append("MANUFACTURER=").append(Build.MANUFACTURER).append("\n");
|
||||||
sb.append("SDK=").append(Build.VERSION.SDK);
|
sb.append("SDK=").append(Build.VERSION.SDK);
|
||||||
|
|
||||||
Log.d(LinphoneManager.TAG, sb.toString());
|
Log.d(Version.TAG, sb.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean needSoftvolume() {
|
public static boolean needSoftvolume() {
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.linphone.core;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.linphone.LinphoneManager;
|
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
||||||
|
@ -31,7 +29,7 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
||||||
try {
|
try {
|
||||||
System.loadLibrary(s);
|
System.loadLibrary(s);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Log.w(LinphoneManager.TAG, "Unable to load optional library lib" + s);
|
Log.w(Version.TAG, "Unable to load optional library lib" + s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,12 @@ import android.os.Build;
|
||||||
* @author Guillaume Beraudo
|
* @author Guillaume Beraudo
|
||||||
*/
|
*/
|
||||||
public class Version {
|
public class Version {
|
||||||
|
|
||||||
|
public static final String TAG="Linphone";
|
||||||
|
|
||||||
private static native boolean nativeHasNeon();
|
private static native boolean nativeHasNeon();
|
||||||
|
private static Boolean hasNeon;
|
||||||
|
|
||||||
private static final int buildVersion =
|
private static final int buildVersion =
|
||||||
Integer.parseInt(Build.VERSION.SDK);
|
Integer.parseInt(Build.VERSION.SDK);
|
||||||
// 8; // 2.2
|
// 8; // 2.2
|
||||||
|
@ -51,7 +56,8 @@ public class Version {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public static boolean hasNeon(){
|
public static boolean hasNeon(){
|
||||||
return nativeHasNeon();
|
if (hasNeon == null) hasNeon = nativeHasNeon();
|
||||||
|
return hasNeon;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue