Skip to content

Commit

Permalink
6.5
Browse files Browse the repository at this point in the history
    * Android 14 compatibility
    * Rejects incoming SIP calls during ongoing PSTN call
  • Loading branch information
pmerle committed Jul 1, 2024
1 parent ef15c6d commit 72b2523
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 14 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
defaultConfig {
applicationId "org.sipdroid.sipua"
minSdkVersion 16
targetSdkVersion 31
targetSdkVersion 33
}

buildTypes {
Expand All @@ -28,4 +28,5 @@ android {
path 'src/main/jni/Android.mk'
}
}
namespace 'org.sipdroid.sipua'
}
9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
/////////////////////////////////////////////////////////////////////
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.sipdroid.sipua"
android:versionName="6.3 beta"
android:versionCode="136"
android:versionName="6.5"
android:versionCode="146"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="31"/>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="33"/>
<supports-screens
android:normalScreens="true"
android:smallScreens="true"
Expand Down Expand Up @@ -159,7 +158,9 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"></uses-permission>
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"></uses-permission>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"></uses-permission>
<uses-permission android:name="android.permission.USE_EXACT_ALARM"></uses-permission>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"></uses-permission>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"></uses-permission>
<!--
<permission android:name="org.sipdroid.sipua.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="org.sipdroid.sipua.permission.C2D_MESSAGE" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/sipdroid/codecs/Codecs.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class Codecs {
add(new alaw());
add(new ulaw());
add(new Speex());
add(new GSM());
// add(new GSM()); due to a bug in clang this can't be compiled since 12/2023
add(new BV16());
}};
private static final HashMap<Integer, Codec> codecsNumbers;
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/org/sipdroid/sipua/UserAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ public void onCallIncoming(Call call, NameAddress callee,
if (ua == this) break;
i++;
}
if (Receiver.call_state != UA_STATE_IDLE || !Receiver.isFast(i)) {
if (Receiver.call_state != UA_STATE_IDLE || (Receiver.pstn_state != null &&
!Receiver.pstn_state.equals("IDLE")) || !Receiver.isFast(i)) {
call.busy();
listen();
return;
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/org/sipdroid/sipua/ui/Receiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,8 @@ public static void onText(int type,String text,int mInCallResId,long base) {
else if (type >= REGISTER_NOTIFICATION)
type = alloc(type);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && Receiver.sContext != null && type == REGISTER_NOTIFICATION) {
System.out.println("startForeground "+type);
Receiver.sContext.startForeground(type, notification);
} else {
System.out.println("notify " + type);
mNotificationMgr.notify(type, notification);
}
} else {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/org/sipdroid/sipua/ui/Sipdroid.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public void onStart() {
Manifest.permission.WRITE_CONTACTS,
Manifest.permission.WRITE_CALL_LOG,
Manifest.permission.RECORD_AUDIO,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.POST_NOTIFICATIONS,
null
};
if (Integer.parseInt(Build.VERSION.SDK) >= 31)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/zoolu/net/TcpSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class TcpSocket {
/** Creates a new UdpSocket */
public TcpSocket(IpAddress ipaddr, int port, String host) throws java.io.IOException {
// socket = new Socket(ipaddr.getInetAddress(), port); modified
SSLSocketFactory f =
SSLSocketFactory f =
(SSLSocketFactory) SSLSocketFactory.getSocketFactory();
if (host == null)
socket = new Socket();
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ APP_MODULES += silkcommon
#APP_MODULES += silk16_jni
#APP_MODULES += silk24_jni
APP_MODULES += g722_jni
APP_MODULES += gsm_jni
#APP_MODULES += gsm_jni

APP_OPTIM := release
APP_CFLAGS += -O3
APP_ABI := armeabi-v7a arm64-v8a
APP_ABI := arm64-v8a armeabi-v7a
APP_PLATFORM := android-11
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<string name="permhelp">Sipdroid never stores or transfers any personal data, such as call logs or phone numbers. Please allow access to:
\n\nTelephone: If you deny, Sipdroid will not be able to proxy calls made through the OS dialer to Voice-over-IP.
\n\nContacts: For displaying their names in Sipdroid\'s call screen.
\n\nContact list: For displaying contact names in Sipdroid\'s call screen.
\n\nMicrophone: If you deny, calls will be unidirectional. The other party won\'t hear you.</string>
<string name="reg">Registering...</string>
<string name="regpref">Preferred</string>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.android.tools.build:gradle:8.2.0'
}
}

Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false

0 comments on commit 72b2523

Please sign in to comment.