Skip to content
Snippets Groups Projects
Commit 6d54bbc6 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

#16889: Add SipCall as an argument to launchCallActivity

parent 14323bed
No related branches found
No related tags found
No related merge requests found
...@@ -32,16 +32,71 @@ ...@@ -32,16 +32,71 @@
package com.savoirfairelinux.sflphone.client; package com.savoirfairelinux.sflphone.client;
import android.app.Activity; import android.app.Activity;
import android.content.Context;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle; import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import com.savoirfairelinux.sflphone.R; import com.savoirfairelinux.sflphone.R;
import com.savoirfairelinux.sflphone.client.SipCall;
import com.savoirfairelinux.sflphone.service.ISipService;
import com.savoirfairelinux.sflphone.service.SipService;
public class CallActivity extends Activity public class CallActivity extends Activity implements OnClickListener
{ {
static final String TAG = "CallActivity";
private ISipService service;
private SipCall mCall;
public void CallActivity(SipCall call) {
mCall = call;
}
@Override @Override
protected void onCreate(Bundle savedInstanceState) protected void onCreate(Bundle savedInstanceState)
{ {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.call_activity_layout); setContentView(R.layout.call_activity_layout);
Intent intent = new Intent(this, SipService.class);
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}
@Override
protected void onDestroy() {
stopService(new Intent(this, SipService.class));
super.onDestroy();
}
/** Defines callbacks for service binding, passed to bindService() */
private ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName className, IBinder binder) {
service = ISipService.Stub.asInterface(binder);
}
@Override
public void onServiceDisconnected(ComponentName arg0) {
}
};
@Override
public void onClick(View view)
{
if(view.getId() == R.id.buttonhangup) {
try {
service.hangUp(mCall.mCallInfo.mCallID);
} catch (RemoteException e) {
Log.e(TAG, "Cannot call service method", e);
}
}
} }
} }
...@@ -484,7 +484,8 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC ...@@ -484,7 +484,8 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
Log.e(TAG, "Cannot call service method", e); Log.e(TAG, "Cannot call service method", e);
} }
*/ */
launchCallActivity(); SipCall call = new SipCall();
launchCallActivity(call);
} }
public void processingHangUpAction() { public void processingHangUpAction() {
...@@ -512,9 +513,11 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC ...@@ -512,9 +513,11 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
buttonCall.setImageResource(R.drawable.ic_call); buttonCall.setImageResource(R.drawable.ic_call);
} }
private void launchCallActivity() private void launchCallActivity(SipCall call)
{ {
Log.i(TAG, "Launch Call Activity"); Log.i(TAG, "Launch Call Activity");
Bundle bundle = new Bundle();
bundle.putString("CallID", call.mCallInfo.mCallID);
Intent intent = new Intent().setClass(this, CallActivity.class); Intent intent = new Intent().setClass(this, CallActivity.class);
startActivity(intent); startActivity(intent);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment