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
7a46f543
Commit
7a46f543
authored
12 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#15737: Add static CallInfo class in SipCall, used to retreive the call
parent
5da677da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/com/savoirfairelinux/sflphone/client/ContactListFragment.java
+11
-10
11 additions, 10 deletions
...savoirfairelinux/sflphone/client/ContactListFragment.java
src/com/savoirfairelinux/sflphone/client/SipCall.java
+21
-11
21 additions, 11 deletions
src/com/savoirfairelinux/sflphone/client/SipCall.java
with
32 additions
and
21 deletions
src/com/savoirfairelinux/sflphone/client/ContactListFragment.java
+
11
−
10
View file @
7a46f543
...
...
@@ -72,6 +72,7 @@ import com.savoirfairelinux.sflphone.R;
public
class
ContactListFragment
extends
ListFragment
implements
OnQueryTextListener
,
LoaderManager
.
LoaderCallbacks
<
Cursor
>
{
final
String
TAG
=
"ConatctListFragment"
;
ContactElementAdapter
mAdapter
;
String
mCurFilter
;
...
...
@@ -210,16 +211,16 @@ public class ContactListFragment extends ListFragment implements OnQueryTextList
public
void
onListItemClick
(
ListView
l
,
View
v
,
int
position
,
long
id
)
{
// Insert desired behavior here.
S
tring
displayName
=
(
String
)
((
TextView
)
v
.
findViewById
(
R
.
id
.
display_name
)).
getText
();
String
phoneNumber
=
(
String
)
((
TextView
)
v
.
findViewById
(
R
.
id
.
phones
)).
getText
();
Log
.
i
(
"ContactListFragment"
,
"Contact clicked: "
+
displayName
+
", Phone number: "
+
phoneNumber
);
/*
SipCall call = SipCall.getCallInstance(contact);
Log.i("ConatctListFragment", "OK"
);
Log.i(
"ContactListFragment"
, "Number of calls " + SipCall.getNbCalls());
mManager.callmanagerJNI.placeCall("IP2IP", "CALL1234", "192.168.40.35"
);
*/
S
ipCall
.
CallInfo
callInfo
=
new
SipCall
.
CallInfo
();
callInfo
.
mDisplayName
=
(
String
)
((
TextView
)
v
.
findViewById
(
R
.
id
.
display_name
)).
getText
();
callInfo
.
mPhone
=
(
String
)
((
TextView
)
v
.
findViewById
(
R
.
id
.
phones
)).
getText
(
);
Log
.
i
(
TAG
,
"Contact clicked: "
+
callInfo
.
mDisplayName
+
", Phone number: "
+
callInfo
.
mPhone
);
SipCall
call
=
SipCall
.
getCallInstance
(
callInfo
);
Log
.
i
(
TAG
,
"Number of calls "
+
SipCall
.
getNbCalls
());
call
.
placeCall
(
);
// mManager.callmanagerJNI.placeCall("IP2IP", "CALL1234", "192.168.40.35");
}
@Override
...
...
This diff is collapsed.
Click to expand it.
src/com/savoirfairelinux/sflphone/client/SipCall.java
+
21
−
11
View file @
7a46f543
...
...
@@ -37,37 +37,47 @@ public class SipCall
{
final
static
String
TAG
=
"SipCall"
;
static
ArrayList
<
SipCall
>
CallList
=
new
ArrayList
<
SipCall
>();
CallContact
mContact
;
CallElementList
mCallElementList
;
public
CallInfo
mCallInfo
;
public
static
class
CallInfo
{
public
String
mDisplayName
=
""
;
public
String
mPhone
=
""
;
public
String
mEmail
=
""
;
}
public
SipCall
()
{
mContact
=
null
;
CallList
.
add
(
this
);
mCallInfo
=
new
CallInfo
();
}
public
SipCall
(
Call
Contact
contact
)
public
SipCall
(
Call
Info
info
)
{
mContact
=
contact
;
CallList
.
add
(
this
);
mCallInfo
=
info
;
}
protected
void
finalize
()
throws
Throwable
{
CallList
.
remove
(
this
);
CallList
.
remove
(
this
);
}
public
static
SipCall
getCallInstance
(
Call
Contact
contact
)
public
static
SipCall
getCallInstance
(
Call
Info
info
)
{
if
(
CallList
.
isEmpty
())
return
new
SipCall
(
contact
);
return
new
SipCall
(
info
);
for
(
SipCall
sipcall
:
CallList
)
{
if
(
sipcall
.
mContact
.
getDisplayName
().
equals
(
contact
.
getDisplayName
()))
{
return
sipcall
;
if
(
sipcall
.
mCallInfo
.
mDisplayName
.
equals
(
info
.
mDisplayName
))
{
if
(
sipcall
.
mCallInfo
.
mPhone
.
equals
(
info
.
mPhone
))
{
return
sipcall
;
}
}
}
return
new
SipCall
(
contact
);
return
new
SipCall
(
info
);
}
public
static
int
getNbCalls
()
...
...
@@ -77,7 +87,7 @@ public class SipCall
public
void
placeCall
()
{
}
public
void
answer
()
...
...
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