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
2dec5414
Commit
2dec5414
authored
5 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
notifications: fix crash
Change-Id: I8e51e2ca92cdd79c7be314af72cbe137f054d015
parent
ed9feeb4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ring-android/app/build.gradle
+2
-2
2 additions, 2 deletions
ring-android/app/build.gradle
ring-android/app/src/main/java/cx/ring/services/NotificationServiceImpl.java
+7
-11
7 additions, 11 deletions
...c/main/java/cx/ring/services/NotificationServiceImpl.java
with
9 additions
and
13 deletions
ring-android/app/build.gradle
+
2
−
2
View file @
2dec5414
...
...
@@ -8,8 +8,8 @@ android {
defaultConfig
{
minSdkVersion
21
targetSdkVersion
29
versionCode
17
3
versionName
"2019070
4
-01"
versionCode
17
4
versionName
"2019070
6
-01"
}
sourceSets
{
...
...
This diff is collapsed.
Click to expand it.
ring-android/app/src/main/java/cx/ring/services/NotificationServiceImpl.java
+
7
−
11
View file @
2dec5414
...
...
@@ -207,7 +207,6 @@ public class NotificationServiceImpl implements NotificationService {
}
SipCall
call
=
conference
.
getParticipants
().
get
(
0
);
CallContact
contact
=
call
.
getContact
();
final
int
notificationId
=
call
.
getCallId
().
hashCode
();
notificationManager
.
cancel
(
notificationId
);
...
...
@@ -227,8 +226,8 @@ public class NotificationServiceImpl implements NotificationService {
return
;
}
NotificationCompat
.
Builder
messageNotificationBuilder
=
null
;
CallContact
contact
=
call
.
getContact
()
;
NotificationCompat
.
Builder
messageNotificationBuilder
;
if
(
conference
.
isOnGoing
())
{
messageNotificationBuilder
=
new
NotificationCompat
.
Builder
(
mContext
,
NOTIF_CHANNEL_CALL_IN_PROGRESS
);
messageNotificationBuilder
.
setContentTitle
(
mContext
.
getString
(
R
.
string
.
notif_current_call_title
,
contact
.
getDisplayName
()))
...
...
@@ -247,7 +246,6 @@ public class NotificationServiceImpl implements NotificationService {
}
else
if
(
conference
.
isRinging
())
{
if
(
conference
.
isIncoming
())
{
messageNotificationBuilder
=
new
NotificationCompat
.
Builder
(
mContext
,
NOTIF_CHANNEL_INCOMING_CALL
);
Bundle
extras
=
new
Bundle
();
messageNotificationBuilder
.
setContentTitle
(
mContext
.
getString
(
R
.
string
.
notif_incoming_call_title
,
contact
.
getDisplayName
()))
.
setPriority
(
NotificationCompat
.
PRIORITY_MAX
)
.
setContentText
(
mContext
.
getText
(
R
.
string
.
notif_incoming_call
))
...
...
@@ -264,8 +262,7 @@ public class NotificationServiceImpl implements NotificationService {
new
Intent
(
DRingService
.
ACTION_CALL_ACCEPT
)
.
setClass
(
mContext
,
DRingService
.
class
)
.
putExtra
(
KEY_CALL_ID
,
call
.
getCallId
()),
PendingIntent
.
FLAG_ONE_SHOT
))
.
addExtras
(
extras
);
PendingIntent
.
FLAG_ONE_SHOT
));
}
else
{
messageNotificationBuilder
=
new
NotificationCompat
.
Builder
(
mContext
,
NOTIF_CHANNEL_CALL_IN_PROGRESS
);
messageNotificationBuilder
.
setContentTitle
(
mContext
.
getString
(
R
.
string
.
notif_outgoing_call_title
,
contact
.
getDisplayName
()))
...
...
@@ -273,6 +270,8 @@ public class NotificationServiceImpl implements NotificationService {
.
setPriority
(
NotificationCompat
.
PRIORITY_DEFAULT
)
.
setContentIntent
(
gotoIntent
)
.
setSound
(
null
)
.
setColorized
(
true
)
.
setColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
color_primary_light
))
.
addAction
(
R
.
drawable
.
baseline_call_end_24
,
mContext
.
getText
(
R
.
string
.
action_call_hangup
),
PendingIntent
.
getService
(
mContext
,
random
.
nextInt
(),
new
Intent
(
DRingService
.
ACTION_CALL_END
)
...
...
@@ -280,6 +279,8 @@ public class NotificationServiceImpl implements NotificationService {
.
putExtra
(
KEY_CALL_ID
,
call
.
getCallId
()),
PendingIntent
.
FLAG_ONE_SHOT
));
}
}
else
{
return
;
}
messageNotificationBuilder
.
setOngoing
(
true
)
...
...
@@ -287,12 +288,7 @@ public class NotificationServiceImpl implements NotificationService {
.
setSmallIcon
(
R
.
drawable
.
ic_ring_logo_white
);
setContactPicture
(
contact
,
messageNotificationBuilder
);
messageNotificationBuilder
.
setColor
(
ResourcesCompat
.
getColor
(
mContext
.
getResources
(),
R
.
color
.
color_primary_dark
,
null
));
notificationManager
.
notify
(
notificationId
,
messageNotificationBuilder
.
build
());
mNotificationBuilders
.
put
(
notificationId
,
messageNotificationBuilder
);
}
@Override
...
...
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