Rework and rename incoming call and outgoing call activity

This commit is contained in:
Margaux Clerc 2015-10-15 17:55:43 +02:00
parent 23e66f1c70
commit 24af401775
15 changed files with 765 additions and 727 deletions

View file

@ -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">

View 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>

View file

@ -1,85 +1,96 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/topLayout" android:id="@+id/topLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/colorH"> android:background="@color/colorH">
<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:paddingTop="10dp">
android:layout_above="@id/menu">
<LinearLayout <TextView
android:id="@+id/incoming_caller_profile" 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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:layout_below="@id/contact_number"
android:orientation="vertical" android:layout_margin="5dp"
android:paddingTop="10dp"> android:gravity="center">
<ImageView <ImageView
android:id="@+id/incoming_picture" android:id="@+id/contact_picture"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/avatar" android:src="@drawable/avatar"
android:paddingBottom="10dp" android:contentDescription="@string/content_description_contact_picture"
android:layout_marginTop="10dp"/> android:layout_width="200dp"
<TextView
android:id="@+id/incoming_caller_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:adjustViewBounds="true"/>
android:textAlignment="center"
style="@style/font5"/>
<TextView <ImageView
android:id="@+id/incoming_caller_number" android:src="@drawable/avatar_mask"
android:layout_width="wrap_content" android:layout_width="200dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/font2" android:adjustViewBounds="true"
android:layout_gravity="center"/> android:layout_alignParentTop="true"/>
</RelativeLayout>
</LinearLayout> </RelativeLayout>
<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>
<org.linphone.mediastream.video.display.GL2JNIView
android:id="@+id/videoSurface"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:visibility="gone" />
<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

View file

@ -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>

View file

@ -22,9 +22,9 @@
</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>
</TableLayout> </TableLayout>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="Default" parent="android:Theme.Holo.Light" /> <style name="Default" parent="android:Theme.Holo.Light" />
<style name="NoTitle" parent="android:Theme.Holo.Light.NoActionBar" /> <style name="NoTitle" parent="android:Theme.Holo.Light.NoActionBar" />
<style name="FullScreen" parent="android:Theme.Holo.Light.NoActionBar.Fullscreen" /> <style name="FullScreen" parent="android:Theme.Holo.Light.NoActionBar.Fullscreen" />
<style name="font1" parent="@android:style/TextAppearance.Medium"> <style name="font1" parent="@android:style/TextAppearance.Medium">
<item name="android:textColor">@color/colorA</item> <item name="android:textColor">@color/colorA</item>

View file

@ -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();
} }
} }

View file

@ -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,58 +35,52 @@ 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;
} }
public static boolean isInstanciated() { public static boolean isInstanciated() {
return instance != null; return instance != null;
} }
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
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,22 +88,20 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
} }
}); });
// "Dial-to-answer" widget for incoming calls. mListener = new LinphoneCoreListenerBase(){
@Override
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
if (call == mCall && State.CallEnd == state) {
finish();
}
if (state == State.StreamsRunning) {
// The following should not be needed except some devices need it (e.g. Galaxy S).
LinphoneManager.getLc().enableSpeaker(LinphoneManager.getLc().isSpeakerEnabled());
}
}
};
mListener = new LinphoneCoreListenerBase(){ super.onCreate(savedInstanceState);
@Override
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
if (call == mCall && State.CallEnd == state) {
finish();
}
if (state == State.StreamsRunning) {
// The following should not be needed except some devices need it (e.g. Galaxy S).
LinphoneManager.getLc().enableSpeaker(LinphoneManager.getLc().isSpeakerEnabled());
}
}
};
super.onCreate(savedInstanceState);
instance = this; instance = this;
} }
@ -121,7 +113,7 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
if (lc != null) { if (lc != null) {
lc.addListener(mListener); lc.addListener(mListener);
} }
// Only one call ringing at a time is allowed // Only one call ringing at a time is allowed
if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() != null) { if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() != null) {
List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc()); List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc());
@ -138,16 +130,16 @@ 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
protected void onPause() { protected void onPause() {
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull(); LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
@ -156,13 +148,13 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
} }
super.onPause(); super.onPause();
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
instance = null; instance = null;
} }
@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)) {
@ -179,16 +171,10 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
private void decline() { private void decline() {
LinphoneManager.getLc().terminateCall(mCall); LinphoneManager.getLc().terminateCall(mCall);
} }
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();
@ -216,4 +202,4 @@ public class IncomingCallActivity extends Activity implements LinphoneSliderTrig
decline(); decline();
finish(); finish();
} }
} }

View file

@ -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);
} }
} }

View file

@ -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));
} }
} }
} }

View file

@ -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())

View file

@ -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);
} }

View file

@ -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);
} }

View file

@ -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();