Skip to content

Commit

Permalink
Update usage of crashOnMissingPermission parameter (#1141)
Browse files Browse the repository at this point in the history
  • Loading branch information
liviu-timar authored Jul 16, 2024
1 parent 2b66ebb commit 1591772
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ import java.net.ConnectException
* @property runForegroundServiceForCalls If set to true, when there is an active call the SDK will run a foreground service to keep the process alive. (default: true)
* @property localSfuAddress Local SFU address (IP:port) to be used for testing. Leave null if not needed.
* @property sounds Overwrite the default SDK sounds. See [Sounds].
* @property crashOnMissingPermission If [permissionCheck] returns false there will be an exception.
* @property permissionCheck Used to check for system permission based on call capabilities. See [StreamPermissionCheck].
* @property crashOnMissingPermission Throw an exception or just log an error if [permissionCheck] fails.
* @property audioUsage Used to signal to the system how to treat the audio tracks (voip or media).
*
* @see build
Expand All @@ -96,7 +96,7 @@ public class StreamVideoBuilder @JvmOverloads constructor(
private val runForegroundServiceForCalls: Boolean = true,
private val localSfuAddress: String? = null,
private val sounds: Sounds = Sounds(),
private val crashOnMissingPermission: Boolean = true,
private val crashOnMissingPermission: Boolean = false,
private val permissionCheck: StreamPermissionCheck = DefaultStreamPermissionCheck(),
private val audioUsage: Int = defaultAudioUsage,
) {
Expand Down Expand Up @@ -190,6 +190,7 @@ public class StreamVideoBuilder @JvmOverloads constructor(
testSfuAddress = localSfuAddress,
sounds = sounds,
permissionCheck = permissionCheck,
crashOnMissingPermission = crashOnMissingPermission,
audioUsage = audioUsage,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ internal class StreamVideoImpl internal constructor(
internal val runForegroundService: Boolean = true,
internal val testSfuAddress: String? = null,
internal val sounds: Sounds,
internal val crashOnMissingPermission: Boolean = true,
internal val permissionCheck: StreamPermissionCheck = DefaultStreamPermissionCheck(),
internal val crashOnMissingPermission: Boolean = false,
internal val audioUsage: Int = defaultAudioUsage,
) : StreamVideo, NotificationHandler by streamNotificationManager {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ internal class CallService : Service() {
if (streamVideo.crashOnMissingPermission) {
throw exception
} else {
logger.e(exception) { "Ensure you have right permissions!" }
logger.e(exception) { "Make sure all the required permissions are granted!" }
}
}

Expand Down

0 comments on commit 1591772

Please sign in to comment.