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

#16889: Launch CallActivity on new call

parent 6b8d1df8
Branches
Tags
No related merge requests found
...@@ -69,6 +69,8 @@ as that of the covered work. ...@@ -69,6 +69,8 @@ as that of the covered work.
</activity> </activity>
<activity android:name=".client.AccountCreationActivity" <activity android:name=".client.AccountCreationActivity"
android:label="@string/app_name"/> android:label="@string/app_name"/>
<activity android:name=".client.CallActivity"
android:label="@string/app_name"/>
<receiver <receiver
android:name=".client.receiver.NewOutgoingCallReceiver" android:name=".client.receiver.NewOutgoingCallReceiver"
android:exported="true" > android:exported="true" >
......
...@@ -37,6 +37,12 @@ as that of the covered work. ...@@ -37,6 +37,12 @@ as that of the covered work.
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="8dp" > android:paddingRight="8dp" >
<Button
android:id="@+id/account_selection_button"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="No Account Selected"/>
<ListView <ListView
android:id="@id/android:list" android:id="@id/android:list"
android:layout_width="match_parent" android:layout_width="match_parent"
......
/*
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
*
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
package com.savoirfairelinux.sflphone.client;
import android.app.Activity;
import android.os.Bundle;
import com.savoirfairelinux.sflphone.R;
public class CallActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.call_activity_layout);
}
}
...@@ -438,6 +438,7 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC ...@@ -438,6 +438,7 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
} }
public void processingNewCallAction() { public void processingNewCallAction() {
/*
Log.d(TAG, "ProcessingNewCallAction()"); Log.d(TAG, "ProcessingNewCallAction()");
TextView textView = (TextView) findViewById(R.id.editAccountID); TextView textView = (TextView) findViewById(R.id.editAccountID);
String accountID = mAccountList.currentAccountID; String accountID = mAccountList.currentAccountID;
...@@ -475,12 +476,15 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC ...@@ -475,12 +476,15 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
callOnGoing = true; callOnGoing = true;
buttonCall.setEnabled(false); buttonCall.setEnabled(false);
buttonHangup.setEnabled(true); buttonHangup.setEnabled(true);
launchCallActivity();
//} //}
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Cannot call service method", e); Log.e(TAG, "Cannot call service method", e);
} }
*/
launchCallActivity();
} }
public void processingHangUpAction() { public void processingHangUpAction() {
...@@ -507,4 +511,11 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC ...@@ -507,4 +511,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()
{
Log.i(TAG, "Launch Call Activity");
Intent intent = new Intent().setClass(this, CallActivity.class);
startActivity(intent);
}
} }
...@@ -11,6 +11,11 @@ public class CallManagerCallBack extends Callback { ...@@ -11,6 +11,11 @@ public class CallManagerCallBack extends Callback {
Log.d(TAG, "on_new_call_created(" + accountID + ", " + callID + ", " + to + ")"); Log.d(TAG, "on_new_call_created(" + accountID + ", " + callID + ", " + to + ")");
} }
@Override
public void on_call_state_changed(String callID, String state) {
Log.d(TAG, "on_call_state_changed(" + callID + ", " + state + ")");
}
@Override @Override
public void on_incoming_call(String accountID, String callID, String from) { public void on_incoming_call(String accountID, String callID, String from) {
Log.d(TAG, "on_incoming_call(" + accountID + ", " + callID + ", " + from + ")"); Log.d(TAG, "on_incoming_call(" + accountID + ", " + callID + ", " + from + ")");
......
/*
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
*
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
package com.savoirfairelinux.sflphone.utils;
public class AccountList
{
static final String TAG = "AccountList";
public String currentAccountID = "Account:1345153770";
// private HashMap<String, AccountPreferenceScreen> mAccountList = new HashMap<String, AccountPreferenceScreen>();
public AccountList() {
}
}
/*
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
*
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
package com.savoirfairelinux.sflphone.utils;
import com.savoirfairelinux.sflphone.client.SipCall;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import java.util.ArrayList;
public class CallList extends BroadcastReceiver
{
static final String TAG = "CallList";
ArrayList<SipCall> mList = new ArrayList<SipCall>();
private enum Signals {
NEW_CALL_CREATED,
INCOMING_CALL,
INCOMING_MESSAGE,
CALL_STATE_CHANGED
}
@Override
public void onReceive(Context context, Intent intent)
{
String signalName = intent.getStringExtra("signal-name");
Log.d(TAG, "Signal received: " + signalName);
Signals signalReceived = Signals.valueOf(signalName.toUpperCase());
switch(signalReceived) {
case NEW_CALL_CREATED:
break;
case INCOMING_CALL:
break;
case INCOMING_MESSAGE:
break;
case CALL_STATE_CHANGED:
break;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment