Skip to content

Commit e00c2ac

Browse files
committed
Android: v1.0.24 (added 'onCallVideoUpgradeRequested', 'acceptVideoUpgrade', UpgradeToVideoMode::Manual)
1 parent fb06a36 commit e00c2ac

File tree

4 files changed

+49
-15
lines changed

4 files changed

+49
-15
lines changed

siprix_voip_sdk_android/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 1.0.24
2+
- Updated upgradeToVideo implementation. Added new mode 'manual'
3+
- Added new event 'onCallVideoUpgradeRequested'
4+
Triggered when specified 'acc.upgradeToVideo=manual' and remote side requests to add video
5+
- Added new method 'acceptVideoUpgrade'
6+
App has invoke it from 'onCallVideoUpgradeRequested' event handler
7+
- Android: Added ability to disable displaying activity on lock screen by adding to manifest
8+
`<meta-data android:name="com.siprix.DontShowWhenLocked" android:value="true" />`
9+
//2025.11.16
10+
111
## 1.0.23
212
- Added new setting 'acc.upgradeToVideo' and event 'onCallVideoUpgraded'
313
//2025.11.07
3.65 KB
Binary file not shown.

siprix_voip_sdk_android/android/src/main/kotlin/com/siprix/voip_sdk/SiprixVoipSdkPlugin.kt

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ const val kMethodCallStopRecordFile = "Call_StopRecordFile"
9191
const val kMethodCallTransferBlind = "Call_TransferBlind"
9292
const val kMethodCallTransferAttended = "Call_TransferAttended"
9393
const val kMethodCallUpgradeToVideo = "Call_UpgradeToVideo"
94+
const val kMethodCallAcceptVideoUpgrade = "Call_AcceptVideoUpgrade"
9495
const val kMethodCallStopRingtone = "Call_StopRingtone"
9596
const val kMethodCallBye = "Call_Bye"
9697

@@ -136,6 +137,7 @@ const val kOnCallDtmfReceived = "OnCallDtmfReceived"
136137
const val kOnCallTransferred = "OnCallTransferred"
137138
const val kOnCallRedirected = "OnCallRedirected"
138139
const val kOnCallVideoUpgraded= "OnCallVideoUpgraded"
140+
const val kOnCallVideoUpgradeRequested= "OnCallVideoUpgradeRequested"
139141
const val kOnCallSwitched = "OnCallSwitched"
140142
const val kOnCallHeld = "OnCallHeld"
141143

@@ -305,6 +307,12 @@ class EventListener: ISiprixModelListener {
305307
channel?.invokeMethod(kOnCallVideoUpgraded, argsMap)
306308
}
307309

310+
override fun onCallVideoUpgradeRequested(callId: Int) {
311+
val argsMap = HashMap<String, Any?> ()
312+
argsMap[kArgCallId] = callId
313+
channel?.invokeMethod(kOnCallVideoUpgradeRequested, argsMap)
314+
}
315+
308316
override fun onCallHeld(callId: Int, state: SiprixCore.HoldState?) {
309317
val argsMap = HashMap<String, Any?> ()
310318
argsMap[kArgCallId] = callId
@@ -611,14 +619,23 @@ class SiprixVoipSdkPlugin: FlutterPlugin,
611619
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
612620
Log.i(TAG, "onDetachedFromEngine this:${this.hashCode()} binding:${binding.hashCode()}")
613621
}
622+
614623
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
615624
Log.i(TAG, "onAttachedToActivity this:${this.hashCode()}")
616625
binding.addOnNewIntentListener(this)
617626
_activity = binding.activity
618627
_core.setModelListener(_eventListener)
619628

620-
setActivityFlags(_activity)
621-
requestPermissions()
629+
//Get metadata
630+
val appInfo = _activity!!.packageManager.getApplicationInfo(_activity!!.packageName, PackageManager.GET_META_DATA)
631+
632+
//Request permission (if required)
633+
var skipPermissionRequest = appInfo.metaData?.getBoolean("com.siprix.SkipPermissionRequest")
634+
if(skipPermissionRequest != true) requestPermissions()
635+
636+
//Set activity attributes
637+
var dontShowWhenLocked = appInfo.metaData?.getBoolean("com.siprix.DontShowWhenLocked")
638+
setActivityFlags(_activity, dontShowWhenLocked)
622639
}
623640

624641
override fun onDetachedFromActivityForConfigChanges() {
@@ -721,6 +738,7 @@ class SiprixVoipSdkPlugin: FlutterPlugin,
721738
kMethodCallTransferBlind -> handleCallTransferBlind(args, result)
722739
kMethodCallTransferAttended -> handleCallTransferAttended(args, result)
723740
kMethodCallUpgradeToVideo -> handleCallUpgradeToVideo(args, result)
741+
kMethodCallAcceptVideoUpgrade -> handleCallAcceptVideoUpgrade(args, result)
724742
kMethodCallStopRingtone -> handleCallStopRingtone(args, result)
725743
kMethodCallBye -> handleCallBye(args, result)
726744

@@ -1291,6 +1309,18 @@ class SiprixVoipSdkPlugin: FlutterPlugin,
12911309
}
12921310
}
12931311

1312+
private fun handleCallAcceptVideoUpgrade(args : HashMap<String, Any?>, result: MethodChannel.Result) {
1313+
val callId : Int?= args[kArgCallId] as? Int
1314+
val withVideo :Boolean? = args[kArgWithVideo] as? Boolean
1315+
1316+
if((callId != null)&&(withVideo != null)) {
1317+
val err = _core.callAcceptVideoUpgrade(callId, withVideo)
1318+
sendResult(err, result)
1319+
}else{
1320+
sendBadArguments(result)
1321+
}
1322+
}
1323+
12941324
private fun handleCallBye(args : HashMap<String, Any?>, result: MethodChannel.Result) {
12951325
val callId = args[kArgCallId] as? Int
12961326

@@ -1578,11 +1608,6 @@ class SiprixVoipSdkPlugin: FlutterPlugin,
15781608
}
15791609

15801610
private fun requestPermissions() {
1581-
//Skip if manifest contains predefined tag
1582-
val applicationInfo = _activity!!.packageManager.getApplicationInfo(_activity!!.packageName, PackageManager.GET_META_DATA)
1583-
var skipPermissionRequest = applicationInfo.metaData?.getBoolean("com.siprix.SkipPermissionRequest")
1584-
if(skipPermissionRequest==true) return
1585-
15861611
//Add 'CAMERA' if manifest contains it
15871612
val permissions = mutableListOf(Manifest.permission.RECORD_AUDIO)
15881613
var info =_activity!!.packageManager.getPackageInfo(_activity!!.packageName, PackageManager.GET_PERMISSIONS)
@@ -1758,16 +1783,15 @@ class SiprixVoipSdkPlugin: FlutterPlugin,
17581783
}
17591784
}
17601785

1761-
private fun setActivityFlags(activity: Activity?) {
1786+
private fun setActivityFlags(activity: Activity?, dontShowWhenLocked: Boolean?) {
17621787
if(activity != null) {
17631788
if (Build.VERSION.SDK_INT < 27) {
1764-
activity.window.addFlags(
1765-
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
1766-
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
1767-
)
1789+
var flags = WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
1790+
if(dontShowWhenLocked != true) flags += WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
1791+
activity.window.addFlags(flags)
17681792
} else {
17691793
activity.setTurnScreenOn(true)
1770-
activity.setShowWhenLocked(true)
1794+
if(dontShowWhenLocked != true) activity.setShowWhenLocked(true)
17711795
}
17721796
}
17731797
}

siprix_voip_sdk_android/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Android implementation of the Siprix VoIP SDK plugin for embedding
33
homepage: https://siprix-voip.com
44
repository: https://github.com/siprix/FlutterPluginFederated/tree/main/siprix_voip_sdk_android
55
documentation: https://docs.siprix-voip.com
6-
version: 1.0.23
6+
version: 1.0.24
77

88
environment:
99
sdk: ^3.2.0
@@ -12,7 +12,7 @@ environment:
1212
dependencies:
1313
flutter:
1414
sdk: flutter
15-
siprix_voip_sdk_platform_interface: ^1.0.9
15+
siprix_voip_sdk_platform_interface: ^1.0.10
1616

1717
dev_dependencies:
1818
flutter_test:

0 commit comments

Comments
 (0)