mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-18 20:08:08 +00:00
Merge remote-tracking branch 'private/3.0.X' into obiane
Conflicts: AndroidManifest.xml res/drawable/status_level.xml res/layout/call.xml res/layout/chat.xml res/layout/chat_bubble_outgoing.xml res/layout/contact_control_row.xml res/layout/search_contact_cell.xml res/values/strings.xml src/org/linphone/CallActivity.java src/org/linphone/ChatFragment.java src/org/linphone/ContactDetailsFragment.java src/org/linphone/LinphoneService.java
This commit is contained in:
commit
410f168acf
32 changed files with 451 additions and 332 deletions
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true"/>
|
||||
|
||||
<application android:label="@string/app_name" android:icon="@drawable/logo_secure_phone" android:largeHeap="true" android:allowBackup="true">
|
||||
<application android:label="@string/app_name" android:icon="@drawable/linphone_logo" android:largeHeap="true" android:allowBackup="true">
|
||||
|
||||
<activity android:name="org.linphone.LinphoneLauncherActivity"
|
||||
android:label="@string/app_name"
|
||||
|
|
|
|||
BIN
res/drawable-xhdpi/linphone_logo.png
Normal file
BIN
res/drawable-xhdpi/linphone_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:maxLevel="0" android:drawable="@drawable/logo_secure_phone" />
|
||||
<item android:maxLevel="0" android:drawable="@drawable/linphone_logo" />
|
||||
<item android:maxLevel="1" android:drawable="@drawable/status_green" />
|
||||
<item android:maxLevel="2" android:drawable="@drawable/status_red" />
|
||||
<item android:maxLevel="3" android:drawable="@drawable/status_offline" />
|
||||
|
|
|
|||
|
|
@ -105,8 +105,6 @@
|
|||
android:paddingRight="10dp"
|
||||
android:singleLine="true"/>
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/assistant_apply"
|
||||
android:text="@string/assistant_login"
|
||||
|
|
|
|||
|
|
@ -61,22 +61,6 @@
|
|||
android:orientation="vertical">
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/active_call"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/calls_list"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar_big"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/active_call_info"
|
||||
android:background="@color/colorG"
|
||||
|
|
|
|||
|
|
@ -86,24 +86,26 @@
|
|||
android:id="@+id/sendPicture"
|
||||
android:padding="15dp"
|
||||
android:scaleType="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/chat_send_file" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sendMessage"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/chat_send_file" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sendMessage"
|
||||
android:gravity="center"
|
||||
android:padding="15dp"
|
||||
android:scaleType="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/chat_send_message"
|
||||
android:layout_alignTop="@+id/message"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
<EditText
|
||||
|
||||
<EditText
|
||||
android:imeOptions="flagNoExtractUi"
|
||||
android:textCursorDrawable="@null"
|
||||
android:id="@+id/message"
|
||||
android:imeOptions="flagNoExtractUi"
|
||||
android:textCursorDrawable="@null"
|
||||
|
|
@ -138,7 +140,7 @@
|
|||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/remoteComposing"
|
||||
android:text="@string/remote_composing"
|
||||
|
|
@ -155,27 +157,24 @@
|
|||
android:stackFromBottom="true"
|
||||
android:transcriptMode="alwaysScroll"
|
||||
android:cacheColorHint="@color/transparent"
|
||||
android:dividerHeight="10dp"
|
||||
android:layout_above="@id/remoteComposing"
|
||||
android:dividerHeight="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_below="@+id/top_bar"/>
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:contentDescription="@string/content_description_search"
|
||||
android:textCursorDrawable="@null"
|
||||
android:visibility="gone"
|
||||
android:layout_margin="10dp"
|
||||
android:id="@+id/searchContactField"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:textColor="@color/colorC"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:gravity="center"
|
||||
android:completionThreshold="1"
|
||||
android:layout_below="@+id/top_bar"
|
||||
android:paddingRight="5dp"
|
||||
android:inputType="textPersonName"/>
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/searchContactField"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:hint="@string/search"
|
||||
android:inputType="textPersonName"
|
||||
android:completionThreshold="1"
|
||||
android:textCursorDrawable="@null"
|
||||
android:visibility="gone"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_below="@id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:paddingRight="5dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
@ -41,8 +41,7 @@
|
|||
android:visibility="gone"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:scaleType="center"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="centerInside"
|
||||
android:maxWidth="250dp"
|
||||
android:maxHeight="250dp" />
|
||||
|
||||
|
|
@ -55,8 +54,10 @@
|
|||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="200dp"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="5dp"/>
|
||||
|
||||
<Button
|
||||
|
|
@ -80,12 +81,13 @@
|
|||
android:id="@+id/delete"
|
||||
android:button="@drawable/checkbox"
|
||||
android:contentDescription="@string/content_description_delete"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -1,13 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/bubble"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/delete"
|
||||
android:button="@drawable/checkbox"
|
||||
android:contentDescription="@string/content_description_delete"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toLeftOf="@id/delete"
|
||||
android:background="@drawable/resizable_chat_bubble_outgoing"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
|
|
@ -39,10 +52,8 @@
|
|||
android:visibility="gone"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:scaleType="center"
|
||||
android:layout_centerInParent="true"
|
||||
android:maxWidth="250dp"
|
||||
android:maxHeight="250dp" />
|
||||
android:scaleType="centerInside"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/imageLayout"
|
||||
|
|
@ -53,8 +64,10 @@
|
|||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="200dp"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="5dp"/>
|
||||
|
||||
<Button
|
||||
|
|
@ -65,7 +78,6 @@
|
|||
android:contentDescription="@string/content_description_validate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_below="@id/progress_bar"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
@ -77,6 +89,7 @@
|
|||
android:contentDescription="@string/content_description_message_status"
|
||||
android:visibility="invisible"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:layout_gravity="top|right"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
|
|
@ -92,16 +105,4 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/delete"
|
||||
android:button="@drawable/checkbox"
|
||||
android:contentDescription="@string/content_description_delete"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
|||
38
res/layout/conference_paused_row.xml
Normal file
38
res/layout/conference_paused_row.xml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="@color/colorA"
|
||||
android:alpha="0.5"
|
||||
android:layout_height="60dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/conference_start"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contact_name"
|
||||
android:text="@string/conference"
|
||||
style="@style/font14"
|
||||
android:singleLine="true"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|left"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="10dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/call_pause"
|
||||
android:src="@drawable/pause_small_over_selected"
|
||||
android:contentDescription="@string/content_description_pause"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center_vertical"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/call"
|
||||
android:id="@+id/contact_call"
|
||||
android:src="@drawable/call_start_button"
|
||||
android:contentDescription="@string/content_description_dial_back"
|
||||
android:layout_width="60dp"
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
android:layout_centerInParent="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/chat"
|
||||
android:id="@+id/contact_chat"
|
||||
android:src="@drawable/chat_start_button"
|
||||
android:contentDescription="@string/content_description_chat"
|
||||
android:layout_width="60dp"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_height="60dp"
|
||||
android:padding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@color/colorG"
|
||||
android:orientation="vertical" >
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
<string name="about">About</string>
|
||||
<string name="deny">Deny</string>
|
||||
<string name="no_account">No account configured</string>
|
||||
<string name="search">Search</string>
|
||||
<string name="address_sip">Address Sip</string>
|
||||
|
||||
<!-- splashscreen -->
|
||||
|
|
|
|||
|
|
@ -343,6 +343,7 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
|
|||
delete.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
mPrefs.deleteAccount(n);
|
||||
LinphoneActivity.instance().refreshAccounts();
|
||||
LinphoneActivity.instance().displaySettings();
|
||||
return true;
|
||||
}
|
||||
|
|
@ -447,6 +448,7 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
|
|||
delete.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
mPrefs.deleteAccount(n);
|
||||
LinphoneActivity.instance().refreshAccounts();
|
||||
LinphoneActivity.instance().displaySettings();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1450,27 +1450,29 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
|
||||
private void displayPausedCalls(Resources resources, final LinphoneCall call, int index) {
|
||||
LinphoneAddress lAddress = call.getRemoteAddress();
|
||||
|
||||
// Control Row
|
||||
LinearLayout callView = (LinearLayout) inflater.inflate(R.layout.call_inactive_row, container, false);
|
||||
callView.setId(index+1);
|
||||
|
||||
TextView contactName = (TextView) callView.findViewById(R.id.contact_name);
|
||||
ImageView contactImage = (ImageView) callView.findViewById(R.id.contact_picture);
|
||||
LinearLayout callView;
|
||||
|
||||
if(call == null) {
|
||||
if(isConferenceRunning){
|
||||
Log.w("conf running");
|
||||
}
|
||||
contactName.setText(resources.getString(R.string.conference));
|
||||
contactImage.setImageResource(R.drawable.conference_start);
|
||||
callView = (LinearLayout) inflater.inflate(R.layout.conference_paused_row, container, false);
|
||||
callView.setId(index + 1);
|
||||
callView.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
pauseOrResumeConference();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callView = (LinearLayout) inflater.inflate(R.layout.call_inactive_row, container, false);
|
||||
callView.setId(index+1);
|
||||
|
||||
TextView contactName = (TextView) callView.findViewById(R.id.contact_name);
|
||||
|
||||
contactName.setText(LinphoneUtils.getAddressDisplayName(lAddress));
|
||||
displayCallStatusIconAndReturnCallPaused(callView, call);
|
||||
registerCallDurationTimer(callView, call);
|
||||
callsList.addView(callView);
|
||||
}
|
||||
callsList.addView(callView);
|
||||
}
|
||||
|
||||
private boolean displayCallStatusIconAndReturnCallPaused(LinearLayout callView, LinphoneCall call) {
|
||||
|
|
@ -1541,24 +1543,31 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
return;
|
||||
}
|
||||
|
||||
boolean isConfPaused = false;
|
||||
for (LinphoneCall call : LinphoneManager.getLc().getCalls()) {
|
||||
if(call.isInConference()) break;
|
||||
if (call != LinphoneManager.getLc().getCurrentCall()) {
|
||||
displayPausedCalls(resources, call, index);
|
||||
if(call.isInConference() && !isConferenceRunning) {
|
||||
isConfPaused = true;
|
||||
index++;
|
||||
} else {
|
||||
displayCurrentCall(call);
|
||||
if (call != LinphoneManager.getLc().getCurrentCall()) {
|
||||
displayPausedCalls(resources, call, index);
|
||||
index++;
|
||||
} else {
|
||||
displayCurrentCall(call);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (LinphoneManager.getLc().getCurrentCall() == null && !isConferenceRunning ) {
|
||||
if(isConfPaused && !isConferenceRunning){
|
||||
displayPausedCalls(resources, null, index);
|
||||
}
|
||||
|
||||
if (LinphoneManager.getLc().getCurrentCall() == null && !isConferenceRunning) {
|
||||
showAudioView();
|
||||
mActiveCallHeader.setVisibility(View.GONE);
|
||||
mNoCurrentCall.setVisibility(View.VISIBLE);
|
||||
video.setEnabled(false);
|
||||
}
|
||||
|
||||
//callsList.invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1592,6 +1601,7 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
conferenceStatus.setImageResource(R.drawable.pause_big_default);
|
||||
lc.enterConference();
|
||||
}
|
||||
refreshCallList(getResources());
|
||||
}
|
||||
|
||||
private void displayConferenceParticipant(int index, final LinphoneCall call){
|
||||
|
|
@ -1647,7 +1657,6 @@ public class CallActivity extends Activity implements OnClickListener {
|
|||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
conferenceList.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
import org.linphone.compatibility.Compatibility;
|
||||
|
|
@ -67,7 +65,6 @@ import android.os.Environment;
|
|||
import android.os.Parcelable;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -78,9 +75,12 @@ import android.view.ViewGroup;
|
|||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
|
|
@ -88,10 +88,10 @@ import android.widget.ImageView;
|
|||
import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
||||
public class ChatFragment extends Fragment implements OnClickListener, LinphoneChatMessage.LinphoneChatMessageListener {
|
||||
private static ChatFragment instance;
|
||||
|
||||
|
|
@ -172,9 +172,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
remoteComposing = (TextView) view.findViewById(R.id.remoteComposing);
|
||||
remoteComposing.setVisibility(View.GONE);
|
||||
|
||||
uploadLayout = (RelativeLayout) view.findViewById(R.id.uploadLayout);
|
||||
uploadLayout.setVisibility(View.GONE);
|
||||
|
||||
cancel = (ImageView) view.findViewById(R.id.cancel);
|
||||
cancel.setOnClickListener(this);
|
||||
|
||||
|
|
@ -199,6 +196,8 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
if (newChatConversation) {
|
||||
messagesList.setVisibility(View.GONE);
|
||||
searchContactField.setVisibility(View.VISIBLE);
|
||||
searchContactField.showDropDown();
|
||||
searchContactField.requestFocus();
|
||||
searchContactField.setAdapter(new SearchContactsListAdapter(null , null, inflater));
|
||||
edit.setVisibility(View.INVISIBLE);
|
||||
startCall.setVisibility(View.INVISIBLE);
|
||||
|
|
@ -246,22 +245,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
cancelUpload = (ImageView) view.findViewById(R.id.cancelUpload);
|
||||
cancelUpload.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (currentMessageInFileTransferUploadState != null) {
|
||||
uploadLayout.setVisibility(View.GONE);
|
||||
textLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
//progressBar.setProgress(0);
|
||||
currentMessageInFileTransferUploadState.cancelFileTransfer();
|
||||
currentMessageInFileTransferUploadState = null;
|
||||
LinphoneManager.getInstance().setUploadPendingFileMessage(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mListener = new LinphoneCoreListenerBase(){
|
||||
@Override
|
||||
|
|
@ -351,6 +334,29 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
}
|
||||
|
||||
public int getNbItemsChecked(){
|
||||
int size = messagesList.getAdapter().getCount();
|
||||
int nb = 0;
|
||||
for(int i=0; i<size; i++) {
|
||||
if(messagesList.isItemChecked(i)) {
|
||||
nb ++;
|
||||
}
|
||||
}
|
||||
return nb;
|
||||
}
|
||||
|
||||
public void enabledDeleteButton(Boolean enabled){
|
||||
if(enabled){
|
||||
delete.setEnabled(true);
|
||||
delete.setAlpha(1f);
|
||||
} else {
|
||||
if (getNbItemsChecked() == 0){
|
||||
delete.setEnabled(false);
|
||||
delete.setAlpha(0.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ChatMessageAdapter extends BaseAdapter {
|
||||
LinphoneChatMessage[] history;
|
||||
Context context;
|
||||
|
|
@ -400,21 +406,53 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
LinphoneChatMessage message = history[position];
|
||||
|
||||
|
||||
BubbleChat bubble = new BubbleChat(context, message, contact);
|
||||
View v = bubble.getView();
|
||||
|
||||
registerForContextMenu(v);
|
||||
RelativeLayout rlayout = new RelativeLayout(context);
|
||||
|
||||
CheckBox deleteChatBubble = (CheckBox) v.findViewById(R.id.delete);
|
||||
|
||||
if(isEditMode) {
|
||||
v.findViewById(R.id.delete).setVisibility(View.VISIBLE);
|
||||
Log.w("edit mode");
|
||||
deleteChatBubble.setVisibility(View.VISIBLE);
|
||||
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
|
||||
layoutParams.setMargins(0, 10, 30, 10);
|
||||
layoutParams.setMargins(0, 10, 0, 10);
|
||||
v.setLayoutParams(layoutParams);
|
||||
|
||||
deleteChatBubble.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||
messagesList.setItemChecked(position, b);
|
||||
if (getNbItemsChecked() == getCount()) {
|
||||
deselectAll.setVisibility(View.VISIBLE);
|
||||
selectAll.setVisibility(View.GONE);
|
||||
enabledDeleteButton(true);
|
||||
} else {
|
||||
if (getNbItemsChecked() == 0) {
|
||||
deselectAll.setVisibility(View.GONE);
|
||||
selectAll.setVisibility(View.VISIBLE);
|
||||
enabledDeleteButton(false);
|
||||
} else {
|
||||
deselectAll.setVisibility(View.GONE);
|
||||
selectAll.setVisibility(View.VISIBLE);
|
||||
enabledDeleteButton(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(messagesList.isItemChecked(position)) {
|
||||
deleteChatBubble.setChecked(true);
|
||||
} else {
|
||||
deleteChatBubble.setChecked(false);
|
||||
}
|
||||
|
||||
rlayout.addView(v);
|
||||
} else {
|
||||
if(message.isOutgoing()){
|
||||
|
|
@ -435,9 +473,9 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
|
||||
public void dispayMessageList() {
|
||||
messagesList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
|
||||
adapter = new ChatMessageAdapter(getActivity(), chatRoom.getHistory());
|
||||
messagesList.setAdapter(adapter);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void displayChatHeader(LinphoneAddress address) {
|
||||
|
|
@ -473,12 +511,17 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
|
||||
LinphoneAddress lAddress = null;
|
||||
try {
|
||||
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
|
||||
lAddress = LinphoneManager.getLc().interpretUrl(sipUri);
|
||||
//contact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), lAddress);
|
||||
} catch (Exception e){
|
||||
Log.w("error");
|
||||
}
|
||||
|
||||
if(lAddress == null){
|
||||
//TODO SHOW POPUP
|
||||
LinphoneActivity.instance().displayChatList();
|
||||
}
|
||||
|
||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||
if (lc != null) {
|
||||
chatRoom = lc.getOrCreateChatRoom(sipUri);
|
||||
|
|
@ -644,7 +687,10 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
|
||||
private void selectAllList(boolean isSelectAll){
|
||||
//TODO
|
||||
int size = messagesList.getAdapter().getCount();
|
||||
for(int i=0; i<size; i++) {
|
||||
messagesList.setItemChecked(i,isSelectAll);
|
||||
}
|
||||
}
|
||||
|
||||
public void quitEditMode(){
|
||||
|
|
@ -654,10 +700,23 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
dispayMessageList();
|
||||
}
|
||||
|
||||
private void removeChats(){
|
||||
int size = messagesList.getAdapter().getCount();
|
||||
for(int i=0; i<size; i++) {
|
||||
if(messagesList.isItemChecked(i)){
|
||||
LinphoneChatMessage message = (LinphoneChatMessage) messagesList.getAdapter().getItem(i);
|
||||
chatRoom.deleteMessage(message);
|
||||
}
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
Log.w(id);
|
||||
|
||||
if (id == R.id.back_to_call) {
|
||||
LinphoneActivity.instance().resetClassicMenuLayoutAndGoBackToCallIfStillRunning();
|
||||
return;
|
||||
|
|
@ -666,13 +725,15 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
if (id == R.id.select_all) {
|
||||
deselectAll.setVisibility(View.VISIBLE);
|
||||
selectAll.setVisibility(View.GONE);
|
||||
//selectAllList(true);
|
||||
enabledDeleteButton(true);
|
||||
selectAllList(true);
|
||||
return;
|
||||
}
|
||||
if (id == R.id.deselect_all) {
|
||||
deselectAll.setVisibility(View.GONE);
|
||||
selectAll.setVisibility(View.VISIBLE);
|
||||
//selectAllList(false);
|
||||
enabledDeleteButton(false);
|
||||
selectAllList(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -689,7 +750,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
delete.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// removeCallLogs();
|
||||
removeChats();
|
||||
dialog.dismiss();
|
||||
quitEditMode();
|
||||
}
|
||||
|
|
@ -708,8 +769,10 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
|
||||
if(id == R.id.sendMessage){
|
||||
sendTextMessage();
|
||||
} else if (id == R.id.edit) {
|
||||
topBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (id == R.id.edit) {
|
||||
topBar.setVisibility(View.INVISIBLE);
|
||||
editList.setVisibility(View.VISIBLE);
|
||||
isEditMode = true;
|
||||
dispayMessageList();
|
||||
|
|
@ -900,7 +963,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
if (message.getText() != null && message.getText().length() > 0) {
|
||||
sendTextMessage(message.getText());
|
||||
} else {
|
||||
sendImageMessage(message.getAppData(),0);
|
||||
sendImageMessage(message.getAppData(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1011,6 +1074,16 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
//progressBar.setProgress(offset * 100 / total);
|
||||
}
|
||||
|
||||
class ContactAddress {
|
||||
Contact contact;
|
||||
String address;
|
||||
|
||||
private ContactAddress(Contact c, String a){
|
||||
this.contact = c;
|
||||
this.address = a;
|
||||
}
|
||||
}
|
||||
|
||||
class SearchContactsListAdapter extends BaseAdapter implements Filterable {
|
||||
private List<LinphoneFriend> contactList;
|
||||
private Cursor cursor;
|
||||
|
|
@ -1092,6 +1165,9 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
view = mInflater.inflate(R.layout.search_contact_cell, parent, false);
|
||||
}
|
||||
|
||||
final String a = contact.address;
|
||||
final Contact c = contact.contact;
|
||||
|
||||
TextView name = (TextView) view.findViewById(R.id.Contact_name);
|
||||
name.setText(LinphoneUtils.getAddressDisplayName(f.getAddress()));
|
||||
|
||||
|
|
|
|||
|
|
@ -378,7 +378,6 @@ public class ChatStorage {
|
|||
|
||||
for (LinphoneChatRoom chatroom : chats) {
|
||||
if (chatroom.getHistory(1).length > 0) {
|
||||
Log.w("History non nul " + chatroom.getPeerAddress().asString());
|
||||
rooms.add(chatroom);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import org.linphone.mediastream.Log;
|
|||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.ContentProviderOperation;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
|
@ -37,6 +38,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TextView;
|
||||
|
|
@ -134,13 +136,13 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
tv.setText(contact.getLinphoneAddress());
|
||||
|
||||
if (!displayChatAddressOnly) {
|
||||
v.findViewById(R.id.call).setOnClickListener(dialListener);
|
||||
v.findViewById(R.id.call).setTag(contact.getLinphoneAddress());
|
||||
v.findViewById(R.id.contact_call).setOnClickListener(dialListener);
|
||||
v.findViewById(R.id.contact_call).setTag(displayednumberOrAddress);
|
||||
} else {
|
||||
v.findViewById(R.id.call).setVisibility(View.GONE);
|
||||
v.findViewById(R.id.contact_call).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
v.findViewById(R.id.chat).setOnClickListener(chatListener);
|
||||
v.findViewById(R.id.contact_chat).setOnClickListener(chatListener);
|
||||
v.findViewById(R.id.chat).setTag(contact.getLinphoneAddress());
|
||||
|
||||
if (getResources().getBoolean(R.bool.disable_chat)) {
|
||||
|
|
@ -184,21 +186,24 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
} else {
|
||||
v.findViewById(R.id.chat).setTag(numberOrAddress);
|
||||
}
|
||||
|
||||
final String finalNumberOrAddress = numberOrAddress;
|
||||
/*ImageView friend = (ImageView) v.findViewById(R.id.addFriend);
|
||||
if (getResources().getBoolean(R.bool.enable_linphone_friends) && !displayChatAddressOnly) {
|
||||
friend.setVisibility(View.VISIBLE);
|
||||
|
||||
boolean isAlreadyAFriend = LinphoneManager.getLc().findFriendByAddress(finalNumberOrAddress) != null;
|
||||
if (!isAlreadyAFriend) {
|
||||
friend.setImageResource(R.drawable.contact_add);
|
||||
friend.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (ContactsManager.getInstance().createNewFriend(contact, finalNumberOrAddress)) {
|
||||
displayContact(ContactFragment.this.inflater, ContactFragment.this.view);
|
||||
}
|
||||
v.findViewById(R.id.contact_chat).setTag(tag);
|
||||
} else {
|
||||
v.findViewById(R.id.contact_chat).setTag(numberOrAddress);
|
||||
}
|
||||
|
||||
final String finalNumberOrAddress = numberOrAddress;
|
||||
/*ImageView friend = (ImageView) v.findViewById(R.id.addFriend);
|
||||
if (getResources().getBoolean(R.bool.enable_linphone_friends) && !displayChatAddressOnly) {
|
||||
friend.setVisibility(View.VISIBLE);
|
||||
|
||||
boolean isAlreadyAFriend = LinphoneManager.getLc().findFriendByAddress(finalNumberOrAddress) != null;
|
||||
if (!isAlreadyAFriend) {
|
||||
friend.setImageResource(R.drawable.contact_add);
|
||||
friend.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (ContactsManager.getInstance().createNewFriend(contact, finalNumberOrAddress)) {
|
||||
displayContact(ContactFragment.this.inflater, ContactFragment.this.view);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
@ -214,7 +219,7 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
}
|
||||
}*/
|
||||
if (getResources().getBoolean(R.bool.disable_chat)) {
|
||||
v.findViewById(R.id.chat).setVisibility(View.GONE);
|
||||
v.findViewById(R.id.contact_chat).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
controls.addView(v);
|
||||
|
|
@ -242,7 +247,7 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void deleteExistingContact() {
|
||||
|
|
|
|||
|
|
@ -207,11 +207,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
}
|
||||
}
|
||||
|
||||
if(proxy == lc.getDefaultProxyConfig()){
|
||||
displayMainAccount();
|
||||
} else {
|
||||
refreshAccounts();
|
||||
}
|
||||
refreshAccounts();
|
||||
|
||||
if(state.equals(RegistrationState.RegistrationFailed) && newProxyConfig) {
|
||||
newProxyConfig = false;
|
||||
|
|
@ -1341,6 +1337,8 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
if(proxy == null) {
|
||||
displayName.setText(getString(R.string.no_account));
|
||||
status.setVisibility(View.GONE);
|
||||
address.setText("");
|
||||
statusFragment.resetAccountStatus();
|
||||
|
||||
defaultAccount.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
|
|
@ -1365,7 +1363,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
}
|
||||
}
|
||||
|
||||
private void refreshAccounts(){
|
||||
public void refreshAccounts(){
|
||||
if(LinphoneManager.getLc().getProxyConfigList().length > 1) {
|
||||
accountsList.setVisibility(View.VISIBLE);
|
||||
accountsList.setAdapter(new AccountsListAdapter());
|
||||
|
|
@ -1380,6 +1378,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
} else {
|
||||
accountsList.setVisibility(View.GONE);
|
||||
}
|
||||
displayMainAccount();
|
||||
}
|
||||
|
||||
private void initAccounts() {
|
||||
|
|
|
|||
|
|
@ -700,13 +700,14 @@ public class LinphonePreferences {
|
|||
|
||||
public void deleteAccount(int n) {
|
||||
final LinphoneProxyConfig proxyCfg = getProxyConfig(n);
|
||||
|
||||
if (proxyCfg != null)
|
||||
getLc().removeProxyConfig(proxyCfg);
|
||||
if (getLc().getProxyConfigList().length != 0) {
|
||||
resetDefaultProxyConfig();
|
||||
getLc().refreshRegisters();
|
||||
} else {
|
||||
getLc().setDefaultProxyConfig(null);
|
||||
}
|
||||
getLc().refreshRegisters();
|
||||
}
|
||||
// End of accounts settings
|
||||
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ public final class LinphoneService extends Service {
|
|||
|
||||
Bitmap bm = null;
|
||||
try {
|
||||
bm = BitmapFactory.decodeResource(getResources(), R.drawable.logo_secure_phone);
|
||||
bm = BitmapFactory.decodeResource(getResources(), R.drawable.linphone_logo);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
mNotif = Compatibility.createNotification(this, mNotificationTitle, "", R.drawable.status_level, R.drawable.logo_secure_phone, bm, mNotifContentIntent, true,notifcationsPriority);
|
||||
|
|
@ -359,7 +359,7 @@ public final class LinphoneService extends Service {
|
|||
|
||||
Bitmap bm = null;
|
||||
try {
|
||||
bm = BitmapFactory.decodeResource(getResources(), R.drawable.logo_secure_phone);
|
||||
bm = BitmapFactory.decodeResource(getResources(), R.drawable.linphone_logo);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
mCustomNotif = Compatibility.createNotification(this, title, message, iconResourceID, 0, bm, notifContentIntent, isOngoingEvent,notifcationsPriority);
|
||||
|
|
@ -531,7 +531,7 @@ public final class LinphoneService extends Service {
|
|||
|
||||
Bitmap bm = null;
|
||||
try {
|
||||
bm = BitmapFactory.decodeResource(getResources(), R.drawable.logo_linphone_57x57);
|
||||
bm = BitmapFactory.decodeResource(getResources(), R.drawable.linphone_logo);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
mNotif = Compatibility.createNotification(this, mNotificationTitle, text, R.drawable.status_level, level, bm, mNotifContentIntent, true,notifcationsPriority);
|
||||
|
|
|
|||
|
|
@ -204,6 +204,13 @@ public class StatusFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
public void resetAccountStatus(){
|
||||
if(LinphoneManager.getLc().getProxyConfigList().length == 0){
|
||||
statusLed.setImageResource(R.drawable.led_disconnected);
|
||||
statusText.setText(getString(R.string.no_account));
|
||||
}
|
||||
}
|
||||
|
||||
public void enableSideMenu(boolean enabled) {
|
||||
menu.setEnabled(enabled);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ import org.linphone.core.LinphoneCoreException;
|
|||
import org.linphone.core.LinphoneCoreFactory;
|
||||
import org.linphone.core.LinphoneCoreListenerBase;
|
||||
import org.linphone.core.LinphoneProxyConfig;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -99,11 +98,10 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
if (state == RegistrationState.RegistrationOk) {
|
||||
if (LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
||||
launchEchoCancellerCalibration(true);
|
||||
success();
|
||||
}
|
||||
} else if (state == RegistrationState.RegistrationFailed) {
|
||||
//showDialog(cfg);
|
||||
//Toast.makeText(AssistantActivity.this, getString(R.string.first_launch_bad_login_password), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(AssistantActivity.this, getString(R.string.first_launch_bad_login_password), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -211,7 +209,7 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
back.setVisibility(View.VISIBLE);
|
||||
cancel.setEnabled(false);
|
||||
} else {
|
||||
|
||||
success();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -224,7 +222,7 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
saveCreatedAccount(username, password, displayName, domain);
|
||||
|
||||
if (LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
||||
//launchEchoCancellerCalibration(sendEcCalibrationResult);
|
||||
launchEchoCancellerCalibration(sendEcCalibrationResult);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +349,6 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
|
||||
builder.setExpires("604800")
|
||||
.setOutboundProxyEnabled(true)
|
||||
.setAvpfEnabled(true)
|
||||
.setAvpfRRInterval(3)
|
||||
.setQualityReportingCollector("sip:voip-metrics@sip.linphone.org")
|
||||
|
|
|
|||
|
|
@ -18,24 +18,15 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import org.linphone.LinphoneActivity;
|
||||
import org.linphone.LinphoneLauncherActivity;
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.LinphonePreferences;
|
||||
import org.linphone.LinphoneService;
|
||||
import org.linphone.core.LinphoneCoreListenerBase;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.R;
|
||||
import org.linphone.core.LinphoneAuthInfo;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.LinphoneCoreException;
|
||||
import org.linphone.core.LinphoneCoreFactory;
|
||||
import org.linphone.core.LinphoneProxyConfig;
|
||||
import org.linphone.xmlrpc.XmlRpcHelper;
|
||||
import org.linphone.xmlrpc.XmlRpcListenerBase;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ public class ApiElevenPlus {
|
|||
.setContentTitle(title)
|
||||
.setContentText(text)
|
||||
.setContentIntent(intent)
|
||||
.setSmallIcon(R.drawable.logo_linphone_57x57)
|
||||
.setSmallIcon(R.drawable.linphone_logo)
|
||||
.setAutoCancel(true)
|
||||
.setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE)
|
||||
.setWhen(System.currentTimeMillis()).getNotification();
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ public class ApiFivePlus {
|
|||
|
||||
public static Notification createSimpleNotification(Context context, String title, String text, PendingIntent intent) {
|
||||
NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(context)
|
||||
.setSmallIcon(R.drawable.logo_linphone_57x57)
|
||||
.setSmallIcon(R.drawable.linphone_logo)
|
||||
.setContentTitle(title)
|
||||
.setContentText(text)
|
||||
.setContentIntent(intent);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ public class ApiSixteenPlus {
|
|||
Notification notif = new Notification.Builder(context)
|
||||
.setContentTitle(title)
|
||||
.setContentText(text)
|
||||
.setSmallIcon(R.drawable.logo_linphone_57x57)
|
||||
.setSmallIcon(R.drawable.linphone_logo)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(intent)
|
||||
.setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE)
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ public class ApiTwentyOnePlus {
|
|||
Notification notif = new Notification.Builder(context)
|
||||
.setContentTitle(title)
|
||||
.setContentText(text)
|
||||
.setSmallIcon(R.drawable.logo_linphone_57x57)
|
||||
.setSmallIcon(R.drawable.linphone_logo)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(intent)
|
||||
.setDefaults(Notification.DEFAULT_ALL)
|
||||
|
|
|
|||
|
|
@ -74,10 +74,11 @@ import android.widget.TextView;
|
|||
public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListener {
|
||||
private static final HashMap<String, Integer> emoticons = new HashMap<String, Integer>();
|
||||
|
||||
private LinearLayout view;
|
||||
private View view;
|
||||
private ImageView statusView, contactPicture;
|
||||
private LinphoneChatMessage nativeMessage;
|
||||
private Context mContext;
|
||||
private Button cancelUpload, acceptDownload;
|
||||
private static final int SIZE_MAX = 512;
|
||||
private ProgressBar progressBar, inprogress;
|
||||
private Bitmap defaultBitmap;
|
||||
|
|
@ -91,9 +92,9 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
|
|||
mContext = context;
|
||||
|
||||
if (message.isOutgoing()) {
|
||||
view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_outgoing, null);
|
||||
view = LayoutInflater.from(context).inflate(R.layout.chat_bubble_outgoing, null);
|
||||
} else {
|
||||
view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_incoming, null);
|
||||
view = LayoutInflater.from(context).inflate(R.layout.chat_bubble_incoming, null);
|
||||
}
|
||||
|
||||
defaultBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.chat_picture_over);
|
||||
|
|
@ -119,12 +120,29 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
|
|||
}
|
||||
}
|
||||
|
||||
if(nativeMessage.isOutgoing()){
|
||||
cancelUpload = (Button) view.findViewById(R.id.cancel_upload);
|
||||
cancelUpload.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (LinphoneManager.getInstance().getMessageUploadPending() != null) {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
//tex.setVisibility(View.VISIBLE);
|
||||
|
||||
progressBar.setProgress(0);
|
||||
nativeMessage.cancelFileTransfer();
|
||||
LinphoneManager.getInstance().setUploadPendingFileMessage(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String externalBodyUrl = message.getExternalBodyUrl();
|
||||
LinphoneContent fileTransferContent = message.getFileTransferInformation();
|
||||
|
||||
if(LinphoneManager.getInstance().getMessageUploadPending() != null){
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
nativeMessage.setListener(LinphoneManager.getInstance());
|
||||
LinphoneManager.addListener(this);
|
||||
}
|
||||
|
||||
if (externalBodyUrl != null || fileTransferContent != null ) {
|
||||
|
|
@ -353,7 +371,6 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
|
|||
final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
|
||||
if (this == bitmapWorkerTask && imageView != null) {
|
||||
imageView.setImageBitmap(bitmap);
|
||||
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
imageView.setTag(path);
|
||||
imageView.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -15,13 +15,14 @@ import android.test.suitebuilder.annotation.SmallTest;
|
|||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Button;
|
||||
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
public class AccountAssistant extends SampleTest {
|
||||
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testAWizardDisplayedAfterInstall() {
|
||||
|
|
@ -40,7 +41,7 @@ public class AccountAssistant extends SampleTest {
|
|||
solo.enterText((EditText) solo.getView(org.linphone.R.id.assistant_username), iContext.getString(R.string.account_linphone_login));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.assistant_password), iContext.getString(R.string.account_linphone_pwd));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.assistant_display_name), iContext.getString(R.string.account_linphone_display_name));
|
||||
solo.clickOnText(aContext.getString(org.linphone.R.string.assistant_apply));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.assistant_apply));
|
||||
|
||||
solo.sleep(1000);
|
||||
|
||||
|
|
@ -66,7 +67,6 @@ public class AccountAssistant extends SampleTest {
|
|||
|
||||
String proxy = prefs.getAccountProxy(0);
|
||||
Assert.assertEquals("<sip:" + aContext.getString(org.linphone.R.string.default_domain) + ":5223;transport=tls>", proxy);
|
||||
Assert.assertEquals(true, prefs.isAccountOutboundProxySet(0));
|
||||
|
||||
String display_name = prefs.getAccountDisplayName(0);
|
||||
Assert.assertEquals(iContext.getString(R.string.account_linphone_display_name), display_name);
|
||||
|
|
@ -75,14 +75,12 @@ public class AccountAssistant extends SampleTest {
|
|||
Assert.assertEquals(ice, true);
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testCWizardDoesntShowWhenAccountIsConfigured() {
|
||||
solo.waitForActivity("LinphoneActivity", 2000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testDLoginWithGenericAccount() {
|
||||
startAssistant();
|
||||
|
|
@ -91,8 +89,8 @@ public class AccountAssistant extends SampleTest {
|
|||
solo.enterText((EditText) solo.getView(org.linphone.R.id.assistant_username), iContext.getString(R.string.account_generic_login));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.assistant_password), iContext.getString(R.string.account_generic_pwd));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.assistant_domain), iContext.getString(R.string.account_generic_domain));
|
||||
solo.clickOnText(aContext.getString(org.linphone.R.string.assistant_apply));
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.assistant_apply));
|
||||
|
||||
if (!Hacks.hasBuiltInEchoCanceller())
|
||||
solo.waitForActivity("LinphoneActivity", 8000);
|
||||
else
|
||||
|
|
@ -106,58 +104,60 @@ public class AccountAssistant extends SampleTest {
|
|||
waitForRegistration(proxyConfig);
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testECreateNewAccount() {
|
||||
//startAssistant();
|
||||
startAssistant();
|
||||
|
||||
//solo.clickOnView(solo.getView(org.linphone.R.id.create_account));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.create_account));
|
||||
|
||||
//solo.enterText((EditText) solo.getView(org.linphone.R.id.edittext), iContext.getString(R.string.account_create_login).substring(0,2));
|
||||
//solo.sleep(200);
|
||||
//Assert.assertEquals(error.getText(), aContext.getString(org.linphone.R.string.wizard_username_incorrect));
|
||||
// Assert.assertFalse(createAccount.isEnabled());
|
||||
|
||||
//TextView error = (TextView) solo.getView(org.linphone.R.id.setup_error);
|
||||
/*ImageView createAccount = (ImageView) solo.getView(org.linphone.R.id.assistant_create);
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.username), iContext.getString(R.string.account_create_login).substring(0, 2));
|
||||
solo.sleep(200);
|
||||
TextView error = (TextView) solo.getView(org.linphone.R.id.username_error);
|
||||
int sleepingTime = 1500;
|
||||
|
||||
Button createAccount = (Button) solo.getView(org.linphone.R.id.assistant_create);
|
||||
|
||||
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.setup_username));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.setup_username), iContext.getString(R.string.account_linphone_login));
|
||||
solo.sleep(sleepingTime*2);
|
||||
Assert.assertEquals(error.getText(), aContext.getString(org.linphone.R.string.wizard_username_incorrect));
|
||||
Assert.assertFalse(createAccount.isEnabled());
|
||||
|
||||
|
||||
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.username));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.username), iContext.getString(R.string.account_linphone_login));
|
||||
solo.sleep(sleepingTime * 2);
|
||||
Assert.assertEquals(error.getText(), aContext.getString(org.linphone.R.string.wizard_username_unavailable));
|
||||
Assert.assertFalse(createAccount.isEnabled());
|
||||
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.setup_password), iContext.getString(R.string.account_create_pwd).substring(0,2));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.password), iContext.getString(R.string.account_create_pwd).substring(0, 2));
|
||||
solo.sleep(sleepingTime);
|
||||
error = (TextView) solo.getView(org.linphone.R.id.confirm_password_error);
|
||||
Assert.assertEquals(error.getText(), aContext.getString(org.linphone.R.string.wizard_passwords_unmatched));
|
||||
Assert.assertFalse(createAccount.isEnabled());
|
||||
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.setup_password));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.setup_password), iContext.getString(R.string.account_create_pwd).substring(0,2));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.setup_password_confirm), iContext.getString(R.string.account_create_pwd).substring(0,2));
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.password));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.password), iContext.getString(R.string.account_create_pwd).substring(0, 2));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.confirm_password), iContext.getString(R.string.account_create_pwd).substring(0,2));
|
||||
solo.sleep(sleepingTime);
|
||||
error = (TextView) solo.getView(org.linphone.R.id.password_error);
|
||||
Assert.assertEquals(error.getText(), aContext.getString(org.linphone.R.string.wizard_password_incorrect));
|
||||
Assert.assertFalse(createAccount.isEnabled());
|
||||
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.setup_email), iContext.getString(R.string.account_create_email).substring(0, 12));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.email), iContext.getString(R.string.account_create_email).substring(0, 12));
|
||||
solo.sleep(sleepingTime);
|
||||
error = (TextView) solo.getView(org.linphone.R.id.email_error);
|
||||
Assert.assertEquals(error.getText(), aContext.getString(org.linphone.R.string.wizard_email_incorrect));
|
||||
Assert.assertFalse(createAccount.isEnabled());
|
||||
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.setup_username));
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.setup_password));
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.setup_password_confirm));
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.setup_email));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.setup_username), iContext.getString(R.string.account_create_login));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.setup_password), iContext.getString(R.string.account_create_pwd));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.setup_password_confirm), iContext.getString(R.string.account_create_pwd));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.setup_email), iContext.getString(R.string.account_create_email));
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.username));
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.password));
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.confirm_password));
|
||||
solo.clearEditText((EditText) solo.getView(org.linphone.R.id.email));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.username), iContext.getString(R.string.account_create_login));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.password), iContext.getString(R.string.account_create_pwd));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.confirm_password), iContext.getString(R.string.account_create_pwd));
|
||||
solo.enterText((EditText) solo.getView(org.linphone.R.id.email), iContext.getString(R.string.account_create_email));
|
||||
solo.sleep(sleepingTime);
|
||||
Assert.assertEquals(error.getText(), "");
|
||||
Assert.assertTrue(createAccount.isEnabled());*/
|
||||
Assert.assertTrue(createAccount.isEnabled());
|
||||
}
|
||||
|
||||
@LargeTest
|
||||
|
|
|
|||
|
|
@ -46,17 +46,15 @@ public class CallsAudio extends SampleTest {
|
|||
LinphoneTestManager.getInstance().declineCall = false; // Just in case
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
solo.waitForActivity("CallOutgoingActivity", 400);
|
||||
//assertOutgoingCallIsCorrectlyRunning();
|
||||
assertOutgoingCallIsCorrectlyRunning();
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testCDTMFRFC2833InPCMUCall() {
|
||||
|
|
@ -69,7 +67,7 @@ public class CallsAudio extends SampleTest {
|
|||
LinphoneManager.getLc().setUseSipInfoForDtmfs(false);
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
|
||||
|
|
@ -78,7 +76,7 @@ public class CallsAudio extends SampleTest {
|
|||
solo.clickOnView(solo.getView(org.linphone.R.id.dialer));
|
||||
|
||||
solo.sleep(1000);
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
|
||||
//To enable when issue http://git.linphone.org/mantis/view.php?id=750 will be fixed
|
||||
//Assert.assertTrue(LinphoneTestManager.getInstance().isDTMFReceived);
|
||||
|
|
@ -88,7 +86,6 @@ public class CallsAudio extends SampleTest {
|
|||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testDDTMFSIPINFO() {
|
||||
|
|
@ -96,7 +93,7 @@ public class CallsAudio extends SampleTest {
|
|||
LinphoneManager.getLc().setUseSipInfoForDtmfs(true);
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
|
||||
|
|
@ -105,7 +102,7 @@ public class CallsAudio extends SampleTest {
|
|||
solo.clickOnView(solo.getView(org.linphone.R.id.dialer));
|
||||
|
||||
solo.sleep(1000);
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
|
||||
//To enable when issue http://git.linphone.org/mantis/view.php?id=751 will be fixed
|
||||
//Assert.assertTrue(LinphoneTestManager.getInstance().isDTMFReceived);
|
||||
|
|
@ -115,14 +112,13 @@ public class CallsAudio extends SampleTest {
|
|||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testEOutgoingCallToAudioClient() {
|
||||
LinphoneTestManager.getLc().enableVideo(false, false);
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
solo.waitForActivity("CallOutgoingActivity", 2000);
|
||||
|
||||
|
|
@ -131,14 +127,13 @@ public class CallsAudio extends SampleTest {
|
|||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testFOutgoingCallToVideoClient() {
|
||||
LinphoneTestManager.getLc().enableVideo(true, true);
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
solo.waitForActivity("CallOutgoingActivity", 5000);
|
||||
|
||||
|
|
@ -147,14 +142,13 @@ public class CallsAudio extends SampleTest {
|
|||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testGOutgoingCallCancelled() {
|
||||
LinphoneTestManager.getInstance().autoAnswer = false;
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
solo.waitForActivity("CallOutgoingActivity", 200);
|
||||
solo.assertCurrentActivity("Expected InCall Activity", CallOutgoingActivity.class);
|
||||
|
|
@ -169,7 +163,6 @@ public class CallsAudio extends SampleTest {
|
|||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testHOutgoingCallDeclined() {
|
||||
|
|
@ -177,7 +170,7 @@ public class CallsAudio extends SampleTest {
|
|||
LinphoneTestManager.getInstance().declineCall = true;
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
solo.sleep(1500);
|
||||
Assert.assertTrue(solo.searchText(aContext.getString(org.linphone.R.string.error_call_declined)));
|
||||
|
|
@ -219,7 +212,6 @@ public class CallsAudio extends SampleTest {
|
|||
assertCallIsCorrectlyRunning();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@LargeTest
|
||||
public void testJIncomingVideoCall() {
|
||||
LinphoneTestManager.getLc().enableVideo(true, true);
|
||||
|
|
@ -248,12 +240,11 @@ public class CallsAudio extends SampleTest {
|
|||
assertCallIsCorrectlyRunning();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testKSelfPauseResumeCall() {
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
|
||||
|
|
@ -267,17 +258,16 @@ public class CallsAudio extends SampleTest {
|
|||
|
||||
waitForCallResumed(LinphoneManager.getLc().getCalls()[0]);
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testLRemotePauseResumeCall() {
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
|
||||
|
|
@ -292,27 +282,25 @@ public class CallsAudio extends SampleTest {
|
|||
waitForCallResumed(LinphoneManager.getLc().getCalls()[0]);
|
||||
|
||||
solo.clickLongOnScreen(200, 200); //To ensure controls are shown
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@LargeTest
|
||||
public void testMSwitchOnVideoInCallIsNotAllowed() {
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
|
||||
Assert.assertFalse(solo.getView(org.linphone.R.id.video).isEnabled());
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@LargeTest
|
||||
public void testNDeclineIncomingCall() {
|
||||
LinphoneTestManager.getInstance().declineCall = false; // Just in case
|
||||
|
|
@ -338,7 +326,6 @@ public class CallsAudio extends SampleTest {
|
|||
solo.drag(topLayout.getMeasuredWidth() - 10, 10, slidersTop, slidersTop, 10);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testOCancelledIncomingCall() {
|
||||
|
|
@ -361,7 +348,6 @@ public class CallsAudio extends SampleTest {
|
|||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testPDisplayMissedCallsNumber() {
|
||||
|
|
@ -374,10 +360,9 @@ public class CallsAudio extends SampleTest {
|
|||
//TODO: Test each audio codec
|
||||
|
||||
private void assertOutgoingCallIsCorrectlyRunning() {
|
||||
solo.waitForActivity("CallOutgoingActivity", 5000);
|
||||
solo.waitForActivity("CallOutgoingActivity", 2000);
|
||||
solo.assertCurrentActivity("Expected OutgoingCall Activity", CallOutgoingActivity.class);
|
||||
|
||||
solo.sleep(2000);
|
||||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||
|
||||
waitForCallState(call, LinphoneCall.State.OutgoingProgress);
|
||||
|
|
|
|||
|
|
@ -4,13 +4,16 @@ import junit.framework.Assert;
|
|||
|
||||
import org.linphone.CallActivity;
|
||||
import org.linphone.CallIncomingActivity;
|
||||
import org.linphone.CallOutgoingActivity;
|
||||
import org.linphone.LinphoneActivity;
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.core.LinphoneCall;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.LinphoneCoreException;
|
||||
import org.linphone.core.PayloadType;
|
||||
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
import android.test.suitebuilder.annotation.MediumTest;
|
||||
import android.util.DisplayMetrics;
|
||||
|
|
@ -21,7 +24,7 @@ import android.view.View;
|
|||
*/
|
||||
public class CallsVideo extends SampleTest {
|
||||
|
||||
// @SmallTest
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testAInit() {
|
||||
|
|
@ -47,7 +50,7 @@ public class CallsVideo extends SampleTest {
|
|||
Assert.assertTrue(LinphoneManager.getLc().getVideoAutoInitiatePolicy());
|
||||
}
|
||||
|
||||
// @SmallTest
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testBOutgoingCallWithDefaultConfig() {
|
||||
|
|
@ -55,16 +58,18 @@ public class CallsVideo extends SampleTest {
|
|||
LinphoneTestManager.getLc().enableVideo(true, true);
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertOutgoingCallIsCorrectlyRunning();
|
||||
assertCallIsRunningWithVideo();
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.video_frame));
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testCDTMFRFC2833InPCMUCall() {
|
||||
|
|
@ -77,7 +82,7 @@ public class CallsVideo extends SampleTest {
|
|||
LinphoneManager.getLc().setUseSipInfoForDtmfs(false);
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
|
||||
|
|
@ -86,7 +91,7 @@ public class CallsVideo extends SampleTest {
|
|||
solo.clickOnView(solo.getView(org.linphone.R.id.dialer));
|
||||
|
||||
solo.sleep(1000);
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
|
||||
//To enable when issue http://git.linphone.org/mantis/view.php?id=750 will be fixed
|
||||
//Assert.assertTrue(LinphoneTestManager.getInstance().isDTMFReceived);
|
||||
|
|
@ -95,7 +100,7 @@ public class CallsVideo extends SampleTest {
|
|||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testDDTMFSIPINFO() {
|
||||
|
|
@ -103,7 +108,7 @@ public class CallsVideo extends SampleTest {
|
|||
LinphoneManager.getLc().setUseSipInfoForDtmfs(true);
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
|
||||
|
|
@ -112,7 +117,7 @@ public class CallsVideo extends SampleTest {
|
|||
solo.clickOnView(solo.getView(org.linphone.R.id.dialer));
|
||||
|
||||
solo.sleep(1000);
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
|
||||
//To enable when issue http://git.linphone.org/mantis/view.php?id=751 will be fixed
|
||||
//Assert.assertTrue(LinphoneTestManager.getInstance().isDTMFReceived);
|
||||
|
|
@ -128,11 +133,12 @@ public class CallsVideo extends SampleTest {
|
|||
LinphoneTestManager.getLc().enableVideo(false, false);
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertOutgoingCallIsCorrectlyRunning();
|
||||
assertCallIsCorrectlyRunning();
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
|
@ -141,14 +147,16 @@ public class CallsVideo extends SampleTest {
|
|||
@LargeTest
|
||||
public void testFOutgoingCallToVideoClient() {
|
||||
LinphoneTestManager.getLc().enableVideo(true, true);
|
||||
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertOutgoingCallIsCorrectlyRunning();
|
||||
assertCallIsCorrectlyRunning();
|
||||
assertCallIsRunningWithVideo();
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.video_frame));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
|
@ -159,7 +167,7 @@ public class CallsVideo extends SampleTest {
|
|||
LinphoneTestManager.getInstance().autoAnswer = false;
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
solo.waitForActivity("InCallActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected InCall Activity", CallActivity.class);
|
||||
|
|
@ -169,19 +177,18 @@ public class CallsVideo extends SampleTest {
|
|||
|
||||
LinphoneTestManager.getInstance().autoAnswer = true;
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testHOutgoingCallDeclined() {
|
||||
LinphoneTestManager.getInstance().autoAnswer = true; // Just in case
|
||||
LinphoneTestManager.getInstance().declineCall = true;
|
||||
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
solo.sleep(1500);
|
||||
Assert.assertTrue(solo.searchText(aContext.getString(org.linphone.R.string.error_call_declined)));
|
||||
|
|
@ -208,18 +215,12 @@ public class CallsVideo extends SampleTest {
|
|||
solo.assertCurrentActivity("Expected Incoming Call Activity", CallIncomingActivity.class);
|
||||
|
||||
solo.sleep(1000);
|
||||
View topLayout = solo.getView(org.linphone.R.id.topLayout);
|
||||
int topLayoutHeigh = topLayout.getMeasuredHeight();
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
int topOffset = dm.heightPixels - topLayoutHeigh;
|
||||
int slidersTop = topLayoutHeigh - 80 - topOffset; // 80 is the bottom margin set in incoming.xml
|
||||
solo.drag(10, topLayout.getMeasuredWidth() - 10, slidersTop, slidersTop, 10);
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.accept));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
}
|
||||
|
||||
// @SmallTest
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testJIncomingVideoCall() {
|
||||
|
|
@ -235,14 +236,7 @@ public class CallsVideo extends SampleTest {
|
|||
solo.waitForActivity("IncomingCallActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Incoming Call Activity", CallIncomingActivity.class);
|
||||
|
||||
solo.sleep(1000);
|
||||
View topLayout = solo.getView(org.linphone.R.id.topLayout);
|
||||
int topLayoutHeigh = topLayout.getMeasuredHeight();
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
int topOffset = dm.heightPixels - topLayoutHeigh;
|
||||
int slidersTop = topLayoutHeigh - 80 - topOffset; // 80 is the bottom margin set in incoming.xml
|
||||
solo.drag(10, topLayout.getMeasuredWidth() - 10, slidersTop, slidersTop, 10);
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.accept));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
assertCallIsRunningWithVideo();
|
||||
|
|
@ -263,20 +257,23 @@ public class CallsVideo extends SampleTest {
|
|||
@LargeTest
|
||||
public void testKSelfPauseResumeCall() {
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.video_frame));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.pause));
|
||||
solo.sleep(1000);
|
||||
|
||||
waitForCallPaused(LinphoneManager.getLc().getCalls()[0]);
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.video_frame));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.pause));
|
||||
solo.sleep(1000);
|
||||
|
||||
waitForCallResumed(LinphoneManager.getLc().getCalls()[0]);
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.video_frame));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
|
@ -285,7 +282,7 @@ public class CallsVideo extends SampleTest {
|
|||
@LargeTest
|
||||
public void testLRemotePauseResumeCall() {
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
|
||||
|
|
@ -293,13 +290,14 @@ public class CallsVideo extends SampleTest {
|
|||
solo.sleep(1000);
|
||||
|
||||
waitForCallState(LinphoneManager.getLc().getCalls()[0], LinphoneCall.State.PausedByRemote);
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.video_frame));
|
||||
LinphoneTestManager.getLc().resumeCall(LinphoneTestManager.getLc().getCalls()[0]);
|
||||
solo.sleep(1000);
|
||||
|
||||
waitForCallResumed(LinphoneManager.getLc().getCalls()[0]);
|
||||
|
||||
solo.clickLongOnScreen(200, 200); //To ensure controls are shown
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.video_frame));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
|
@ -308,17 +306,18 @@ public class CallsVideo extends SampleTest {
|
|||
@LargeTest
|
||||
public void testMSwitchOffVideoInCall() {
|
||||
solo.enterText(0, iContext.getString(org.linphone.test.R.string.account_test_calls_login) + "@" + iContext.getString(org.linphone.test.R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.Call));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.call));
|
||||
|
||||
assertCallIsCorrectlyRunning();
|
||||
assertCallIsRunningWithVideo();
|
||||
|
||||
Assert.assertTrue(solo.getView(org.linphone.R.id.video).isEnabled());
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.video_frame));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.video));
|
||||
solo.sleep(1000);
|
||||
Assert.assertFalse(LinphoneManager.getLc().getCurrentCall().getCurrentParamsCopy().getVideoEnabled());
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hangUp));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.hang_up));
|
||||
solo.waitForActivity("LinphoneActivity", 5000);
|
||||
solo.assertCurrentActivity("Expected Linphone Activity", LinphoneActivity.class);
|
||||
}
|
||||
|
|
@ -327,12 +326,19 @@ public class CallsVideo extends SampleTest {
|
|||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||
Assert.assertTrue(call.getCurrentParamsCopy().getVideoEnabled());
|
||||
}
|
||||
|
||||
private void assertOutgoingCallIsCorrectlyRunning() {
|
||||
solo.waitForActivity("CallOutgoingActivity", 2000);
|
||||
solo.assertCurrentActivity("Expected OutgoingCall Activity", CallOutgoingActivity.class);
|
||||
|
||||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||
|
||||
waitForCallState(call, LinphoneCall.State.OutgoingProgress);
|
||||
}
|
||||
|
||||
private void assertCallIsCorrectlyRunning() {
|
||||
solo.waitForActivity("InCallActivity", 5000);
|
||||
solo.waitForActivity("CallActivity", 2000);
|
||||
solo.assertCurrentActivity("Expected InCall Activity", CallActivity.class);
|
||||
|
||||
solo.sleep(2000);
|
||||
|
||||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||
|
||||
waitForCallState(call, LinphoneCall.State.StreamsRunning);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import android.test.suitebuilder.annotation.LargeTest;
|
|||
import android.test.suitebuilder.annotation.MediumTest;
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
import android.widget.EditText;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -22,7 +23,7 @@ import android.widget.EditText;
|
|||
*/
|
||||
public class Chat extends SampleTest {
|
||||
|
||||
//@SmallTest
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testAEmptyChatHistory() {
|
||||
|
|
@ -43,31 +44,31 @@ public class Chat extends SampleTest {
|
|||
Assert.assertTrue(solo.searchText(aContext.getString(org.linphone.R.string.no_chat_history)));
|
||||
}
|
||||
|
||||
//@SmallTest
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testCSendTextMessage() {
|
||||
goToChat();
|
||||
|
||||
/* solo.enterText(0, "sip:" + iContext.getString(R.string.account_test_calls_login) + "@" + iContext.getString(R.string.account_test_calls_domain));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.newDiscussion));
|
||||
|
||||
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.new_discussion));
|
||||
solo.enterText((AutoCompleteTextView)solo.getView(org.linphone.R.id.searchContactField), "sip:" + iContext.getString(R.string.account_test_calls_login) + "@" + iContext.getString(R.string.account_test_calls_domain));
|
||||
|
||||
solo.enterText((EditText)solo.getView(org.linphone.R.id.message), iContext.getString(R.string.chat_test_text_sent));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.sendMessage));
|
||||
|
||||
solo.sleep(1000);
|
||||
Assert.assertTrue(solo.searchText(iContext.getString(R.string.chat_test_text_sent)));
|
||||
Assert.assertEquals(iContext.getString(R.string.chat_test_text_sent), LinphoneTestManager.getInstance().lastMessageReceived);*/
|
||||
Assert.assertEquals(iContext.getString(R.string.chat_test_text_sent), LinphoneTestManager.getInstance().lastMessageReceived);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@LargeTest
|
||||
public void testDIsNotEmptyChatHistory() {
|
||||
goToChat();
|
||||
|
||||
Assert.assertTrue(solo.searchText(iContext.getString(org.linphone.test.R.string.account_test_calls_login)));
|
||||
}
|
||||
|
||||
//@SmallTest
|
||||
@SmallTest
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testEReceiveTextMessage() {
|
||||
|
|
@ -87,7 +88,7 @@ public class Chat extends SampleTest {
|
|||
solo.sleep(1000);
|
||||
Assert.assertTrue(solo.searchText(iContext.getString(R.string.chat_test_text_received)));
|
||||
}
|
||||
|
||||
|
||||
@MediumTest
|
||||
@LargeTest
|
||||
public void testFDeleteMessage() {
|
||||
|
|
@ -119,7 +120,7 @@ public class Chat extends SampleTest {
|
|||
Assert.assertTrue(solo.searchText(iContext.getString(R.string.chat_test_text_sent)));
|
||||
Assert.assertEquals(iContext.getString(R.string.chat_test_text_sent), LinphoneTestManager.getInstance().lastMessageReceived);
|
||||
|
||||
solo.clickOnText(aContext.getString(org.linphone.R.string.button_back));
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.back));
|
||||
|
||||
solo.sleep(1000);
|
||||
Assert.assertTrue(solo.searchText(iContext.getString(R.string.account_test_calls_login)));
|
||||
|
|
@ -130,13 +131,13 @@ public class Chat extends SampleTest {
|
|||
public void testHDeleteConversation() {
|
||||
goToChat();
|
||||
|
||||
solo.clickOnText(aContext.getString(org.linphone.R.string.button_edit));
|
||||
/*solo.clickOnText(aContext.getString(org.linphone.R.string.button_edit));
|
||||
solo.sleep(1000);
|
||||
solo.clickOnView(solo.getView(org.linphone.R.id.delete));
|
||||
solo.clickOnText(aContext.getString(org.linphone.R.string.button_ok));
|
||||
|
||||
solo.sleep(1000);
|
||||
Assert.assertTrue(solo.searchText(aContext.getString(org.linphone.R.string.no_chat_history)));
|
||||
Assert.assertTrue(solo.searchText(aContext.getString(org.linphone.R.string.no_chat_history)));*/
|
||||
}
|
||||
|
||||
private void goToChat() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue