Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
linphone-android
Commits
541d3d98
Commit
541d3d98
authored
4 months ago
by
Sylvain Berfini
Browse files
Options
Download
Patches
Plain Diff
Added wake lock at startup
parent
823b88b9
test/UZ-8-no-telecom
feature/5.3
feature/UZ-8
No related merge requests found
Pipeline
#84680
passed with stage
in 5 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/org/linphone/LinphoneApplication.kt
+17
-0
app/src/main/java/org/linphone/LinphoneApplication.kt
with
17 additions
and
0 deletions
app/src/main/java/org/linphone/LinphoneApplication.kt
+
17
−
0
View file @
541d3d98
...
...
@@ -22,6 +22,7 @@ package org.linphone
import
android.annotation.SuppressLint
import
android.app.Application
import
android.content.Context
import
android.os.PowerManager
import
coil.ImageLoader
import
coil.ImageLoaderFactory
import
coil.decode.GifDecoder
...
...
@@ -47,6 +48,13 @@ class LinphoneApplication : Application(), ImageLoaderFactory {
return
}
val
powerManager
=
context
.
getSystemService
(
POWER_SERVICE
)
as
PowerManager
val
wakeLock
=
powerManager
.
newWakeLock
(
PowerManager
.
PARTIAL_WAKE_LOCK
,
"Linphone:AppCreation"
)
wakeLock
.
acquire
(
20000L
)
// 20 seconds
Factory
.
instance
().
setLogCollectionPath
(
context
.
filesDir
.
absolutePath
)
Factory
.
instance
().
enableLogCollection
(
LogCollectionState
.
Enabled
)
...
...
@@ -74,6 +82,7 @@ class LinphoneApplication : Application(), ImageLoaderFactory {
}
Log
.
i
(
"[Application] Core config & preferences created"
)
wakeLock
.
release
()
}
fun
ensureCoreExists
(
...
...
@@ -88,6 +97,13 @@ class LinphoneApplication : Application(), ImageLoaderFactory {
return
false
}
val
powerManager
=
context
.
getSystemService
(
POWER_SERVICE
)
as
PowerManager
val
wakeLock
=
powerManager
.
newWakeLock
(
PowerManager
.
PARTIAL_WAKE_LOCK
,
"Linphone:EnsureCoreExists"
)
wakeLock
.
acquire
(
20000L
)
// 20 seconds
Log
.
i
(
"[Application] Core context is being created ${if (pushReceived) "
from
push
" else ""}"
)
...
...
@@ -100,6 +116,7 @@ class LinphoneApplication : Application(), ImageLoaderFactory {
if
(!
skipCoreStart
)
{
coreContext
.
start
()
}
wakeLock
.
release
()
return
true
}
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets