Skip to content
Snippets Groups Projects
Commit cb2345cb authored by Alexandre Lision's avatar Alexandre Lision
Browse files

* #36284: integration of new fields in the android client.

parent baeeb215
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/button1"
android:textSize="12sp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/white" />
......@@ -48,8 +49,9 @@
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:background="#00000000"
android:background="@null"
android:src="@drawable/ic_action_dial_pad_light" />
</RelativeLayout>
<org.sflphone.model.BubblesView
......@@ -63,9 +65,9 @@
android:id="@+id/speaker_toggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@drawable/toggle_speaker_selector"
android:textOn=""
android:textOff=""
android:textOn="" />
android:background="@drawable/toggle_speaker_selector"
android:layout_alignParentBottom="true" />
</RelativeLayout>
\ No newline at end of file
......@@ -393,7 +393,8 @@ public class CallFragment extends Fragment implements Callback {
return contact_bubble;
}
contact_bubble = new BubbleUser(getActivity(), CallContact.ContactBuilder.buildUserContact(getActivity().getContentResolver()), conf, x, y, BUBBLE_SIZE * 1.3f);
contact_bubble = new BubbleUser(getActivity(), CallContact.ContactBuilder.buildUserContact(getActivity().getContentResolver()), conf, x, y,
BUBBLE_SIZE * 1.3f);
try {
((BubbleUser) contact_bubble).setMute(mCallbacks.getService().isCaptureMuted());
......@@ -406,15 +407,6 @@ public class CallFragment extends Fragment implements Callback {
return contact_bubble;
}
/**
* Should be called when a bubble is removed from the model
*/
void bubbleRemoved(Bubble b) {
// if (b.associated_call == null) {
// return;
// }
}
public void changeCallState(String callID, String newState) {
Log.i(TAG, "Call :" + callID + " " + newState);
if (newState.contentEquals("FAILURE")) {
......@@ -552,6 +544,10 @@ public class CallFragment extends Fragment implements Callback {
}
public void updateCodecName(String currentAudioCodecName) {
// In case of multiple codecs in the String
if (currentAudioCodecName.indexOf(' ') > 0)
codecNameTxt.setText(currentAudioCodecName.subSequence(0, currentAudioCodecName.indexOf(' ')));
else
codecNameTxt.setText(currentAudioCodecName);
}
}
......@@ -236,10 +236,11 @@ public class DetailsHistoryEntryFragment extends Fragment {
final HistoryCall item = dataset.get(position);
entryView.historyCallState.setText(item.getState());
entryView.historyCallState.setText(item.getDirection());
entryView.formatted_date.setText(item.getDate());
// entryView.displayName.setText(item.getDisplayName());
entryView.duration.setText(item.getDurationString());
if(item.isIncoming() && item.isMissed())
convertView.setBackgroundColor(getResources().getColor(R.color.holo_red_light));
if (item.hasRecord()) {
entryView.record.setVisibility(View.VISIBLE);
......
......@@ -95,7 +95,6 @@ public class BubbleModel {
}
Bubble b = bubbles.get(i);
if (b.markedToDie) {
continue;
}
......@@ -106,7 +105,7 @@ public class BubbleModel {
Attractor attractor = null;
PointF attractor_pos = b.attractor;
float attractor_dist = (attractor_pos.x - bx) * (attractor_pos.x - bx) + (attractor_pos.y - by) * (attractor_pos.x - by);
float attractor_dist = (attractor_pos.x - bx) * (attractor_pos.x - bx) + (attractor_pos.y - by) * (attractor_pos.y - by);
for (int j = 0; j < attr_n; j++) {
try {
......@@ -173,7 +172,6 @@ public class BubbleModel {
// Log.w(TAG, "update dx="+dt+" dy="+dy);
b.setPos((float) (bx + dx), (float) (by + dy));
// Log.i(TAG,"Model:");
if (attractor != null && attractor_dist < attractor_dist_suck * attractor_dist_suck) {
b.dragged = false;
if (attractor.callback.onBubbleSucked(b)) {
......
......@@ -81,12 +81,10 @@ public class HistoryEntry implements Parcelable {
public void addHistoryCall(HistoryCall historyCall) {
calls.put(historyCall.call_start, historyCall);
if (historyCall.getState().contentEquals(ServiceConstants.history.MISSED_STRING)) {
++missed_sum;
} else if (historyCall.getState().contentEquals(ServiceConstants.history.INCOMING_STRING)) {
++incoming_sum;
} else {
if (historyCall.getDirection().contentEquals(ServiceConstants.history.OUTGOING_STRING)) {
++outgoing_sum;
} else if (historyCall.isIncoming()) {
++incoming_sum;
}
}
......@@ -175,7 +173,9 @@ public class HistoryEntry implements Parcelable {
long call_end;
String number;
String state;
boolean missed;
String direction;
String recordPath;
String timeFormatted;
String displayName;
......@@ -183,13 +183,20 @@ public class HistoryEntry implements Parcelable {
public HistoryCall(HashMap<String, String> entry) {
call_end = Long.parseLong(entry.get(ServiceConstants.history.TIMESTAMP_STOP_KEY));
call_start = Long.parseLong(entry.get(ServiceConstants.history.TIMESTAMP_START_KEY));
state = entry.get(ServiceConstants.history.STATE_KEY);
direction = entry.get(ServiceConstants.history.DIRECTION_KEY);
missed = entry.get(ServiceConstants.history.MISSED_KEY).contentEquals("true");
displayName = entry.get(ServiceConstants.history.DISPLAY_NAME_KEY);
recordPath = entry.get(ServiceConstants.history.RECORDING_PATH_KEY);
number = entry.get(ServiceConstants.history.PEER_NUMBER_KEY);
timeFormatted = HistoryManager.timeToHistoryConst(call_start);
}
public String getDirection() {
return direction;
}
public String getDate() {
return timeFormatted;
}
......@@ -224,10 +231,6 @@ public class HistoryEntry implements Parcelable {
return displayName;
}
public String getState() {
return state;
}
@Override
public int describeContents() {
return 0;
......@@ -238,7 +241,8 @@ public class HistoryEntry implements Parcelable {
dest.writeLong(call_start);
dest.writeLong(call_end);
dest.writeString(number);
dest.writeString(state);
dest.writeByte((byte) (missed ? 1 : 0));
dest.writeString(direction);
dest.writeString(recordPath);
dest.writeString(timeFormatted);
dest.writeString(displayName);
......@@ -258,7 +262,8 @@ public class HistoryEntry implements Parcelable {
call_start = in.readLong();
call_end = in.readLong();
number = in.readString();
state = in.readString();
missed = in.readByte() == 1 ? true : false;
direction = in.readString();
recordPath = in.readString();
timeFormatted = in.readString();
displayName = in.readString();
......@@ -268,6 +273,14 @@ public class HistoryEntry implements Parcelable {
return recordPath.length() > 0;
}
public boolean isIncoming() {
return direction.contentEquals(ServiceConstants.history.INCOMING_STRING);
}
public boolean isMissed() {
return missed;
}
}
}
......@@ -12,7 +12,11 @@ public final class ServiceConstants {
public static final String DISPLAY_NAME_KEY = "display_name";
public static final String PEER_NUMBER_KEY = "peer_number";
public static final String RECORDING_PATH_KEY = "recordfile";
public static final String STATE_KEY = "state";
// New fields
public static final String MISSED_KEY = "missed";
public static final String DIRECTION_KEY = "direction";
public static final String TIMESTAMP_START_KEY = "timestamp_start";
public static final String TIMESTAMP_STOP_KEY = "timestamp_stop";
public static final String AUDIO_CODEC_KEY = "audio_codec";
......
......@@ -1099,7 +1099,7 @@ public class SipService extends Service {
//
// @Override
// protected StringVect doRun() throws SameThreadException {
// Log.i(TAG, "SipService.getCallList() thread running...");
// Log.i(TAG, "SipService.getCallList() thread running...incoming");
// return callManagerJNI.getCallList();
// }
// }
......
......@@ -66,11 +66,15 @@ public class SwigNativeConverter {
entry.put(ServiceConstants.history.DISPLAY_NAME_KEY, tryToGet(swigmap.get(i), ServiceConstants.history.DISPLAY_NAME_KEY));
entry.put(ServiceConstants.history.PEER_NUMBER_KEY, tryToGet(swigmap.get(i), ServiceConstants.history.PEER_NUMBER_KEY));
entry.put(ServiceConstants.history.RECORDING_PATH_KEY, tryToGet(swigmap.get(i), ServiceConstants.history.RECORDING_PATH_KEY));
entry.put(ServiceConstants.history.STATE_KEY, tryToGet(swigmap.get(i), ServiceConstants.history.STATE_KEY));
entry.put(ServiceConstants.history.DIRECTION_KEY, tryToGet(swigmap.get(i), ServiceConstants.history.DIRECTION_KEY));
entry.put(ServiceConstants.history.MISSED_KEY, tryToGet(swigmap.get(i), ServiceConstants.history.MISSED_KEY));
entry.put(ServiceConstants.history.TIMESTAMP_START_KEY, tryToGet(swigmap.get(i), ServiceConstants.history.TIMESTAMP_START_KEY));
entry.put(ServiceConstants.history.TIMESTAMP_STOP_KEY, tryToGet(swigmap.get(i), ServiceConstants.history.TIMESTAMP_STOP_KEY));
entry.put(ServiceConstants.history.AUDIO_CODEC_KEY, tryToGet(swigmap.get(i), ServiceConstants.history.AUDIO_CODEC_KEY));
if(entry.get(ServiceConstants.history.DIRECTION_KEY).isEmpty())
continue;
nativemap.add(entry);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment