Skip to content
Snippets Groups Projects
Commit 3ee5a99c authored by Adrien Béraud's avatar Adrien Béraud
Browse files

ui: show activity when accepting call

Tuleap: #178
Change-Id: I3c3c65ad965644c00ce80b3edaef4b7aa1a66a14
parent 6c4cedba
Branches
Tags
No related merge requests found
...@@ -251,6 +251,12 @@ public class Conference { ...@@ -251,6 +251,12 @@ public class Conference {
messages.add(sipMessage); messages.add(sipMessage);
} }
public Intent getViewIntent(Context ctx)
{
final Uri conf_uri = Uri.withAppendedPath(CONTENT_URI, getId());
return new Intent(Intent.ACTION_VIEW).setData(conf_uri).setClass(ctx, CallActivity.class);
}
public void showCallNotification(Context ctx) public void showCallNotification(Context ctx)
{ {
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(ctx); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(ctx);
...@@ -260,11 +266,9 @@ public class Conference { ...@@ -260,11 +266,9 @@ public class Conference {
return; return;
SipCall call = getParticipants().get(0); SipCall call = getParticipants().get(0);
CallContact contact = call.getContact(); CallContact contact = call.getContact();
final Uri conf_uri = Uri.withAppendedPath(CONTENT_URI, getId());
final Uri call_uri = Uri.withAppendedPath(SipCall.CONTENT_URI, call.getCallId()); final Uri call_uri = Uri.withAppendedPath(SipCall.CONTENT_URI, call.getCallId());
PendingIntent goto_intent = PendingIntent.getActivity(ctx, new Random().nextInt(), PendingIntent goto_intent = PendingIntent.getActivity(ctx, new Random().nextInt(),
new Intent(Intent.ACTION_VIEW).setData(conf_uri).setClass(ctx, CallActivity.class), getViewIntent(ctx), PendingIntent.FLAG_ONE_SHOT);
PendingIntent.FLAG_ONE_SHOT);
NotificationCompat.Builder noti = new NotificationCompat.Builder(ctx); NotificationCompat.Builder noti = new NotificationCompat.Builder(ctx);
if (isOnGoing()) { if (isOnGoing()) {
......
...@@ -1140,6 +1140,9 @@ public class LocalService extends Service implements SharedPreferences.OnSharedP ...@@ -1140,6 +1140,9 @@ public class LocalService extends Service implements SharedPreferences.OnSharedP
e.printStackTrace(); e.printStackTrace();
} }
updateAudioState(); updateAudioState();
Conference conf = getConference(call_id);
if (!conf.mVisible)
startActivity(conf.getViewIntent(LocalService.this).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
break; break;
} }
case ACTION_CALL_REFUSE: { case ACTION_CALL_REFUSE: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment