Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
2ae7e6d3
Commit
2ae7e6d3
authored
1 month ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
DRingService: implement onTimeout
Change-Id: I99b7d1c41e8e6f055c062a4c9dbb8312d6815531
parent
1b7bdc7a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
jami-android/app/src/main/AndroidManifest.xml
+2
-2
2 additions, 2 deletions
jami-android/app/src/main/AndroidManifest.xml
jami-android/app/src/main/java/cx/ring/service/DRingService.kt
+15
-2
15 additions, 2 deletions
...android/app/src/main/java/cx/ring/service/DRingService.kt
with
17 additions
and
4 deletions
jami-android/app/src/main/AndroidManifest.xml
+
2
−
2
View file @
2ae7e6d3
...
...
@@ -48,7 +48,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE_MICROPHONE"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE_LOCATION"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE_DATA_SYNC"
/>
<!--
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING" />
-->
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE_PHONE_CALL"
/>
<uses-permission
android:name=
"com.android.providers.tv.permission.WRITE_EPG_DATA"
/>
...
...
@@ -332,7 +332,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<service
android:name=
".service.DRingService"
android:exported=
"false"
android:foregroundServiceType=
"dataSync"
>
android:foregroundServiceType=
"dataSync
|remoteMessaging
"
>
<intent-filter>
<action
android:name=
".service.DRingService"
/>
</intent-filter>
...
...
This diff is collapsed.
Click to expand it.
jami-android/app/src/main/java/cx/ring/service/DRingService.kt
+
15
−
2
View file @
2ae7e6d3
...
...
@@ -22,6 +22,7 @@ import android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
import
android.content.IntentFilter
import
android.content.pm.ServiceInfo
import
android.database.ContentObserver
import
android.net.*
import
android.net.ConnectivityManager.NetworkCallback
...
...
@@ -179,10 +180,22 @@ class DRingService : Service() {
private
fun
showSystemNotification
(
settings
:
Settings
)
{
try
{
if
(
settings
.
enablePermanentService
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
UPSIDE_DOWN_CAKE
)
{
startForeground
(
NOTIFICATION_ID
,
mNotificationService
.
serviceNotification
as
Notification
,
ServiceInfo
.
FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING
)
}
else
{
startForeground
(
NOTIFICATION_ID
,
mNotificationService
.
serviceNotification
as
Notification
)
}
}
else
{
stopForeground
(
true
)
stopForeground
(
STOP_FOREGROUND_REMOVE
)
}
}
catch
(
e
:
Exception
)
{
Log
.
e
(
TAG
,
"Can't start or stop foreground service: ${e.message}"
)
}
}
override
fun
onTimeout
(
startId
:
Int
,
fgsType
:
Int
)
{
try
{
stopForeground
(
STOP_FOREGROUND_REMOVE
)
}
catch
(
e
:
Exception
)
{
Log
.
e
(
TAG
,
"Can't start or stop foreground service: ${e.message}"
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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