Rework and rename incoming call and outgoing call activity
This commit is contained in:
parent
23e66f1c70
commit
24af401775
15 changed files with 765 additions and 727 deletions
|
@ -89,7 +89,7 @@
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name="org.linphone.IncomingCallActivity"
|
<activity android:name=".CallIncomingActivity"
|
||||||
android:theme="@style/NoTitle"
|
android:theme="@style/NoTitle"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name="org.linphone.OutgoingCallActivity"
|
<activity android:name=".CallOutgoingActivity"
|
||||||
android:theme="@style/NoTitle"
|
android:theme="@style/NoTitle"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name="org.linphone.InCallActivity"
|
<activity android:name=".CallActivity"
|
||||||
android:theme="@style/FullScreen"
|
android:theme="@style/FullScreen"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:launchMode="singleTop">
|
android:launchMode="singleTop">
|
||||||
|
|
117
res/layout/call_incoming.xml
Normal file
117
res/layout/call_incoming.xml
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/topLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/colorH">
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/status"
|
||||||
|
android:name="org.linphone.StatusFragment"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
tools:layout="@layout/status" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/top_bar"
|
||||||
|
android:background="@color/colorF"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_below="@id/status">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:text="@string/incoming_call"
|
||||||
|
style="@style/font1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:gravity="center"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/contact_detail"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@id/menu"
|
||||||
|
android:layout_below="@id/top_bar"
|
||||||
|
android:paddingTop="10dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/contact_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:padding="5dp"
|
||||||
|
style="@style/font5"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/contact_number"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/font2"
|
||||||
|
android:layout_below="@id/contact_name"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:padding="5dp"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/avatar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/contact_number"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/contact_picture"
|
||||||
|
android:src="@drawable/avatar"
|
||||||
|
android:contentDescription="@string/content_description_contact_picture"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:adjustViewBounds="true"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:src="@drawable/avatar_mask"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_alignParentTop="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/menu"
|
||||||
|
android:visibility="visible"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/decline"
|
||||||
|
android:src="@drawable/call_hangup"
|
||||||
|
android:background="@drawable/hangup"
|
||||||
|
android:contentDescription="@string/content_description_decline"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:padding="15dp"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/accept"
|
||||||
|
android:src="@drawable/call_audio_start"
|
||||||
|
android:background="@drawable/call"
|
||||||
|
android:contentDescription="@string/content_description_accept"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:padding="15dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
|
@ -9,77 +9,88 @@
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/status"
|
android:id="@+id/status"
|
||||||
android:name="org.linphone.StatusFragment"
|
android:name="org.linphone.StatusFragment"
|
||||||
|
tools:layout="@layout/status"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"/>
|
||||||
tools:layout="@layout/status" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/top_bar"
|
||||||
|
android:background="@color/colorF"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_below="@id/status"
|
android:layout_below="@id/status">
|
||||||
android:background="@color/colorF">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:text="@string/outgoing_call"
|
||||||
|
style="@style/font1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
style="@style/font1"
|
|
||||||
android:text="@string/outgoing_call"
|
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:gravity="center"/>
|
android:gravity="center"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
|
android:id="@+id/contact_detail"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_below="@id/toolbar"
|
android:layout_above="@id/menu"
|
||||||
android:orientation="vertical"
|
android:layout_below="@id/top_bar"
|
||||||
android:gravity="center"
|
|
||||||
android:layout_above="@id/menu">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/incoming_caller_profile"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingTop="10dp">
|
android:paddingTop="10dp">
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/incoming_picture"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:src="@drawable/avatar"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:layout_marginTop="10dp"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/incoming_caller_name"
|
android:id="@+id/contact_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_alignParentTop="true"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:padding="5dp"
|
||||||
style="@style/font5"/>
|
style="@style/font5"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/incoming_caller_number"
|
android:id="@+id/contact_number"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/font2"
|
style="@style/font2"
|
||||||
android:layout_gravity="center"/>
|
android:layout_below="@id/contact_name"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:padding="5dp"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/avatar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/contact_number"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:id="@+id/contact_picture"
|
||||||
|
android:src="@drawable/avatar"
|
||||||
|
android:contentDescription="@string/content_description_contact_picture"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:adjustViewBounds="true"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:src="@drawable/avatar_mask"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_alignParentTop="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<org.linphone.mediastream.video.display.GL2JNIView
|
<org.linphone.mediastream.video.display.GL2JNIView
|
||||||
|
android:id="@+id/videoSurface"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:id="@+id/videoSurface"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/menu"
|
android:id="@+id/menu"
|
||||||
|
@ -93,20 +104,20 @@
|
||||||
android:id="@+id/micro"
|
android:id="@+id/micro"
|
||||||
android:src="@drawable/micro_default"
|
android:src="@drawable/micro_default"
|
||||||
android:background="@drawable/button_background"
|
android:background="@drawable/button_background"
|
||||||
|
android:contentDescription="@string/content_description_toggle_micro"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:contentDescription="@string/content_description_pause"
|
|
||||||
android:padding="15dp"/>
|
android:padding="15dp"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/speaker"
|
android:id="@+id/speaker"
|
||||||
android:src="@drawable/speaker_default"
|
android:src="@drawable/speaker_default"
|
||||||
android:background="@drawable/button_background"
|
android:background="@drawable/button_background"
|
||||||
|
android:contentDescription="@string/content_description_toggle_speaker"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:contentDescription="@string/content_description_pause"
|
|
||||||
android:padding="20dp"/>
|
android:padding="20dp"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
|
@ -1,112 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/topLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<fragment
|
|
||||||
android:id="@+id/status"
|
|
||||||
android:name="org.linphone.StatusFragment"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
tools:layout="@layout/status" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_below="@id/status"
|
|
||||||
android:background="@color/colorF">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
style="@style/font1"
|
|
||||||
android:text="@string/incoming_call"
|
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:gravity="center"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_below="@id/toolbar"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_above="@id/menu">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/incoming_caller_profile"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingTop="10dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/incoming_picture"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:src="@drawable/avatar"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:layout_marginTop="10dp"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/incoming_caller_name"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:textAlignment="center"
|
|
||||||
style="@style/font5"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/incoming_caller_number"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/font2"
|
|
||||||
android:layout_gravity="center"/>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<org.linphone.mediastream.video.display.GL2JNIView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dip"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:id="@+id/videoSurface"
|
|
||||||
android:visibility="gone" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/menu"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="70dp"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:orientation="horizontal" >
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/decline"
|
|
||||||
android:src="@drawable/call_hangup"
|
|
||||||
android:background="@drawable/hangup"
|
|
||||||
android:contentDescription="@string/content_description_pause"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:padding="15dp"/>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/accept"
|
|
||||||
android:src="@drawable/call_audio_start"
|
|
||||||
android:background="@drawable/call"
|
|
||||||
android:contentDescription="@string/content_description_pause"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:padding="15dp"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
|
@ -22,7 +22,7 @@
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow android:layout_weight="1" android:gravity="center">
|
<TableRow android:layout_weight="1" android:gravity="center">
|
||||||
<org.linphone.ui.Digit android:id="@+id/DigitStar" android:text="*" style="@style/DialerDigit" android:background="@drawable/numpad_star" android:soundEffectsEnabled="true" />
|
<org.linphone.ui.Digit android:id="@+id/DigitStar" android:text="*" style="@style/DialerDigit" android:background="@drawable/numpad_star_digit" android:soundEffectsEnabled="true" />
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit00" android:text="0+" style="@style/DialerDigit" android:background="@drawable/numpad_zero" android:soundEffectsEnabled="true" />
|
<org.linphone.ui.Digit android:id="@+id/Digit00" android:text="0+" style="@style/DialerDigit" android:background="@drawable/numpad_zero" android:soundEffectsEnabled="true" />
|
||||||
<org.linphone.ui.Digit android:id="@+id/DigitHash" android:text="#" style="@style/DialerDigit" android:background="@drawable/numpad_sharp" android:soundEffectsEnabled="true" />
|
<org.linphone.ui.Digit android:id="@+id/DigitHash" android:text="#" style="@style/DialerDigit" android:background="@drawable/numpad_sharp" android:soundEffectsEnabled="true" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
|
@ -30,7 +30,7 @@ import android.view.ViewGroup;
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
*/
|
*/
|
||||||
public class AudioCallFragment extends Fragment {
|
public class AudioCallFragment extends Fragment {
|
||||||
private InCallActivity incallActvityInstance;
|
private CallActivity incallActvityInstance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
@ -42,7 +42,7 @@ public class AudioCallFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Activity activity) {
|
public void onAttach(Activity activity) {
|
||||||
super.onAttach(activity);
|
super.onAttach(activity);
|
||||||
incallActvityInstance = (InCallActivity) activity;
|
incallActvityInstance = (CallActivity) activity;
|
||||||
|
|
||||||
if (incallActvityInstance != null) {
|
if (incallActvityInstance != null) {
|
||||||
incallActvityInstance.bindAudioFragment(this);
|
incallActvityInstance.bindAudioFragment(this);
|
||||||
|
@ -55,7 +55,7 @@ public class AudioCallFragment extends Fragment {
|
||||||
|
|
||||||
// Just to be sure we have incall controls
|
// Just to be sure we have incall controls
|
||||||
if (incallActvityInstance != null) {
|
if (incallActvityInstance != null) {
|
||||||
incallActvityInstance.setCallControlsVisibleAndRemoveCallbacks();
|
incallActvityInstance.removeCallbacks();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,29 +34,33 @@ import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||||
import org.linphone.ui.Numpad;
|
import org.linphone.ui.Numpad;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.FragmentManager;
|
import android.app.Dialog;
|
||||||
import android.app.FragmentTransaction;
|
import android.app.FragmentTransaction;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.media.Image;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.CountDownTimer;
|
import android.os.CountDownTimer;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
import android.view.animation.Animation.AnimationListener;
|
import android.view.animation.Animation.AnimationListener;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.Chronometer;
|
import android.widget.Chronometer;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
@ -68,19 +72,19 @@ import android.widget.Toast;
|
||||||
/**
|
/**
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
*/
|
*/
|
||||||
public class InCallActivity extends Activity implements OnClickListener {
|
public class CallActivity extends Activity implements OnClickListener {
|
||||||
private final static int SECONDS_BEFORE_HIDING_CONTROLS = 3000;
|
private final static int SECONDS_BEFORE_HIDING_CONTROLS = 10000;
|
||||||
private final static int SECONDS_BEFORE_DENYING_CALL_UPDATE = 30000;
|
private final static int SECONDS_BEFORE_DENYING_CALL_UPDATE = 30000;
|
||||||
|
|
||||||
private static InCallActivity instance;
|
private static CallActivity instance;
|
||||||
|
|
||||||
private Handler mControlsHandler = new Handler();
|
private Handler mControlsHandler = new Handler();
|
||||||
private Runnable mControls;
|
private Runnable mControls;
|
||||||
private ImageView switchCamera;
|
private ImageView switchCamera;
|
||||||
private RelativeLayout mActiveCallHeader;
|
private RelativeLayout mActiveCallHeader, sideMenuContent, avatar_layout;
|
||||||
private ImageView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference, conferenceStatus;
|
private ImageView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference, conferenceStatus, contactPicture;
|
||||||
private TextView audioRoute, routeSpeaker, routeReceiver, routeBluetooth;
|
private ImageView audioRoute, routeSpeaker, routeEarpiece, routeBluetooth, menu;
|
||||||
private LinearLayout routeLayout, mNoCurrentCall;
|
private LinearLayout routeLayout, mNoCurrentCall, callInfo;
|
||||||
private ProgressBar videoProgress;
|
private ProgressBar videoProgress;
|
||||||
private StatusFragment status;
|
private StatusFragment status;
|
||||||
private AudioCallFragment audioCallFragment;
|
private AudioCallFragment audioCallFragment;
|
||||||
|
@ -92,15 +96,15 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
private Animation slideOutLeftToRight, slideInRightToLeft, slideInBottomToTop, slideInTopToBottom, slideOutBottomToTop, slideOutTopToBottom;
|
private Animation slideOutLeftToRight, slideInRightToLeft, slideInBottomToTop, slideInTopToBottom, slideOutBottomToTop, slideOutTopToBottom;
|
||||||
private CountDownTimer timer;
|
private CountDownTimer timer;
|
||||||
private boolean isVideoCallPaused = false;
|
private boolean isVideoCallPaused = false;
|
||||||
AcceptCallUpdateDialogFragment callUpdateDialog;
|
|
||||||
|
|
||||||
private LinearLayout callsList, conferenceList;
|
private LinearLayout callsList, conferenceList;
|
||||||
private LayoutInflater inflater;
|
private LayoutInflater inflater;
|
||||||
private ViewGroup container;
|
private ViewGroup container;
|
||||||
private boolean isConferenceRunning = false;
|
private boolean isConferenceRunning = false;
|
||||||
private LinphoneCoreListenerBase mListener;
|
private LinphoneCoreListenerBase mListener;
|
||||||
|
private DrawerLayout sideMenu;
|
||||||
|
|
||||||
public static InCallActivity instance() {
|
public static CallActivity instance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,8 +137,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w("State " + message);
|
|
||||||
|
|
||||||
if (state == State.IncomingReceived) {
|
if (state == State.IncomingReceived) {
|
||||||
startIncomingCallActivity();
|
startIncomingCallActivity();
|
||||||
return;
|
return;
|
||||||
|
@ -142,7 +144,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
if (state == State.Paused || state == State.PausedByRemote || state == State.Pausing) {
|
if (state == State.Paused || state == State.PausedByRemote || state == State.Pausing) {
|
||||||
if(LinphoneManager.getLc().getCurrentCall() != null)
|
if(LinphoneManager.getLc().getCurrentCall() != null)
|
||||||
Log.w(LinphoneManager.getLc().getCurrentCall().getRemoteContact());
|
|
||||||
enabledVideoButton(false);
|
enabledVideoButton(false);
|
||||||
if(isVideoEnabled(call)){
|
if(isVideoEnabled(call)){
|
||||||
showAudioView();
|
showAudioView();
|
||||||
|
@ -156,6 +157,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
showVideoView();
|
showVideoView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
enabledVideoButton(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == State.StreamsRunning) {
|
if (state == State.StreamsRunning) {
|
||||||
|
@ -172,7 +174,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
videoProgress.setVisibility(View.GONE);
|
videoProgress.setVisibility(View.GONE);
|
||||||
//status.refreshStatusItems(call, isVideoEnabled(call));
|
status.refreshStatusItems(call, isVideoEnabled(call));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,8 +195,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
timer = new CountDownTimer(SECONDS_BEFORE_DENYING_CALL_UPDATE, 1000) {
|
timer = new CountDownTimer(SECONDS_BEFORE_DENYING_CALL_UPDATE, 1000) {
|
||||||
public void onTick(long millisUntilFinished) { }
|
public void onTick(long millisUntilFinished) { }
|
||||||
public void onFinish() {
|
public void onFinish() {
|
||||||
if (callUpdateDialog != null)
|
//TODO dismiss dialog
|
||||||
callUpdateDialog.dismiss();
|
|
||||||
acceptCallUpdate(false);
|
acceptCallUpdate(false);
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
|
@ -210,7 +211,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshIncallUi();
|
refreshIncallUi();
|
||||||
|
|
||||||
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
|
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,6 +324,8 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
//Others
|
//Others
|
||||||
|
|
||||||
//Active Call
|
//Active Call
|
||||||
|
callInfo = (LinearLayout) findViewById(R.id.call_header_description);
|
||||||
|
|
||||||
pause = (ImageView) findViewById(R.id.pause);
|
pause = (ImageView) findViewById(R.id.pause);
|
||||||
pause.setOnClickListener(this);
|
pause.setOnClickListener(this);
|
||||||
pause.setEnabled(false);
|
pause.setEnabled(false);
|
||||||
|
@ -331,6 +333,9 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
mActiveCallHeader = (RelativeLayout) findViewById(R.id.activeCallHeader);
|
mActiveCallHeader = (RelativeLayout) findViewById(R.id.activeCallHeader);
|
||||||
mNoCurrentCall = (LinearLayout) findViewById(R.id.noCurrentCall);
|
mNoCurrentCall = (LinearLayout) findViewById(R.id.noCurrentCall);
|
||||||
|
|
||||||
|
contactPicture = (ImageView) findViewById(R.id.contact_picture);
|
||||||
|
avatar_layout = (RelativeLayout) findViewById(R.id.avatar_layout);
|
||||||
|
|
||||||
/*if(isTablet()){
|
/*if(isTablet()){
|
||||||
speaker.setEnabled(false);
|
speaker.setEnabled(false);
|
||||||
}*/
|
}*/
|
||||||
|
@ -351,22 +356,19 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
conference.setEnabled(false);
|
conference.setEnabled(false);
|
||||||
conference.setOnClickListener(this);
|
conference.setOnClickListener(this);
|
||||||
|
|
||||||
|
try {
|
||||||
|
//routeLayout = (LinearLayout) findViewById(R.id.routesLayout);
|
||||||
|
audioRoute = (ImageView) findViewById(R.id.audioRoute);
|
||||||
/*try {
|
|
||||||
routeLayout = (LinearLayout) findViewById(R.id.routesLayout);
|
|
||||||
audioRoute = (TextView) findViewById(R.id.audioRoute);
|
|
||||||
audioRoute.setOnClickListener(this);
|
audioRoute.setOnClickListener(this);
|
||||||
routeSpeaker = (TextView) findViewById(R.id.routeSpeaker);
|
routeSpeaker = (ImageView) findViewById(R.id.routeSpeaker);
|
||||||
routeSpeaker.setOnClickListener(this);
|
routeSpeaker.setOnClickListener(this);
|
||||||
routeReceiver = (TextView) findViewById(R.id.routeReceiver);
|
routeEarpiece = (ImageView) findViewById(R.id.routeEarpiece);
|
||||||
routeReceiver.setOnClickListener(this);
|
routeEarpiece.setOnClickListener(this);
|
||||||
routeBluetooth = (TextView) findViewById(R.id.routeBluetooth);
|
routeBluetooth = (ImageView) findViewById(R.id.routeBluetooth);
|
||||||
routeBluetooth.setOnClickListener(this);
|
routeBluetooth.setOnClickListener(this);
|
||||||
} catch (NullPointerException npe) {
|
} catch (NullPointerException npe) {
|
||||||
Log.e("Bluetooth: Audio routes menu disabled on tablets for now (1)");
|
Log.e("Bluetooth: Audio routes menu disabled on tablets for now (1)");
|
||||||
}*/
|
}
|
||||||
|
|
||||||
switchCamera = (ImageView) findViewById(R.id.switchCamera);
|
switchCamera = (ImageView) findViewById(R.id.switchCamera);
|
||||||
switchCamera.setOnClickListener(this);
|
switchCamera.setOnClickListener(this);
|
||||||
|
@ -402,9 +404,30 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
} catch (NullPointerException npe) { Log.e("Bluetooth: Audio routes menu disabled on tablets for now (3)"); }
|
} catch (NullPointerException npe) { Log.e("Bluetooth: Audio routes menu disabled on tablets for now (3)"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createInCallStats();
|
||||||
LinphoneManager.getInstance().changeStatusToOnThePhone();
|
LinphoneManager.getInstance().changeStatusToOnThePhone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void createInCallStats() {
|
||||||
|
sideMenu = (DrawerLayout) findViewById(R.id.call_stats);
|
||||||
|
menu = (ImageView) findViewById(R.id.call_quality);
|
||||||
|
|
||||||
|
sideMenuContent = (RelativeLayout) findViewById(R.id.side_menu_content);
|
||||||
|
|
||||||
|
menu.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if(sideMenu.isDrawerVisible(Gravity.LEFT)){
|
||||||
|
sideMenu.closeDrawer(sideMenuContent);
|
||||||
|
} else {
|
||||||
|
sideMenu.openDrawer(sideMenuContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
status.initCallStatsRefresher(LinphoneManager.getLc().getCurrentCall(), findViewById(R.id.incall_stats));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void refreshIncallUi(){
|
private void refreshIncallUi(){
|
||||||
refreshInCallActions();
|
refreshInCallActions();
|
||||||
|
@ -437,24 +460,21 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
micro.setImageResource(R.drawable.micro_default);
|
micro.setImageResource(R.drawable.micro_default);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (isSpeakerEnabled) {
|
||||||
|
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_selected);
|
||||||
|
routeEarpiece.setBackgroundResource(R.drawable.route_earpiece);
|
||||||
|
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth);
|
||||||
|
}
|
||||||
|
|
||||||
/*routeSpeaker.setBackgroundResource(R.drawable.route_speaker_on);
|
routeSpeaker.setBackgroundResource(R.drawable.route_speaker);
|
||||||
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
|
|
||||||
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);*/
|
|
||||||
|
|
||||||
/*routeSpeaker.setBackgroundResource(R.drawable.route_speaker_off);
|
|
||||||
if (BluetoothManager.getInstance().isUsingBluetoothAudioRoute()) {
|
if (BluetoothManager.getInstance().isUsingBluetoothAudioRoute()) {
|
||||||
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
|
routeEarpiece.setBackgroundResource(R.drawable.route_earpiece);
|
||||||
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_on);
|
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_selected);
|
||||||
} else {
|
} else {
|
||||||
routeReceiver.setBackgroundResource(R.drawable.route_receiver_on);
|
routeEarpiece.setBackgroundResource(R.drawable.route_earpiece_selected);
|
||||||
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
|
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth);
|
||||||
}*/
|
}
|
||||||
} catch (NullPointerException npe) {
|
} catch (NullPointerException npe) {
|
||||||
Log.e("Bluetooth: Audio routes menu disabled on tablets for now (4)");
|
Log.e("Bluetooth: Audio routes menu disabled on tablets for now (4)");
|
||||||
}
|
}
|
||||||
|
@ -554,7 +574,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
hideOrDisplayAudioRoutes();
|
hideOrDisplayAudioRoutes();
|
||||||
}
|
}
|
||||||
else if (id == R.id.routeReceiver) {
|
else if (id == R.id.routeEarpiece) {
|
||||||
LinphoneManager.getInstance().routeAudioToReceiver();
|
LinphoneManager.getInstance().routeAudioToReceiver();
|
||||||
isSpeakerEnabled = false;
|
isSpeakerEnabled = false;
|
||||||
/*routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
|
/*routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
|
||||||
|
@ -647,9 +667,10 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showAudioView() {
|
private void showAudioView() {
|
||||||
LinphoneManager.startProximitySensorForActivity(InCallActivity.this);
|
LinphoneManager.startProximitySensorForActivity(CallActivity.this);
|
||||||
replaceFragmentVideoByAudio();
|
replaceFragmentVideoByAudio();
|
||||||
setCallControlsVisibleAndRemoveCallbacks();
|
displayAudioCall();
|
||||||
|
removeCallbacks();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showVideoView() {
|
private void showVideoView() {
|
||||||
|
@ -660,11 +681,53 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
refreshInCallActions();
|
refreshInCallActions();
|
||||||
|
|
||||||
LinphoneManager.stopProximitySensorForActivity(InCallActivity.this);
|
LinphoneManager.stopProximitySensorForActivity(CallActivity.this);
|
||||||
replaceFragmentAudioByVideo();
|
replaceFragmentAudioByVideo();
|
||||||
|
displayVideoCall(false);
|
||||||
displayVideoCallControlsIfHidden();
|
displayVideoCallControlsIfHidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void displayNoCurrentCall(boolean display){
|
||||||
|
if(!display) {
|
||||||
|
mActiveCallHeader.setVisibility(View.VISIBLE);
|
||||||
|
mNoCurrentCall.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
mActiveCallHeader.setVisibility(View.GONE);
|
||||||
|
mNoCurrentCall.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void displayAudioCall(){
|
||||||
|
mActiveCallHeader.setVisibility(View.VISIBLE);
|
||||||
|
callInfo.setVisibility(View.VISIBLE);
|
||||||
|
avatar_layout.setVisibility(View.VISIBLE);
|
||||||
|
mNoCurrentCall.setVisibility(View.GONE);
|
||||||
|
callsList.setVisibility(View.VISIBLE);
|
||||||
|
switchCamera.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void displayVideoCall(boolean display){
|
||||||
|
if(display) {
|
||||||
|
LinphoneActivity.instance().showStatusBar();
|
||||||
|
mControlsLayout.setVisibility(View.VISIBLE);
|
||||||
|
mActiveCallHeader.setVisibility(View.VISIBLE);
|
||||||
|
callInfo.setVisibility(View.VISIBLE);
|
||||||
|
avatar_layout.setVisibility(View.GONE);
|
||||||
|
mNoCurrentCall.setVisibility(View.GONE);
|
||||||
|
callsList.setVisibility(View.VISIBLE);
|
||||||
|
if (cameraNumber > 1) {
|
||||||
|
switchCamera.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LinphoneActivity.instance().hideStatusBar();
|
||||||
|
mControlsLayout.setVisibility(View.GONE);
|
||||||
|
mActiveCallHeader.setVisibility(View.GONE);
|
||||||
|
switchCamera.setVisibility(View.GONE);
|
||||||
|
mNoCurrentCall.setVisibility(View.GONE);
|
||||||
|
callsList.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void replaceFragmentVideoByAudio() {
|
private void replaceFragmentVideoByAudio() {
|
||||||
audioCallFragment = new AudioCallFragment();
|
audioCallFragment = new AudioCallFragment();
|
||||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||||
|
@ -677,8 +740,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
private void replaceFragmentAudioByVideo() {
|
private void replaceFragmentAudioByVideo() {
|
||||||
// Hiding controls to let displayVideoCallControlsIfHidden add them plus the callback
|
// Hiding controls to let displayVideoCallControlsIfHidden add them plus the callback
|
||||||
mControlsLayout.setVisibility(View.GONE);
|
|
||||||
switchCamera.setVisibility(View.INVISIBLE);
|
|
||||||
videoCallFragment = new VideoCallFragment();
|
videoCallFragment = new VideoCallFragment();
|
||||||
|
|
||||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||||
|
@ -689,20 +750,6 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayOrHideCallsHeader(boolean display){
|
|
||||||
if(display){
|
|
||||||
callsList.setVisibility(View.VISIBLE);
|
|
||||||
mActiveCallHeader.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
callsList.setVisibility(View.GONE);
|
|
||||||
mActiveCallHeader.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void displayNoCurrentCall(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void toggleMicro() {
|
private void toggleMicro() {
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
isMicMuted = !isMicMuted;
|
isMicMuted = !isMicMuted;
|
||||||
|
@ -771,21 +818,13 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
if (mControlsLayout != null) {
|
if (mControlsLayout != null) {
|
||||||
if (mControlsLayout.getVisibility() != View.VISIBLE) {
|
if (mControlsLayout.getVisibility() != View.VISIBLE) {
|
||||||
if (isAnimationDisabled) {
|
if (isAnimationDisabled) {
|
||||||
mControlsLayout.setVisibility(View.VISIBLE);
|
displayVideoCall(true);
|
||||||
displayOrHideCallsHeader(false);
|
|
||||||
if (cameraNumber > 1) {
|
|
||||||
switchCamera.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Animation animation = slideInBottomToTop;
|
Animation animation = slideInBottomToTop;
|
||||||
animation.setAnimationListener(new AnimationListener() {
|
animation.setAnimationListener(new AnimationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animation animation) {
|
public void onAnimationStart(Animation animation) {
|
||||||
mControlsLayout.setVisibility(View.VISIBLE);
|
displayVideoCall(true);
|
||||||
displayOrHideCallsHeader(false);
|
|
||||||
if (cameraNumber > 1) {
|
|
||||||
switchCamera.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -822,9 +861,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
video.setEnabled(true);
|
video.setEnabled(true);
|
||||||
transfer.setVisibility(View.INVISIBLE);
|
transfer.setVisibility(View.INVISIBLE);
|
||||||
addCall.setVisibility(View.INVISIBLE);
|
addCall.setVisibility(View.INVISIBLE);
|
||||||
mControlsLayout.setVisibility(View.GONE);
|
displayVideoCall(false);
|
||||||
displayOrHideCallsHeader(false);
|
|
||||||
switchCamera.setVisibility(View.INVISIBLE);
|
|
||||||
numpad.setVisibility(View.GONE);
|
numpad.setVisibility(View.GONE);
|
||||||
options.setImageResource(R.drawable.options_default);
|
options.setImageResource(R.drawable.options_default);
|
||||||
} else {
|
} else {
|
||||||
|
@ -844,12 +881,9 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
video.setEnabled(true); // HACK: Used to avoid controls from being hided if video is switched while controls are hiding
|
video.setEnabled(true); // HACK: Used to avoid controls from being hided if video is switched while controls are hiding
|
||||||
transfer.setVisibility(View.INVISIBLE);
|
transfer.setVisibility(View.INVISIBLE);
|
||||||
addCall.setVisibility(View.INVISIBLE);
|
addCall.setVisibility(View.INVISIBLE);
|
||||||
mControlsLayout.setVisibility(View.GONE);
|
displayVideoCall(false);
|
||||||
displayOrHideCallsHeader(false);
|
|
||||||
switchCamera.setVisibility(View.INVISIBLE);
|
|
||||||
numpad.setVisibility(View.GONE);
|
numpad.setVisibility(View.GONE);
|
||||||
options.setImageResource(R.drawable.options_default);
|
options.setImageResource(R.drawable.options_default);
|
||||||
|
|
||||||
animation.setAnimationListener(null);
|
animation.setAnimationListener(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -863,14 +897,11 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCallControlsVisibleAndRemoveCallbacks() {
|
public void removeCallbacks() {
|
||||||
if (mControlsHandler != null && mControls != null) {
|
if (mControlsHandler != null && mControls != null) {
|
||||||
mControlsHandler.removeCallbacks(mControls);
|
mControlsHandler.removeCallbacks(mControls);
|
||||||
}
|
}
|
||||||
mControls = null;
|
mControls = null;
|
||||||
|
|
||||||
mControlsLayout.setVisibility(View.VISIBLE);
|
|
||||||
switchCamera.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hideNumpad() {
|
private void hideNumpad() {
|
||||||
|
@ -981,7 +1012,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
public void onAnimationEnd(Animation animation) {
|
public void onAnimationEnd(Animation animation) {
|
||||||
transfer.setAnimation(null);
|
transfer.setAnimation(null);
|
||||||
transfer.setVisibility(View.INVISIBLE);
|
transfer.setVisibility(View.INVISIBLE);
|
||||||
animation = AnimationUtils.loadAnimation(InCallActivity.this, R.anim.slide_out_top_to_bottom); // Reload animation to prevent transfer button to blink
|
animation = AnimationUtils.loadAnimation(CallActivity.this, R.anim.slide_out_top_to_bottom); // Reload animation to prevent transfer button to blink
|
||||||
animation.setAnimationListener(new AnimationListener() {
|
animation.setAnimationListener(new AnimationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animation animation) {
|
public void onAnimationStart(Animation animation) {
|
||||||
|
@ -1089,13 +1120,11 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
if (routeSpeaker.getVisibility() == View.VISIBLE) {
|
if (routeSpeaker.getVisibility() == View.VISIBLE) {
|
||||||
routeSpeaker.setVisibility(View.GONE);
|
routeSpeaker.setVisibility(View.GONE);
|
||||||
routeBluetooth.setVisibility(View.GONE);
|
routeBluetooth.setVisibility(View.GONE);
|
||||||
routeReceiver.setVisibility(View.GONE);
|
routeEarpiece.setVisibility(View.GONE);
|
||||||
audioRoute.setSelected(false);
|
|
||||||
} else {
|
} else {
|
||||||
routeSpeaker.setVisibility(View.VISIBLE);
|
routeSpeaker.setVisibility(View.VISIBLE);
|
||||||
routeBluetooth.setVisibility(View.VISIBLE);
|
routeBluetooth.setVisibility(View.VISIBLE);
|
||||||
routeReceiver.setVisibility(View.VISIBLE);
|
routeEarpiece.setVisibility(View.VISIBLE);
|
||||||
audioRoute.setSelected(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1177,15 +1206,49 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startIncomingCallActivity() {
|
public void startIncomingCallActivity() {
|
||||||
startActivity(new Intent(this, IncomingCallActivity.class));
|
startActivity(new Intent(this, CallIncomingActivity.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void showAcceptCallUpdateDialog() {
|
private void showAcceptCallUpdateDialog() {
|
||||||
FragmentManager fm = getFragmentManager();
|
final Dialog dialog = new Dialog(this);
|
||||||
callUpdateDialog = new AcceptCallUpdateDialogFragment();
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
callUpdateDialog.show(fm, "Accept Call Update Dialog");
|
Drawable d = new ColorDrawable(getResources().getColor(R.color.colorC));
|
||||||
|
d.setAlpha(200);
|
||||||
|
dialog.setContentView(R.layout.dialog);
|
||||||
|
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT);
|
||||||
|
dialog.getWindow().setBackgroundDrawable(d);
|
||||||
|
|
||||||
|
TextView customText = (TextView) dialog.findViewById(R.id.customText);
|
||||||
|
customText.setText(getResources().getString(R.string.call_update_video));
|
||||||
|
Button delete = (Button) dialog.findViewById(R.id.delete);
|
||||||
|
delete.setText(R.string.accept);
|
||||||
|
Button cancel = (Button) dialog.findViewById(R.id.cancel);
|
||||||
|
cancel.setText(R.string.decline);
|
||||||
|
|
||||||
|
delete.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (CallActivity.isInstanciated()) {
|
||||||
|
Log.d("Call Update Accepted");
|
||||||
|
CallActivity.instance().acceptCallUpdate(true);
|
||||||
|
}
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
cancel.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (CallActivity.isInstanciated()) {
|
||||||
|
Log.d("Call Update Denied");
|
||||||
|
CallActivity.instance().acceptCallUpdate(false);
|
||||||
|
}
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1198,7 +1261,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
displayConference();
|
displayConference();
|
||||||
} else {
|
} else {
|
||||||
LinphoneManager.startProximitySensorForActivity(this);
|
LinphoneManager.startProximitySensorForActivity(this);
|
||||||
setCallControlsVisibleAndRemoveCallbacks();
|
removeCallbacks();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
@ -1331,15 +1394,20 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), lAddress);
|
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), lAddress);
|
||||||
if (lContact == null) {
|
if (lContact == null) {
|
||||||
if (getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
|
|
||||||
contact.setText(lAddress.getUserName());
|
contact.setText(lAddress.getUserName());
|
||||||
} else {
|
|
||||||
contact.setText(sipUri);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
contact.setText(lContact.getName());
|
contact.setText(lContact.getName());
|
||||||
|
LinphoneUtils.setImagePictureFromUri(contactPicture.getContext(), contactPicture, lContact.getPhotoUri(), lContact.getThumbnailUri());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*if(contact != null) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
displayOrHideContactPicture(imageView, null, null, false);
|
||||||
|
}
|
||||||
|
callsList.addView(imageView);*/
|
||||||
|
|
||||||
int callDuration = call.getDuration();
|
int callDuration = call.getDuration();
|
||||||
if (callDuration == 0 && call.getState() != State.StreamsRunning) {
|
if (callDuration == 0 && call.getState() != State.StreamsRunning) {
|
||||||
return;
|
return;
|
||||||
|
@ -1372,11 +1440,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), lAddress);
|
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), lAddress);
|
||||||
if (lContact == null) {
|
if (lContact == null) {
|
||||||
if (getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
|
|
||||||
contact.setText(lAddress.getUserName());
|
contact.setText(lAddress.getUserName());
|
||||||
} else {
|
|
||||||
contact.setText(sipUri);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
contact.setText(lContact.getName());
|
contact.setText(lContact.getName());
|
||||||
}
|
}
|
||||||
|
@ -1386,13 +1450,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
callsList.addView(callView);
|
callsList.addView(callView);
|
||||||
|
|
||||||
// Image Row
|
// Image Row
|
||||||
//Contact contact = ContactsManager.getInstance().findContactWithAddress(imageView.getContext().getContentResolver(), lAddress);
|
|
||||||
/*if(contact != null) {
|
|
||||||
displayOrHideContactPicture(imageView, contact.getPhotoUri(), contact.getThumbnailUri(), false);
|
|
||||||
} else {
|
|
||||||
displayOrHideContactPicture(imageView, null, null, false);
|
|
||||||
}
|
|
||||||
callsList.addView(imageView);*/
|
|
||||||
|
|
||||||
|
|
||||||
// callView.setTag(imageView);
|
// callView.setTag(imageView);
|
||||||
|
@ -1416,11 +1474,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
Contact lContact = ContactsManager.getInstance().findContactWithAddress(callView.getContext().getContentResolver(), lAddress);
|
Contact lContact = ContactsManager.getInstance().findContactWithAddress(callView.getContext().getContentResolver(), lAddress);
|
||||||
if (lContact == null) {
|
if (lContact == null) {
|
||||||
if (resources.getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
|
|
||||||
contact.setText(lAddress.getUserName());
|
contact.setText(lAddress.getUserName());
|
||||||
} else {
|
|
||||||
contact.setText(sipUri);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
contact.setText(lContact.getName());
|
contact.setText(lContact.getName());
|
||||||
}
|
}
|
||||||
|
@ -1457,7 +1511,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
private void displayOrHideContactPicture(LinearLayout callView, Uri pictureUri, Uri thumbnailUri, boolean hide) {
|
private void displayOrHideContactPicture(LinearLayout callView, Uri pictureUri, Uri thumbnailUri, boolean hide) {
|
||||||
/*ImageView contactPicture = (ImageView) callView.findViewById(R.id.contactPicture);
|
/*ImageView contactPicture = (ImageView) callView.findViewById(R.id.contactPicture);
|
||||||
if (pictureUri != null) {
|
if (pictureUri != null) {
|
||||||
LinphoneUtils.setImagePictureFromUri(callView.getContext(), contactPicture, Uri.parse(pictureUri.toString()), thumbnailUri, R.drawable.unknown_small);
|
|
||||||
}
|
}
|
||||||
callView.setVisibility(hide ? View.GONE : View.VISIBLE);*/
|
callView.setVisibility(hide ? View.GONE : View.VISIBLE);*/
|
||||||
}
|
}
|
||||||
|
@ -1535,7 +1589,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
LinphoneManager.getLc().addAllToConference();
|
LinphoneManager.getLc().addAllToConference();
|
||||||
displayConferenceHeader();
|
displayConferenceHeader();
|
||||||
mNoCurrentCall.setVisibility(View.GONE);
|
mNoCurrentCall.setVisibility(View.GONE);
|
||||||
displayOrHideCallsHeader(false);
|
mActiveCallHeader.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pauseOrResumeConference() {
|
public void pauseOrResumeConference() {
|
||||||
|
@ -1585,7 +1639,7 @@ public class InCallActivity extends Activity implements OnClickListener {
|
||||||
|
|
||||||
private void displayConference(){
|
private void displayConference(){
|
||||||
mControlsLayout.setVisibility(View.VISIBLE);
|
mControlsLayout.setVisibility(View.VISIBLE);
|
||||||
LinphoneManager.startProximitySensorForActivity(InCallActivity.this);
|
LinphoneManager.startProximitySensorForActivity(CallActivity.this);
|
||||||
mActiveCallHeader.setVisibility(View.GONE);
|
mActiveCallHeader.setVisibility(View.GONE);
|
||||||
mNoCurrentCall.setVisibility(View.GONE);
|
mNoCurrentCall.setVisibility(View.GONE);
|
||||||
callsList.setVisibility(View.VISIBLE);
|
callsList.setVisibility(View.VISIBLE);
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
IncomingCallActivity.java
|
CallIncomingActivity.java
|
||||||
Copyright (C) 2011 Belledonne Communications, Grenoble, France
|
Copyright (C) 2015 Belledonne Communications, Grenoble, France
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -35,27 +35,22 @@ import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
/**
|
public class CallIncomingActivity extends Activity implements LinphoneSliderTriggered {
|
||||||
* Activity displayed when a call comes in.
|
|
||||||
* It should bypass the screen lock mechanism.
|
|
||||||
*
|
|
||||||
* @author Guillaume Beraudo
|
|
||||||
*/
|
|
||||||
public class IncomingCallActivity extends Activity implements LinphoneSliderTriggered {
|
|
||||||
|
|
||||||
private static IncomingCallActivity instance;
|
private static CallIncomingActivity instance;
|
||||||
|
|
||||||
private TextView mNameView;
|
private TextView name, number;
|
||||||
private TextView mNumberView;
|
private ImageView contactPicture, acceptArrow, accept, decline;
|
||||||
private ImageView mPictureView;
|
|
||||||
private LinphoneCall mCall;
|
private LinphoneCall mCall;
|
||||||
private LinphoneCoreListenerBase mListener;
|
private LinphoneCoreListenerBase mListener;
|
||||||
|
private LinearLayout acceptUnlock;
|
||||||
private StatusFragment status;
|
private StatusFragment status;
|
||||||
|
|
||||||
public static IncomingCallActivity instance() {
|
public static CallIncomingActivity instance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,25 +63,24 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
setContentView(R.layout.incoming);
|
setContentView(R.layout.call_incoming);
|
||||||
|
|
||||||
mNameView = (TextView) findViewById(R.id.incoming_caller_name);
|
name = (TextView) findViewById(R.id.contact_name);
|
||||||
mNumberView = (TextView) findViewById(R.id.incoming_caller_number);
|
number = (TextView) findViewById(R.id.contact_number);
|
||||||
mPictureView = (ImageView) findViewById(R.id.incoming_picture);
|
contactPicture = (ImageView) findViewById(R.id.contact_picture);
|
||||||
|
|
||||||
// set this flag so this activity will stay in front of the keyguard
|
// set this flag so this activity will stay in front of the keyguard
|
||||||
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
|
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
|
||||||
getWindow().addFlags(flags);
|
getWindow().addFlags(flags);
|
||||||
|
|
||||||
ImageView accept = (ImageView) findViewById(R.id.accept);
|
accept = (ImageView) findViewById(R.id.accept);
|
||||||
accept.setOnClickListener(new View.OnClickListener() {
|
accept.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
answer();
|
answer();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
decline = (ImageView) findViewById(R.id.decline);
|
||||||
ImageView decline = (ImageView) findViewById(R.id.decline);
|
|
||||||
decline.setOnClickListener(new View.OnClickListener() {
|
decline.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -94,8 +88,6 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// "Dial-to-answer" widget for incoming calls.
|
|
||||||
|
|
||||||
mListener = new LinphoneCoreListenerBase(){
|
mListener = new LinphoneCoreListenerBase(){
|
||||||
@Override
|
@Override
|
||||||
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
|
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
|
||||||
|
@ -138,14 +130,14 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LinphoneAddress address = mCall.getRemoteAddress();
|
LinphoneAddress address = mCall.getRemoteAddress();
|
||||||
// May be greatly sped up using a drawable cache
|
|
||||||
Contact contact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), address);
|
Contact contact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), address);
|
||||||
//LinphoneUtils.setImagePictureFromUri(this, mPictureView, contact != null ? contact.getPhotoUri() : null,
|
if (contact != null) {
|
||||||
// contact != null ? contact.getThumbnailUri() : null, R.drawable.unknown_small);
|
LinphoneUtils.setImagePictureFromUri(this, contactPicture, contact.getPhotoUri(), contact.getThumbnailUri());
|
||||||
|
name.setText(contact.getName());
|
||||||
// To be done after findUriPictureOfContactAndSetDisplayName called
|
} else {
|
||||||
mNameView.setText(contact != null ? contact.getName() : address.getUserName());
|
name.setText(LinphoneUtils.getAddressDisplayName(address));
|
||||||
mNumberView.setText(address.asStringUriOnly());
|
}
|
||||||
|
number.setText(address.asStringUriOnly());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -183,12 +175,6 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
|
||||||
private void answer() {
|
private void answer() {
|
||||||
LinphoneCallParams params = LinphoneManager.getLc().createDefaultCallParameters();
|
LinphoneCallParams params = LinphoneManager.getLc().createDefaultCallParameters();
|
||||||
|
|
||||||
boolean isLowBandwidthConnection = !LinphoneUtils.isHighBandwidthConnection(this);
|
|
||||||
if (isLowBandwidthConnection) {
|
|
||||||
params.enableLowBandwidth(true);
|
|
||||||
Log.d("Low bandwidth enabled in call params");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!LinphoneManager.getInstance().acceptCallWithParams(mCall, params)) {
|
if (!LinphoneManager.getInstance().acceptCallWithParams(mCall, params)) {
|
||||||
// the above method takes care of Samsung Galaxy S
|
// the above method takes care of Samsung Galaxy S
|
||||||
Toast.makeText(this, R.string.couldnt_accept_call, Toast.LENGTH_LONG).show();
|
Toast.makeText(this, R.string.couldnt_accept_call, Toast.LENGTH_LONG).show();
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
IncomingCallActivity.java
|
CallOutgoingActivity.java
|
||||||
Copyright (C) 2011 Belledonne Communications, Grenoble, France
|
Copyright (C) 2015 Belledonne Communications, Grenoble, France
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -29,35 +29,26 @@ import org.linphone.core.LinphoneCoreListenerBase;
|
||||||
import org.linphone.mediastream.Log;
|
import org.linphone.mediastream.Log;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.KeyEvent;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.View.OnClickListener;
|
||||||
|
import android.view.KeyEvent;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import de.timroes.axmlrpc.Call;
|
public class CallOutgoingActivity extends Activity implements OnClickListener{
|
||||||
|
|
||||||
/**
|
private static CallOutgoingActivity instance;
|
||||||
* Activity displayed when a call comes in.
|
|
||||||
* It should bypass the screen lock mechanism.
|
|
||||||
*
|
|
||||||
* @author Guillaume Beraudo
|
|
||||||
*/
|
|
||||||
public class OutgoingCallActivity extends Activity {
|
|
||||||
|
|
||||||
private static OutgoingCallActivity instance;
|
private TextView name, number;
|
||||||
|
private ImageView contactPicture, micro, speaker, hangUp;
|
||||||
private TextView mNameView, mNumberView;
|
|
||||||
private ImageView mPictureView, micro, speaker, decline;
|
|
||||||
private LinphoneCall mCall;
|
private LinphoneCall mCall;
|
||||||
private LinphoneCoreListenerBase mListener;
|
private LinphoneCoreListenerBase mListener;
|
||||||
private boolean isMicMuted, isSpeakerEnabled;
|
private boolean isMicMuted, isSpeakerEnabled;
|
||||||
private StatusFragment status;
|
private StatusFragment status;
|
||||||
|
|
||||||
public static OutgoingCallActivity instance() {
|
public static CallOutgoingActivity instance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,63 +65,26 @@ public class OutgoingCallActivity extends Activity {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
setContentView(R.layout.outgoing_call);
|
setContentView(R.layout.call_outgoing);
|
||||||
|
|
||||||
mNameView = (TextView) findViewById(R.id.incoming_caller_name);
|
name = (TextView) findViewById(R.id.contact_name);
|
||||||
mNumberView = (TextView) findViewById(R.id.incoming_caller_number);
|
number = (TextView) findViewById(R.id.contact_number);
|
||||||
mPictureView = (ImageView) findViewById(R.id.incoming_picture);
|
contactPicture = (ImageView) findViewById(R.id.contact_picture);
|
||||||
|
|
||||||
micro = (ImageView) findViewById(R.id.micro);
|
|
||||||
micro.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
speaker = (ImageView) findViewById(R.id.speaker);
|
|
||||||
|
|
||||||
isMicMuted = false;
|
isMicMuted = false;
|
||||||
isSpeakerEnabled = false;
|
isSpeakerEnabled = false;
|
||||||
|
|
||||||
micro.setOnClickListener(new View.OnClickListener() {
|
micro = (ImageView) findViewById(R.id.micro);
|
||||||
@Override
|
micro.setOnClickListener(this);
|
||||||
public void onClick(View view) {
|
speaker = (ImageView) findViewById(R.id.speaker);
|
||||||
isMicMuted = !isMicMuted;
|
speaker.setOnClickListener(this);
|
||||||
if(isMicMuted) {
|
|
||||||
micro.setImageResource(R.drawable.micro_selected);
|
|
||||||
} else {
|
|
||||||
micro.setImageResource(R.drawable.micro_default);
|
|
||||||
}
|
|
||||||
LinphoneManager.getLc().muteMic(isMicMuted);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
speaker.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
isSpeakerEnabled = !isSpeakerEnabled;
|
|
||||||
if(isSpeakerEnabled) {
|
|
||||||
speaker.setImageResource(R.drawable.speaker_selected);
|
|
||||||
} else {
|
|
||||||
speaker.setImageResource(R.drawable.speaker_default);
|
|
||||||
}
|
|
||||||
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// set this flag so this activity will stay in front of the keyguard
|
// set this flag so this activity will stay in front of the keyguard
|
||||||
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
|
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
|
||||||
getWindow().addFlags(flags);
|
getWindow().addFlags(flags);
|
||||||
|
|
||||||
// "Dial-to-answer" widget for incoming calls.
|
hangUp = (ImageView) findViewById(R.id.hang_up);
|
||||||
|
hangUp.setOnClickListener(this);
|
||||||
ImageView decline = (ImageView) findViewById(R.id.hang_up);
|
|
||||||
decline.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
decline();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mListener = new LinphoneCoreListenerBase(){
|
mListener = new LinphoneCoreListenerBase(){
|
||||||
@Override
|
@Override
|
||||||
|
@ -174,27 +128,27 @@ public class OutgoingCallActivity extends Activity {
|
||||||
if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() != null) {
|
if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() != null) {
|
||||||
List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc());
|
List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc());
|
||||||
for (LinphoneCall call : calls) {
|
for (LinphoneCall call : calls) {
|
||||||
if (State.OutgoingInit == call.getState() || State.OutgoingProgress == call.getState()) {
|
if (State.OutgoingInit == call.getState() || State.OutgoingProgress == call.getState() || State.OutgoingRinging == call.getState() || State.OutgoingEarlyMedia == call.getState()) {
|
||||||
mCall = call;
|
mCall = call;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mCall == null) {
|
if (mCall == null) {
|
||||||
Log.e("Couldn't find incoming call");
|
Log.e("Couldn't find outgoing call");
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LinphoneAddress address = mCall.getRemoteAddress();
|
LinphoneAddress address = mCall.getRemoteAddress();
|
||||||
// May be greatly sped up using a drawable cache
|
|
||||||
Contact contact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), address);
|
Contact contact = ContactsManager.getInstance().findContactWithAddress(getContentResolver(), address);
|
||||||
//LinphoneUtils.setImagePictureFromUri(this, mPictureView, contact != null ? contact.getPhotoUri() : null,
|
if (contact != null) {
|
||||||
// contact != null ? contact.getThumbnailUri() : null, R.drawable.unknown_small);
|
LinphoneUtils.setImagePictureFromUri(this, contactPicture, contact.getPhotoUri(), contact.getThumbnailUri());
|
||||||
|
name.setText(contact.getName());
|
||||||
// To be done after findUriPictureOfContactAndSetDisplayName called
|
} else {
|
||||||
mNameView.setText(contact != null ? contact.getName() : address.getUserName());
|
name.setText(LinphoneUtils.getAddressDisplayName(address));
|
||||||
mNumberView.setText(address.asStringUriOnly());
|
}
|
||||||
|
number.setText(address.asStringUriOnly());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -212,6 +166,33 @@ public class OutgoingCallActivity extends Activity {
|
||||||
instance = null;
|
instance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
int id = v.getId();
|
||||||
|
|
||||||
|
if (id == R.id.micro) {
|
||||||
|
isMicMuted = !isMicMuted;
|
||||||
|
if(isMicMuted) {
|
||||||
|
micro.setImageResource(R.drawable.micro_selected);
|
||||||
|
} else {
|
||||||
|
micro.setImageResource(R.drawable.micro_default);
|
||||||
|
}
|
||||||
|
LinphoneManager.getLc().muteMic(isMicMuted);
|
||||||
|
}
|
||||||
|
if (id == R.id.speaker) {
|
||||||
|
isSpeakerEnabled = !isSpeakerEnabled;
|
||||||
|
if(isSpeakerEnabled) {
|
||||||
|
speaker.setImageResource(R.drawable.speaker_selected);
|
||||||
|
} else {
|
||||||
|
speaker.setImageResource(R.drawable.speaker_default);
|
||||||
|
}
|
||||||
|
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
|
||||||
|
}
|
||||||
|
if (id == R.id.hang_up) {
|
||||||
|
decline();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
if (LinphoneManager.isInstanciated() && (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_HOME)) {
|
if (LinphoneManager.isInstanciated() && (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_HOME)) {
|
||||||
|
@ -224,5 +205,4 @@ public class OutgoingCallActivity extends Activity {
|
||||||
private void decline() {
|
private void decline() {
|
||||||
LinphoneManager.getLc().terminateCall(mCall);
|
LinphoneManager.getLc().terminateCall(mCall);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -231,9 +231,9 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
|
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
|
||||||
if (state == State.IncomingReceived) {
|
if (state == State.IncomingReceived) {
|
||||||
//finish();
|
//finish();
|
||||||
startActivity(new Intent(LinphoneActivity.instance(), IncomingCallActivity.class));
|
startActivity(new Intent(LinphoneActivity.instance(), CallIncomingActivity.class));
|
||||||
} else if (state == State.OutgoingInit || state == State.OutgoingProgress) {
|
} else if (state == State.OutgoingInit || state == State.OutgoingProgress) {
|
||||||
startActivity(new Intent(LinphoneActivity.instance(), OutgoingCallActivity.class));
|
startActivity(new Intent(LinphoneActivity.instance(), CallOutgoingActivity.class));
|
||||||
} else if (state == State.CallEnd || state == State.Error || state == State.CallReleased) {
|
} else if (state == State.CallEnd || state == State.Error || state == State.CallReleased) {
|
||||||
// Convert LinphoneCore message for internalization
|
// Convert LinphoneCore message for internalization
|
||||||
if (message != null && call.getReason() == Reason.Declined) {
|
if (message != null && call.getReason() == Reason.Declined) {
|
||||||
|
@ -935,14 +935,14 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startVideoActivity(LinphoneCall currentCall) {
|
public void startVideoActivity(LinphoneCall currentCall) {
|
||||||
Intent intent = new Intent(this, InCallActivity.class);
|
Intent intent = new Intent(this, CallActivity.class);
|
||||||
intent.putExtra("VideoEnabled", true);
|
intent.putExtra("VideoEnabled", true);
|
||||||
startOrientationSensor();
|
startOrientationSensor();
|
||||||
startActivityForResult(intent, CALL_ACTIVITY);
|
startActivityForResult(intent, CALL_ACTIVITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startIncallActivity(LinphoneCall currentCall) {
|
public void startIncallActivity(LinphoneCall currentCall) {
|
||||||
Intent intent = new Intent(this, InCallActivity.class);
|
Intent intent = new Intent(this, CallActivity.class);
|
||||||
intent.putExtra("VideoEnabled", false);
|
intent.putExtra("VideoEnabled", false);
|
||||||
startOrientationSensor();
|
startOrientationSensor();
|
||||||
startActivityForResult(intent, CALL_ACTIVITY);
|
startActivityForResult(intent, CALL_ACTIVITY);
|
||||||
|
@ -1028,7 +1028,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc().getCallsNb() > 0) {
|
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc().getCallsNb() > 0) {
|
||||||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||||
if (call.getState() == LinphoneCall.State.IncomingReceived) {
|
if (call.getState() == LinphoneCall.State.IncomingReceived) {
|
||||||
startActivity(new Intent(LinphoneActivity.this, IncomingCallActivity.class));
|
startActivity(new Intent(LinphoneActivity.this, CallIncomingActivity.class));
|
||||||
} else if (call.getCurrentParamsCopy().getVideoEnabled()) {
|
} else if (call.getCurrentParamsCopy().getVideoEnabled()) {
|
||||||
startVideoActivity(call);
|
startVideoActivity(call);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1124,9 +1124,9 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||||
LinphoneCall.State callState = call.getState();
|
LinphoneCall.State callState = call.getState();
|
||||||
if (callState == State.IncomingReceived) {
|
if (callState == State.IncomingReceived) {
|
||||||
startActivity(new Intent(this, IncomingCallActivity.class));
|
startActivity(new Intent(this, CallIncomingActivity.class));
|
||||||
} else if (callState == State.OutgoingInit) {
|
} else if (callState == State.OutgoingInit) {
|
||||||
startActivity(new Intent(this, OutgoingCallActivity.class));
|
startActivity(new Intent(this, CallOutgoingActivity.class));
|
||||||
} else {
|
} else {
|
||||||
if (call.getCurrentParamsCopy().getVideoEnabled()) {
|
if (call.getCurrentParamsCopy().getVideoEnabled()) {
|
||||||
startVideoActivity(call);
|
startVideoActivity(call);
|
||||||
|
@ -1217,10 +1217,10 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
Collection<LinphoneCall.State> incoming = new ArrayList<LinphoneCall.State>();
|
Collection<LinphoneCall.State> incoming = new ArrayList<LinphoneCall.State>();
|
||||||
incoming.add(LinphoneCall.State.IncomingReceived);
|
incoming.add(LinphoneCall.State.IncomingReceived);
|
||||||
if (LinphoneUtils.getCallsInState(LinphoneManager.getLc(), incoming).size() > 0) {
|
if (LinphoneUtils.getCallsInState(LinphoneManager.getLc(), incoming).size() > 0) {
|
||||||
if (InCallActivity.isInstanciated()) {
|
if (CallActivity.isInstanciated()) {
|
||||||
InCallActivity.instance().startIncomingCallActivity();
|
CallActivity.instance().startIncomingCallActivity();
|
||||||
} else {
|
} else {
|
||||||
startActivity(new Intent(this, IncomingCallActivity.class));
|
startActivity(new Intent(this, CallIncomingActivity.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,6 +167,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
mRingbackSoundFile = basePath + "/ringback.wav";
|
mRingbackSoundFile = basePath + "/ringback.wav";
|
||||||
mPauseSoundFile = basePath + "/toy_mono.wav";
|
mPauseSoundFile = basePath + "/toy_mono.wav";
|
||||||
mChatDatabaseFile = basePath + "/linphone-history.db";
|
mChatDatabaseFile = basePath + "/linphone-history.db";
|
||||||
|
mCallLogDatabaseFile = basePath + "/linphone-log-history.db";
|
||||||
mErrorToneFile = basePath + "/error.wav";
|
mErrorToneFile = basePath + "/error.wav";
|
||||||
mConfigFile = basePath + "/configrc";
|
mConfigFile = basePath + "/configrc";
|
||||||
|
|
||||||
|
@ -190,6 +191,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
private final String mRingbackSoundFile;
|
private final String mRingbackSoundFile;
|
||||||
private final String mPauseSoundFile;
|
private final String mPauseSoundFile;
|
||||||
private final String mChatDatabaseFile;
|
private final String mChatDatabaseFile;
|
||||||
|
private final String mCallLogDatabaseFile;
|
||||||
private final String mErrorToneFile;
|
private final String mErrorToneFile;
|
||||||
private final String mConfigFile;
|
private final String mConfigFile;
|
||||||
private ByteArrayInputStream mUploadingImageStream;
|
private ByteArrayInputStream mUploadingImageStream;
|
||||||
|
@ -413,9 +415,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
LinphoneAddress lAddress;
|
LinphoneAddress lAddress;
|
||||||
try {
|
try {
|
||||||
lAddress = mLc.interpretUrl(to);
|
lAddress = mLc.interpretUrl(to);
|
||||||
if (mServiceContext.getResources().getBoolean(R.bool.override_domain_using_default_one)) {
|
|
||||||
lAddress.setDomain(mServiceContext.getString(R.string.default_domain));
|
|
||||||
}
|
|
||||||
LinphoneProxyConfig lpc = mLc.getDefaultProxyConfig();
|
LinphoneProxyConfig lpc = mLc.getDefaultProxyConfig();
|
||||||
|
|
||||||
if (mR.getBoolean(R.bool.forbid_self_call) && lpc!=null && lAddress.asStringUriOnly().equals(lpc.getIdentity())) {
|
if (mR.getBoolean(R.bool.forbid_self_call) && lpc!=null && lAddress.asStringUriOnly().equals(lpc.getIdentity())) {
|
||||||
|
@ -856,7 +855,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Contact contact = ContactsManager.getInstance().findContactWithAddress(mServiceContext.getContentResolver(), from);
|
Contact contact = ContactsManager.getInstance().findContactWithAddress(mServiceContext.getContentResolver(), from);
|
||||||
if (!mServiceContext.getResources().getBoolean(R.bool.disable_chat__message_notification)) {
|
if (!mServiceContext.getResources().getBoolean(R.bool.disable_chat_message_notification)) {
|
||||||
if (LinphoneActivity.isInstanciated() && !LinphoneActivity.instance().displayChatMessageNotification(from.asStringUriOnly())) {
|
if (LinphoneActivity.isInstanciated() && !LinphoneActivity.instance().displayChatMessageNotification(from.asStringUriOnly())) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -920,10 +919,10 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
try {
|
try {
|
||||||
if (LinphoneActivity.isInstanciated())
|
if (LinphoneActivity.isInstanciated())
|
||||||
return LinphoneActivity.instance();
|
return LinphoneActivity.instance();
|
||||||
else if (InCallActivity.isInstanciated())
|
else if (CallActivity.isInstanciated())
|
||||||
return InCallActivity.instance();
|
return CallActivity.instance();
|
||||||
else if (IncomingCallActivity.isInstanciated())
|
else if (CallIncomingActivity.isInstanciated())
|
||||||
return IncomingCallActivity.instance();
|
return CallIncomingActivity.instance();
|
||||||
else if (mServiceContext != null)
|
else if (mServiceContext != null)
|
||||||
return mServiceContext;
|
return mServiceContext;
|
||||||
else if (LinphoneService.isReady())
|
else if (LinphoneService.isReady())
|
||||||
|
|
|
@ -22,6 +22,8 @@ import java.util.TimerTask;
|
||||||
|
|
||||||
import org.linphone.assistant.AssistantActivity;
|
import org.linphone.assistant.AssistantActivity;
|
||||||
import org.linphone.core.LinphoneCall;
|
import org.linphone.core.LinphoneCall;
|
||||||
|
import org.linphone.core.LinphoneCallParams;
|
||||||
|
import org.linphone.core.LinphoneCallStats;
|
||||||
import org.linphone.core.LinphoneContent;
|
import org.linphone.core.LinphoneContent;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.LinphoneCore.MediaEncryption;
|
import org.linphone.core.LinphoneCore.MediaEncryption;
|
||||||
|
@ -29,6 +31,7 @@ import org.linphone.core.LinphoneCore.RegistrationState;
|
||||||
import org.linphone.core.LinphoneCoreListenerBase;
|
import org.linphone.core.LinphoneCoreListenerBase;
|
||||||
import org.linphone.core.LinphoneEvent;
|
import org.linphone.core.LinphoneEvent;
|
||||||
import org.linphone.core.LinphoneProxyConfig;
|
import org.linphone.core.LinphoneProxyConfig;
|
||||||
|
import org.linphone.core.PayloadType;
|
||||||
import org.linphone.mediastream.Log;
|
import org.linphone.mediastream.Log;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
@ -153,17 +156,17 @@ public class StatusFragment extends Fragment {
|
||||||
if (activity instanceof LinphoneActivity) {
|
if (activity instanceof LinphoneActivity) {
|
||||||
((LinphoneActivity) activity).updateStatusFragment(this);
|
((LinphoneActivity) activity).updateStatusFragment(this);
|
||||||
isInCall = false;
|
isInCall = false;
|
||||||
} else if (activity instanceof InCallActivity) {
|
} else if (activity instanceof CallActivity) {
|
||||||
((InCallActivity) activity).updateStatusFragment(this);
|
((CallActivity) activity).updateStatusFragment(this);
|
||||||
isInCall = true;
|
isInCall = true;
|
||||||
} else if (activity instanceof AssistantActivity) {
|
} else if (activity instanceof AssistantActivity) {
|
||||||
((AssistantActivity) activity).updateStatusFragment(this);
|
((AssistantActivity) activity).updateStatusFragment(this);
|
||||||
isInCall = false;
|
isInCall = false;
|
||||||
} else if (activity instanceof IncomingCallActivity) {
|
} else if (activity instanceof CallIncomingActivity) {
|
||||||
((IncomingCallActivity) activity).updateStatusFragment(this);
|
((CallIncomingActivity) activity).updateStatusFragment(this);
|
||||||
isInCall = true;
|
isInCall = true;
|
||||||
} else if (activity instanceof OutgoingCallActivity) {
|
} else if (activity instanceof CallOutgoingActivity) {
|
||||||
((OutgoingCallActivity) activity).updateStatusFragment(this);
|
((CallOutgoingActivity) activity).updateStatusFragment(this);
|
||||||
isInCall = true;
|
isInCall = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,7 +183,7 @@ public class StatusFragment extends Fragment {
|
||||||
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc() != null) {
|
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc() != null) {
|
||||||
voicemailCount.setVisibility(View.GONE);
|
voicemailCount.setVisibility(View.GONE);
|
||||||
|
|
||||||
if (isInCall && isAttached && getResources().getBoolean(R.bool.display_call_stats)) {
|
if (isInCall && isAttached) {
|
||||||
LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
|
LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
|
||||||
//initCallStatsRefresher(call, callStats);
|
//initCallStatsRefresher(call, callStats);
|
||||||
} else if (!isInCall) {
|
} else if (!isInCall) {
|
||||||
|
@ -398,12 +401,12 @@ public class StatusFragment extends Fragment {
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initCallStatsRefresher(final LinphoneCall call, final View view) {
|
public void initCallStatsRefresher(final LinphoneCall call, final View view) {
|
||||||
if (mTimer != null && mTask != null) {
|
if (mTimer != null && mTask != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mTimer = new Timer();
|
mTimer = new Timer();
|
||||||
mTask = new TimerTask() {
|
mTask = new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -467,7 +470,7 @@ public class StatusFragment extends Fragment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mTimer.scheduleAtFixedRate(mTask, 0, 1000);*/
|
mTimer.scheduleAtFixedRate(mTask, 0, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class VideoCallFragment extends Fragment implements OnGestureListener, On
|
||||||
private float mZoomFactor = 1.f;
|
private float mZoomFactor = 1.f;
|
||||||
private float mZoomCenterX, mZoomCenterY;
|
private float mZoomCenterX, mZoomCenterY;
|
||||||
private CompatibilityScaleGestureDetector mScaleDetector;
|
private CompatibilityScaleGestureDetector mScaleDetector;
|
||||||
private InCallActivity inCallActivity;
|
private CallActivity inCallActivity;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation") // Warning useless because value is ignored and automatically set by new APIs.
|
@SuppressWarnings("deprecation") // Warning useless because value is ignored and automatically set by new APIs.
|
||||||
@Override
|
@Override
|
||||||
|
@ -274,7 +274,7 @@ public class VideoCallFragment extends Fragment implements OnGestureListener, On
|
||||||
public void onAttach(Activity activity) {
|
public void onAttach(Activity activity) {
|
||||||
super.onAttach(activity);
|
super.onAttach(activity);
|
||||||
|
|
||||||
inCallActivity = (InCallActivity) activity;
|
inCallActivity = (CallActivity) activity;
|
||||||
if (inCallActivity != null) {
|
if (inCallActivity != null) {
|
||||||
inCallActivity.bindVideoFragment(this);
|
inCallActivity.bindVideoFragment(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.ui;
|
package org.linphone.ui;
|
||||||
|
|
||||||
import org.linphone.InCallActivity;
|
import org.linphone.CallActivity;
|
||||||
import org.linphone.LinphoneManager;
|
import org.linphone.LinphoneManager;
|
||||||
import org.linphone.LinphonePreferences;
|
import org.linphone.LinphonePreferences;
|
||||||
import org.linphone.LinphoneService;
|
import org.linphone.LinphoneService;
|
||||||
|
@ -166,8 +166,8 @@ public class Digit extends Button implements AddressAware {
|
||||||
if (!mPlayDtmf) return false;
|
if (!mPlayDtmf) return false;
|
||||||
if (!linphoneServiceReady()) return true;
|
if (!linphoneServiceReady()) return true;
|
||||||
|
|
||||||
if (InCallActivity.isInstanciated()) {
|
if (CallActivity.isInstanciated()) {
|
||||||
InCallActivity.instance().resetControlsHidingCallBack();
|
CallActivity.instance().resetControlsHidingCallBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
|
|
Loading…
Reference in a new issue