blob: 6d14815c453db81f704fa3e9527078c0fe5eb00b [file] [log] [blame]
alisionf76de3b2013-04-16 15:35:22 -04001/*
2 * Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
3 *
4 * Author: Adrien Beraud <adrien.beraud@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *
20 * Additional permission under GNU GPL version 3 section 7:
21 *
22 * If you modify this program, or any covered work, by linking or
23 * combining it with the OpenSSL project's OpenSSL library (or a
24 * modified version of that library), containing parts covered by the
25 * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
26 * grants you additional permission to convey the resulting work.
27 * Corresponding Source for a non-source form of such a combination
28 * shall include the source code for the parts of OpenSSL used as well
29 * as that of the covered work.
30 */
31package com.savoirfairelinux.sflphone.client;
32
alision73424b62013-04-26 11:49:18 -040033import java.net.NetworkInterface;
34import java.net.SocketException;
35import java.util.Enumeration;
36
alisionf76de3b2013-04-16 15:35:22 -040037import android.app.ActionBar;
38import android.app.Activity;
39import android.app.Fragment;
40import android.app.FragmentManager;
41import android.app.FragmentTransaction;
42import android.content.ComponentName;
43import android.content.Context;
44import android.content.Intent;
45import android.content.IntentFilter;
46import android.content.ServiceConnection;
47import android.os.Bundle;
48import android.os.IBinder;
alision5f899632013-04-22 17:26:56 -040049import android.os.RemoteException;
alisionf76de3b2013-04-16 15:35:22 -040050import android.support.v13.app.FragmentStatePagerAdapter;
alisionf76de3b2013-04-16 15:35:22 -040051import android.support.v4.view.ViewPager;
52import android.util.Log;
alisionf76de3b2013-04-16 15:35:22 -040053import android.view.Menu;
54import android.view.MenuItem;
alisionf76de3b2013-04-16 15:35:22 -040055import android.widget.ImageButton;
alisionf76de3b2013-04-16 15:35:22 -040056
57import com.savoirfairelinux.sflphone.R;
alisionf76de3b2013-04-16 15:35:22 -040058import com.savoirfairelinux.sflphone.fragments.CallElementListFragment;
59import com.savoirfairelinux.sflphone.fragments.ContactListFragment;
alisiond9e29442013-04-17 16:10:18 -040060import com.savoirfairelinux.sflphone.fragments.HistoryFragment;
alisionf76de3b2013-04-16 15:35:22 -040061import com.savoirfairelinux.sflphone.model.SipCall;
alisionf76de3b2013-04-16 15:35:22 -040062import com.savoirfairelinux.sflphone.service.ConfigurationManagerCallback;
alision5f899632013-04-22 17:26:56 -040063import com.savoirfairelinux.sflphone.service.ISipClient;
alisionf76de3b2013-04-16 15:35:22 -040064import com.savoirfairelinux.sflphone.service.ISipService;
65import com.savoirfairelinux.sflphone.service.SipService;
66
alisione2a38e12013-04-25 14:20:20 -040067public class SFLPhoneHomeActivity extends Activity implements ActionBar.TabListener, CallElementListFragment.Callbacks, HistoryFragment.Callbacks {
alision5f899632013-04-22 17:26:56 -040068 SectionsPagerAdapter mSectionsPagerAdapter = null;
69 static final String TAG = "SFLPhoneHome";
70 private static final int REQUEST_CODE_PREFERENCES = 1;
71 ImageButton buttonCall, buttonHangup;
72 private ContactListFragment mContactListFragment = null;
73 private CallElementListFragment mCallElementList = null;
74 private HistoryFragment mHistorySectionFragment = null;
75 private boolean mBound = false;
76 private ISipService service;
alisionf76de3b2013-04-16 15:35:22 -040077
alision5f899632013-04-22 17:26:56 -040078 private static final int ACTION_BAR_TAB_CONTACT = 0;
79 private static final int ACTION_BAR_TAB_CALL = 1;
80 private static final int ACTION_BAR_TAB_HISTORY = 2;
alisionf76de3b2013-04-16 15:35:22 -040081
alision5f899632013-04-22 17:26:56 -040082 /**
83 * The {@link ViewPager} that will host the section contents.
84 */
85 ViewPager mViewPager;
alisionf76de3b2013-04-16 15:35:22 -040086
alision5f899632013-04-22 17:26:56 -040087 final private int[] icon_res_id = { R.drawable.ic_tab_call, R.drawable.ic_tab_call, R.drawable.ic_tab_history };
alisionf76de3b2013-04-16 15:35:22 -040088
alision5f899632013-04-22 17:26:56 -040089 // public SFLPhoneHome extends Activity implements ActionBar.TabListener, OnClickListener
alisionf76de3b2013-04-16 15:35:22 -040090
alision5f899632013-04-22 17:26:56 -040091 /* called before activity is killed, e.g. rotation */
92 @Override
93 protected void onSaveInstanceState(Bundle bundle) {
94 super.onSaveInstanceState(bundle);
95 for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {
96 try {
97 /* putFragment (Bundle bundle, String key, Fragment fragment) */
98 getFragmentManager().putFragment(bundle, mSectionsPagerAdapter.getClassName(i), mSectionsPagerAdapter.getFragment(i));
99 } catch (IllegalStateException e) {
alision73424b62013-04-26 11:49:18 -0400100 Log.e(TAG, e.toString() + "fragment=" + mSectionsPagerAdapter.getFragment(i));
alision5f899632013-04-22 17:26:56 -0400101 }
102 }
103 Log.w(TAG, "onSaveInstanceState()");
104 }
alisionf76de3b2013-04-16 15:35:22 -0400105
alision5f899632013-04-22 17:26:56 -0400106 @Override
107 public void onCreate(Bundle savedInstanceState) {
108 super.onCreate(savedInstanceState);
alisionf76de3b2013-04-16 15:35:22 -0400109
alision5f899632013-04-22 17:26:56 -0400110 // Bind to LocalService
111 if (!mBound) {
112 Log.i(TAG, "onStart: Binding service...");
113 Intent intent = new Intent(this, SipService.class);
114 bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
115 }
alisionf76de3b2013-04-16 15:35:22 -0400116
alision5f899632013-04-22 17:26:56 -0400117 setContentView(R.layout.activity_sflphone_home);
alisionf76de3b2013-04-16 15:35:22 -0400118
alision5f899632013-04-22 17:26:56 -0400119 if (mSectionsPagerAdapter == null) {
120 mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager());
121 }
alisionf76de3b2013-04-16 15:35:22 -0400122
alision5f899632013-04-22 17:26:56 -0400123 /* getFragment(Bundle, String) */
124 if (savedInstanceState != null) {
125 Log.w(TAG, "Activity restarted, recreating PagerAdapter...");
126 /* getFragment (Bundle bundle, String key) */
127 mContactListFragment = (ContactListFragment) getFragmentManager().getFragment(savedInstanceState,
128 mSectionsPagerAdapter.getClassName(ACTION_BAR_TAB_CONTACT));
129 mCallElementList = (CallElementListFragment) getFragmentManager().getFragment(savedInstanceState,
130 mSectionsPagerAdapter.getClassName(ACTION_BAR_TAB_CALL));
131 mHistorySectionFragment = (HistoryFragment) getFragmentManager().getFragment(savedInstanceState,
132 mSectionsPagerAdapter.getClassName(ACTION_BAR_TAB_HISTORY));
133 }
alisionf76de3b2013-04-16 15:35:22 -0400134
alision5f899632013-04-22 17:26:56 -0400135 if (mContactListFragment == null) {
136 mContactListFragment = new ContactListFragment();
137 Log.w(TAG, "Recreated mContactListFragment=" + mContactListFragment);
138 }
139 if (mCallElementList == null) {
140 mCallElementList = new CallElementListFragment();
141 Log.w(TAG, "Recreated mCallElementList=" + mCallElementList);
142 }
143 if (mHistorySectionFragment == null) {
144 mHistorySectionFragment = new HistoryFragment();
145 Log.w(TAG, "Recreated mHistorySectionFragment=" + mHistorySectionFragment);
146 }
alisionf76de3b2013-04-16 15:35:22 -0400147
alision5f899632013-04-22 17:26:56 -0400148 final ActionBar actionBar = getActionBar();
149 actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
150 // final ActionBar actionBar = getActionBar();
alisionf76de3b2013-04-16 15:35:22 -0400151
alision5f899632013-04-22 17:26:56 -0400152 // Set up the ViewPager with the sections adapter.
153 mViewPager = (ViewPager) findViewById(R.id.pager);
154 mViewPager.setAdapter(mSectionsPagerAdapter);
alisionf76de3b2013-04-16 15:35:22 -0400155
alision5f899632013-04-22 17:26:56 -0400156 // When swiping between different sections, select the corresponding tab.
157 // We can also use ActionBar.Tab#select() to do this if we have a reference to the
158 // Tab.
159 mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
160 @Override
161 public void onPageSelected(int position) {
162 actionBar.setSelectedNavigationItem(position);
163 }
164 });
alisionf76de3b2013-04-16 15:35:22 -0400165
alision5f899632013-04-22 17:26:56 -0400166 // For each of the sections in the app, add a tab to the action bar.
167 for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {
168 // Create a tab with text corresponding to the page title defined by the adapter.
169 // Also specify this Activity object, which implements the TabListener interface, as the
170 // listener for when this tab is selected.
171 actionBar.addTab(actionBar.newTab().setIcon(icon_res_id[i]).setText(mSectionsPagerAdapter.getPageTitle(i)).setTabListener(this));
172 }
alisionf76de3b2013-04-16 15:35:22 -0400173
alision5f899632013-04-22 17:26:56 -0400174 actionBar.setSelectedNavigationItem(ACTION_BAR_TAB_CALL);
alisionf76de3b2013-04-16 15:35:22 -0400175
alisione2a38e12013-04-25 14:20:20 -0400176 // buttonHangup.setOnClickListener(new OnClickListener() {
177 // @Override
178 // public void onClick(View v) {
179 // processingHangUpAction();
180 //
181 // }
182 // });
alisionf76de3b2013-04-16 15:35:22 -0400183
alision371b77e2013-04-23 14:51:26 -0400184 // IntentFilter callFilter = new IntentFilter(CallManagerCallBack.NEW_CALL_CREATED);
185 // callFilter.addAction(CallManagerCallBack.INCOMING_CALL);
186 // callFilter.addAction(CallManagerCallBack.CALL_STATE_CHANGED);
187 // LocalBroadcastManager.getInstance(this).registerReceiver(mCallList, callFilter);
188 //
189 // mAccountList = mApplication.getAccountList();
190 // Log.w(TAG, "mAccountList=" + mAccountList + ", mCallElementList=" + mCallElementList);
alisionf76de3b2013-04-16 15:35:22 -0400191
alision5f899632013-04-22 17:26:56 -0400192 IntentFilter accountFilter = new IntentFilter(ConfigurationManagerCallback.ACCOUNTS_CHANGED);
alisionf76de3b2013-04-16 15:35:22 -0400193 accountFilter.addAction(ConfigurationManagerCallback.ACCOUNT_STATE_CHANGED);
alision371b77e2013-04-23 14:51:26 -0400194 // LocalBroadcastManager.getInstance(this).registerReceiver(mAccountList, accountFilter);
alisionf76de3b2013-04-16 15:35:22 -0400195
alisione2a38e12013-04-25 14:20:20 -0400196 // SipCall.setSFLPhoneHomeContext(this);
alision5f899632013-04-22 17:26:56 -0400197 }
alisionf76de3b2013-04-16 15:35:22 -0400198
alision5f899632013-04-22 17:26:56 -0400199 @Override
200 protected void onStart() {
201 Log.i(TAG, "onStart");
202 super.onStart();
203 }
alisionf76de3b2013-04-16 15:35:22 -0400204
alision5f899632013-04-22 17:26:56 -0400205 /* user gets back to the activity, e.g. through task manager */
206 @Override
207 protected void onRestart() {
208 super.onRestart();
209 }
alisionf76de3b2013-04-16 15:35:22 -0400210
alision5f899632013-04-22 17:26:56 -0400211 /* activity gets back to the foreground and user input */
212 @Override
213 protected void onResume() {
214 Log.i(TAG, "onResume");
215 super.onResume();
216 }
alisionf76de3b2013-04-16 15:35:22 -0400217
alision5f899632013-04-22 17:26:56 -0400218 /* activity no more in foreground */
219 @Override
220 protected void onPause() {
221 super.onPause();
222 }
alisionf76de3b2013-04-16 15:35:22 -0400223
alision5f899632013-04-22 17:26:56 -0400224 /* activity is no longer visible */
225 @Override
226 protected void onStop() {
227 super.onStop();
228 }
alisionf76de3b2013-04-16 15:35:22 -0400229
alision5f899632013-04-22 17:26:56 -0400230 /* activity finishes itself or is being killed by the system */
231 @Override
232 protected void onDestroy() {
233 /* stop the service, if no other bound user, no need to check if it is running */
234 if (mBound) {
235 Log.i(TAG, "onStop: Unbinding service...");
236 unbindService(mConnection);
237 mBound = false;
238 }
alisionf76de3b2013-04-16 15:35:22 -0400239
alision5f899632013-04-22 17:26:56 -0400240 /* unregister broadcast receiver */
alision371b77e2013-04-23 14:51:26 -0400241 // LocalBroadcastManager.getInstance(this).unregisterReceiver(mCallList);
242 // LocalBroadcastManager.getInstance(this).unregisterReceiver(mAccountList);
alisionf76de3b2013-04-16 15:35:22 -0400243
alision5f899632013-04-22 17:26:56 -0400244 super.onDestroy();
245 }
alisione2a38e12013-04-25 14:20:20 -0400246
247 public void launchCallActivity(SipCall.CallInfo infos) {
alision371b77e2013-04-23 14:51:26 -0400248 Log.i(TAG, "Launch Call Activity");
249 Bundle bundle = new Bundle();
250 bundle.putParcelable("CallInfo", infos);
251 Intent intent = new Intent().setClass(this, CallActivity.class);
252 intent.putExtras(bundle);
253 startActivity(intent);
254 }
alisionf76de3b2013-04-16 15:35:22 -0400255
alision5f899632013-04-22 17:26:56 -0400256 /** Defines callbacks for service binding, passed to bindService() */
257 private ServiceConnection mConnection = new ServiceConnection() {
alisionf76de3b2013-04-16 15:35:22 -0400258
alision5f899632013-04-22 17:26:56 -0400259 private ISipClient callback = new ISipClient.Stub() {
alision371b77e2013-04-23 14:51:26 -0400260
alision5f899632013-04-22 17:26:56 -0400261 @Override
alision371b77e2013-04-23 14:51:26 -0400262 public void incomingCall(Intent call) throws RemoteException {
263 Log.i(TAG, "Incoming call transfered from Service");
264 SipCall.CallInfo infos = new SipCall.CallInfo(call);
alisione2a38e12013-04-25 14:20:20 -0400265
alision371b77e2013-04-23 14:51:26 -0400266 SipCall c = new SipCall(infos);
267 mCallElementList.addCall(c);
alision73424b62013-04-26 11:49:18 -0400268
Adrien Béraud1947a102013-04-26 22:05:34 +1000269 launchCallActivity(infos);
alision371b77e2013-04-23 14:51:26 -0400270 }
271
272 @Override
273 public void callStateChanged(Intent callState) throws RemoteException {
274 Bundle b = callState.getBundleExtra("com.savoirfairelinux.sflphone.service.newstate");
275 String cID = b.getString("CallID");
276 String state = b.getString("State");
alisione2a38e12013-04-25 14:20:20 -0400277 Log.i(TAG, "callStateChanged" + cID + " " + state);
alision371b77e2013-04-23 14:51:26 -0400278 mCallElementList.updateCall(cID, state);
279
alision5f899632013-04-22 17:26:56 -0400280 }
281 };
alisionf76de3b2013-04-16 15:35:22 -0400282
alision5f899632013-04-22 17:26:56 -0400283 @Override
284 public void onServiceConnected(ComponentName className, IBinder binder) {
285 service = ISipService.Stub.asInterface(binder);
alision371b77e2013-04-23 14:51:26 -0400286
alisione2a38e12013-04-25 14:20:20 -0400287 mBound = true;
288 mCallElementList.onServiceSipBinded(service);
289 mHistorySectionFragment.onServiceSipBinded(service);
290 Log.d(TAG, "Service connected service=" + service);
291
alision5f899632013-04-22 17:26:56 -0400292 try {
alision371b77e2013-04-23 14:51:26 -0400293 service.registerClient(callback);
alision5f899632013-04-22 17:26:56 -0400294 } catch (RemoteException e) {
alision371b77e2013-04-23 14:51:26 -0400295 Log.e(TAG, e.toString());
alision5f899632013-04-22 17:26:56 -0400296 }
alision5f899632013-04-22 17:26:56 -0400297 }
298
299 @Override
300 public void onServiceDisconnected(ComponentName arg0) {
alisione2a38e12013-04-25 14:20:20 -0400301
alision5f899632013-04-22 17:26:56 -0400302 mBound = false;
303 Log.d(TAG, "Service disconnected service=" + service);
304 }
305 };
306
307 @Override
308 public boolean onOptionsItemSelected(MenuItem item) {
309 Log.i("SFLphone", "onOptionsItemSelected " + item.getItemId());
310 if (item.getItemId() != 0) {
311 // When the button is clicked, launch an activity through this intent
312 Intent launchPreferencesIntent = new Intent().setClass(this, SFLPhonePreferenceActivity.class);
313
314 // Make it a subactivity so we know when it returns
315 startActivityForResult(launchPreferencesIntent, REQUEST_CODE_PREFERENCES);
316 }
317
318 return super.onOptionsItemSelected(item);
319 }
alision371b77e2013-04-23 14:51:26 -0400320
alision5f899632013-04-22 17:26:56 -0400321 @Override
alision371b77e2013-04-23 14:51:26 -0400322 public void onActivityResult(int requestCode, int resultCode, Intent data) {
alision5f899632013-04-22 17:26:56 -0400323 super.onActivityResult(requestCode, resultCode, data);
alision371b77e2013-04-23 14:51:26 -0400324 if (REQUEST_CODE_PREFERENCES == requestCode && service != null) {
325 // Refresh Spinner with modified accounts
alision5f899632013-04-22 17:26:56 -0400326 mCallElementList.onServiceSipBinded(service);
327 }
328 }
329
330 @Override
331 public boolean onCreateOptionsMenu(Menu menu) {
332 getMenuInflater().inflate(R.menu.activity_sflphone_home, menu);
333 return true;
334 }
335
336 @Override
337 public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
338 }
339
340 @Override
341 public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
342 // When the given tab is selected, switch to the corresponding page in the ViewPager.
343 mViewPager.setCurrentItem(tab.getPosition());
344 }
345
346 @Override
347 public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
348 // Log.d(TAG, "onTabReselected");
349 }
350
alision5f899632013-04-22 17:26:56 -0400351 public void processingHangUpAction() {
352 SipCall call = (SipCall) buttonHangup.getTag();
353 if (call != null)
354 call.notifyServiceHangup(service);
355 }
alisionf76de3b2013-04-16 15:35:22 -0400356
alision5f899632013-04-22 17:26:56 -0400357 /**
358 * A {@link FragmentStatePagerAdapter} that returns a fragment corresponding to one of the primary sections of the app.
359 */
360 public class SectionsPagerAdapter extends FragmentStatePagerAdapter {
alisionf76de3b2013-04-16 15:35:22 -0400361
alision5f899632013-04-22 17:26:56 -0400362 public SectionsPagerAdapter(FragmentManager fm) {
363 super(fm);
364 }
alisionf76de3b2013-04-16 15:35:22 -0400365
alision5f899632013-04-22 17:26:56 -0400366 @Override
367 public Fragment getItem(int i) {
368 Fragment fragment;
alisionf76de3b2013-04-16 15:35:22 -0400369
alision5f899632013-04-22 17:26:56 -0400370 switch (i) {
371 case 0:
372 mContactListFragment = new ContactListFragment();
373 fragment = mContactListFragment;
374 Log.w(TAG, "getItem() ContactListFragment=" + fragment);
375 break;
376 case 1:
377 mCallElementList = new CallElementListFragment();
alisione2a38e12013-04-25 14:20:20 -0400378 // SipCall.setCallElementList(mCallElementList);
alision371b77e2013-04-23 14:51:26 -0400379 // mCallElementList.setAccountList(mAccountList);
alision5f899632013-04-22 17:26:56 -0400380 fragment = mCallElementList;
381 Log.w(TAG, "getItem() CallElementList=" + fragment);
382 break;
383 case 2:
384 fragment = new HistoryFragment();
385 Log.w(TAG, "getItem() HistoryFragment=" + fragment);
386 break;
387 default:
388 Log.e(TAG, "getItem() unknown tab position " + i);
389 return null;
390 }
alisionf76de3b2013-04-16 15:35:22 -0400391
alision5f899632013-04-22 17:26:56 -0400392 // Log.i(TAG, "getItem() fragment is " + fragment);
393 Bundle args = new Bundle();
394 args.putInt(HistoryFragment.ARG_SECTION_NUMBER, i + 1);
395 fragment.setArguments(args);
396 return fragment;
397 }
alisionf76de3b2013-04-16 15:35:22 -0400398
alision5f899632013-04-22 17:26:56 -0400399 public Fragment getFragment(int i) {
400 Fragment fragment;
alisionf76de3b2013-04-16 15:35:22 -0400401
alision5f899632013-04-22 17:26:56 -0400402 switch (i) {
403 case 0:
404 fragment = mContactListFragment;
405 break;
406 case 1:
407 fragment = mCallElementList;
408 break;
409 case 2:
410 fragment = mHistorySectionFragment;
411 break;
412 default:
413 Log.e(TAG, "getClassName: unknown fragment position " + i);
414 fragment = null;
415 }
alisionf76de3b2013-04-16 15:35:22 -0400416
alision5f899632013-04-22 17:26:56 -0400417 // Log.w(TAG, "getFragment: fragment=" + fragment);
418 return fragment;
419 }
alisionf76de3b2013-04-16 15:35:22 -0400420
alision5f899632013-04-22 17:26:56 -0400421 public String getClassName(int i) {
422 String name;
alisionf76de3b2013-04-16 15:35:22 -0400423
alision5f899632013-04-22 17:26:56 -0400424 switch (i) {
425 case 0:
426 name = ContactListFragment.class.getName();
427 break;
428 case 1:
429 name = CallElementListFragment.class.getName();
430 break;
431 case 2:
432 name = HistoryFragment.class.getName();
433 break;
alisionf76de3b2013-04-16 15:35:22 -0400434
alision5f899632013-04-22 17:26:56 -0400435 default:
436 Log.e(TAG, "getClassName: unknown fragment position " + i);
437 return null;
438 }
alisionf76de3b2013-04-16 15:35:22 -0400439
alision5f899632013-04-22 17:26:56 -0400440 // Log.w(TAG, "getClassName: name=" + name);
441 return name;
442 }
alisionf76de3b2013-04-16 15:35:22 -0400443
alision5f899632013-04-22 17:26:56 -0400444 @Override
445 public int getCount() {
446 return 3;
447 }
alisionf76de3b2013-04-16 15:35:22 -0400448
alision5f899632013-04-22 17:26:56 -0400449 @Override
450 public CharSequence getPageTitle(int position) {
451 switch (position) {
452 case 0:
453 return getString(R.string.title_section0).toUpperCase();
454 case 1:
455 return getString(R.string.title_section1).toUpperCase();
456 case 2:
457 return getString(R.string.title_section2).toUpperCase();
458 case 3:
459 return getString(R.string.title_section3).toUpperCase();
460 default:
461 Log.e(TAG, "getPageTitle: unknown tab position " + position);
462 break;
463 }
464 return null;
465 }
466 }
alisionf76de3b2013-04-16 15:35:22 -0400467
alision371b77e2013-04-23 14:51:26 -0400468 @Override
469 public void onCallSelected(SipCall c) {
470 launchCallActivity(c.mCallInfo);
alisione2a38e12013-04-25 14:20:20 -0400471
472 }
473
474 @Override
475 public ISipService getService() {
476 return service;
alision371b77e2013-04-23 14:51:26 -0400477 }
478
alisionf76de3b2013-04-16 15:35:22 -0400479}