Fix numpad hiding while sending dtmfs

This commit is contained in:
Sylvain Berfini 2012-08-02 10:28:42 +02:00
parent 4964264bea
commit 84da207455
2 changed files with 21 additions and 0 deletions

View file

@ -55,6 +55,7 @@ public class InCallActivity extends FragmentActivity implements
OnClickListener {
private final static int SECONDS_BEFORE_HIDING_CONTROLS = 3000;
private static InCallActivity instance = null;
private Handler mHandler = new Handler();
private Handler controlsHandler = new Handler();
private Runnable mControls;
@ -66,9 +67,18 @@ public class InCallActivity extends FragmentActivity implements
private LinearLayout mControlsLayout;
private Numpad numpad;
public static InCallActivity instance() {
return instance;
}
public static boolean isInstanciated() {
return instance != null;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
instance = this;
setContentView(R.layout.incall);
isVideoEnabled = getIntent().getExtras() != null && getIntent().getExtras().getBoolean("VideoEnabled");
@ -634,6 +644,12 @@ public class InCallActivity extends FragmentActivity implements
super.onPause();
}
@Override
protected void onDestroy() {
instance = null;
super.onDestroy();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (LinphoneUtils.onKeyVolumeAdjust(keyCode)) return true;

View file

@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.linphone.ui;
import org.linphone.InCallActivity;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneService;
import org.linphone.R;
@ -119,6 +120,10 @@ public class Digit extends Button implements AddressAware {
if (!mPlayDtmf) return false;
if (!linphoneServiceReady()) return true;
if (InCallActivity.isInstanciated()) {
InCallActivity.instance().resetControlsHidingCallBack();
}
LinphoneCore lc = LinphoneManager.getLc();
if (event.getAction() == MotionEvent.ACTION_DOWN && !mIsDtmfStarted) {
LinphoneManager.getInstance().playDtmf(getContext().getContentResolver(), mKeyCode);