blob: 4afc441141c95a3e8d581a142ce553366dea4423 [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
alisionf76de3b2013-04-16 15:35:22 -040033import android.app.ActionBar;
34import android.app.Activity;
35import android.app.Fragment;
36import android.app.FragmentManager;
37import android.app.FragmentTransaction;
38import android.content.ComponentName;
39import android.content.Context;
40import android.content.Intent;
41import android.content.IntentFilter;
42import android.content.ServiceConnection;
43import android.os.Bundle;
44import android.os.IBinder;
alision5f899632013-04-22 17:26:56 -040045import android.os.RemoteException;
alisionf76de3b2013-04-16 15:35:22 -040046import android.support.v13.app.FragmentStatePagerAdapter;
alisionf76de3b2013-04-16 15:35:22 -040047import android.support.v4.view.ViewPager;
48import android.util.Log;
alisionf76de3b2013-04-16 15:35:22 -040049import android.view.Menu;
50import android.view.MenuItem;
alisionf76de3b2013-04-16 15:35:22 -040051import android.widget.ImageButton;
alisionf76de3b2013-04-16 15:35:22 -040052
53import com.savoirfairelinux.sflphone.R;
alisionf76de3b2013-04-16 15:35:22 -040054import com.savoirfairelinux.sflphone.fragments.CallElementListFragment;
55import com.savoirfairelinux.sflphone.fragments.ContactListFragment;
alisiond9e29442013-04-17 16:10:18 -040056import com.savoirfairelinux.sflphone.fragments.HistoryFragment;
alisionf76de3b2013-04-16 15:35:22 -040057import com.savoirfairelinux.sflphone.model.SipCall;
alisionf76de3b2013-04-16 15:35:22 -040058import com.savoirfairelinux.sflphone.service.ConfigurationManagerCallback;
alision5f899632013-04-22 17:26:56 -040059import com.savoirfairelinux.sflphone.service.ISipClient;
alisionf76de3b2013-04-16 15:35:22 -040060import com.savoirfairelinux.sflphone.service.ISipService;
61import com.savoirfairelinux.sflphone.service.SipService;
62
alisione2a38e12013-04-25 14:20:20 -040063public class SFLPhoneHomeActivity extends Activity implements ActionBar.TabListener, CallElementListFragment.Callbacks, HistoryFragment.Callbacks {
alision5f899632013-04-22 17:26:56 -040064 SectionsPagerAdapter mSectionsPagerAdapter = null;
65 static final String TAG = "SFLPhoneHome";
66 private static final int REQUEST_CODE_PREFERENCES = 1;
67 ImageButton buttonCall, buttonHangup;
68 private ContactListFragment mContactListFragment = null;
69 private CallElementListFragment mCallElementList = null;
70 private HistoryFragment mHistorySectionFragment = null;
71 private boolean mBound = false;
72 private ISipService service;
alisionf76de3b2013-04-16 15:35:22 -040073
alision5f899632013-04-22 17:26:56 -040074 private static final int ACTION_BAR_TAB_CONTACT = 0;
75 private static final int ACTION_BAR_TAB_CALL = 1;
76 private static final int ACTION_BAR_TAB_HISTORY = 2;
alisionf76de3b2013-04-16 15:35:22 -040077
alision5f899632013-04-22 17:26:56 -040078 /**
79 * The {@link ViewPager} that will host the section contents.
80 */
81 ViewPager mViewPager;
alisionf76de3b2013-04-16 15:35:22 -040082
alision5f899632013-04-22 17:26:56 -040083 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 -040084
alision5f899632013-04-22 17:26:56 -040085 // public SFLPhoneHome extends Activity implements ActionBar.TabListener, OnClickListener
alisionf76de3b2013-04-16 15:35:22 -040086
alision5f899632013-04-22 17:26:56 -040087 /* called before activity is killed, e.g. rotation */
88 @Override
89 protected void onSaveInstanceState(Bundle bundle) {
90 super.onSaveInstanceState(bundle);
91 for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {
92 try {
93 /* putFragment (Bundle bundle, String key, Fragment fragment) */
94 getFragmentManager().putFragment(bundle, mSectionsPagerAdapter.getClassName(i), mSectionsPagerAdapter.getFragment(i));
95 } catch (IllegalStateException e) {
alisione2a38e12013-04-25 14:20:20 -040096 Log.e(TAG, e.toString()+"fragment=" + mSectionsPagerAdapter.getFragment(i));
alision5f899632013-04-22 17:26:56 -040097 }
98 }
99 Log.w(TAG, "onSaveInstanceState()");
100 }
alisionf76de3b2013-04-16 15:35:22 -0400101
alision5f899632013-04-22 17:26:56 -0400102 @Override
103 public void onCreate(Bundle savedInstanceState) {
104 super.onCreate(savedInstanceState);
alisionf76de3b2013-04-16 15:35:22 -0400105
alision5f899632013-04-22 17:26:56 -0400106 // Bind to LocalService
107 if (!mBound) {
108 Log.i(TAG, "onStart: Binding service...");
109 Intent intent = new Intent(this, SipService.class);
110 bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
111 }
alisionf76de3b2013-04-16 15:35:22 -0400112
alision5f899632013-04-22 17:26:56 -0400113 setContentView(R.layout.activity_sflphone_home);
alisionf76de3b2013-04-16 15:35:22 -0400114
alision5f899632013-04-22 17:26:56 -0400115 if (mSectionsPagerAdapter == null) {
116 mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager());
117 }
alisionf76de3b2013-04-16 15:35:22 -0400118
alision5f899632013-04-22 17:26:56 -0400119 /* getFragment(Bundle, String) */
120 if (savedInstanceState != null) {
121 Log.w(TAG, "Activity restarted, recreating PagerAdapter...");
122 /* getFragment (Bundle bundle, String key) */
123 mContactListFragment = (ContactListFragment) getFragmentManager().getFragment(savedInstanceState,
124 mSectionsPagerAdapter.getClassName(ACTION_BAR_TAB_CONTACT));
125 mCallElementList = (CallElementListFragment) getFragmentManager().getFragment(savedInstanceState,
126 mSectionsPagerAdapter.getClassName(ACTION_BAR_TAB_CALL));
127 mHistorySectionFragment = (HistoryFragment) getFragmentManager().getFragment(savedInstanceState,
128 mSectionsPagerAdapter.getClassName(ACTION_BAR_TAB_HISTORY));
129 }
alisionf76de3b2013-04-16 15:35:22 -0400130
alision5f899632013-04-22 17:26:56 -0400131 if (mContactListFragment == null) {
132 mContactListFragment = new ContactListFragment();
133 Log.w(TAG, "Recreated mContactListFragment=" + mContactListFragment);
134 }
135 if (mCallElementList == null) {
136 mCallElementList = new CallElementListFragment();
137 Log.w(TAG, "Recreated mCallElementList=" + mCallElementList);
138 }
139 if (mHistorySectionFragment == null) {
140 mHistorySectionFragment = new HistoryFragment();
141 Log.w(TAG, "Recreated mHistorySectionFragment=" + mHistorySectionFragment);
142 }
alisionf76de3b2013-04-16 15:35:22 -0400143
alision5f899632013-04-22 17:26:56 -0400144 final ActionBar actionBar = getActionBar();
145 actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
146 // final ActionBar actionBar = getActionBar();
alisionf76de3b2013-04-16 15:35:22 -0400147
alision5f899632013-04-22 17:26:56 -0400148 // Set up the ViewPager with the sections adapter.
149 mViewPager = (ViewPager) findViewById(R.id.pager);
150 mViewPager.setAdapter(mSectionsPagerAdapter);
alisionf76de3b2013-04-16 15:35:22 -0400151
alision5f899632013-04-22 17:26:56 -0400152 // When swiping between different sections, select the corresponding tab.
153 // We can also use ActionBar.Tab#select() to do this if we have a reference to the
154 // Tab.
155 mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
156 @Override
157 public void onPageSelected(int position) {
158 actionBar.setSelectedNavigationItem(position);
159 }
160 });
alisionf76de3b2013-04-16 15:35:22 -0400161
alision5f899632013-04-22 17:26:56 -0400162 // For each of the sections in the app, add a tab to the action bar.
163 for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {
164 // Create a tab with text corresponding to the page title defined by the adapter.
165 // Also specify this Activity object, which implements the TabListener interface, as the
166 // listener for when this tab is selected.
167 actionBar.addTab(actionBar.newTab().setIcon(icon_res_id[i]).setText(mSectionsPagerAdapter.getPageTitle(i)).setTabListener(this));
168 }
alisionf76de3b2013-04-16 15:35:22 -0400169
alision5f899632013-04-22 17:26:56 -0400170 actionBar.setSelectedNavigationItem(ACTION_BAR_TAB_CALL);
alisionf76de3b2013-04-16 15:35:22 -0400171
alisione2a38e12013-04-25 14:20:20 -0400172 // buttonHangup.setOnClickListener(new OnClickListener() {
173 // @Override
174 // public void onClick(View v) {
175 // processingHangUpAction();
176 //
177 // }
178 // });
alisionf76de3b2013-04-16 15:35:22 -0400179
alision371b77e2013-04-23 14:51:26 -0400180 // IntentFilter callFilter = new IntentFilter(CallManagerCallBack.NEW_CALL_CREATED);
181 // callFilter.addAction(CallManagerCallBack.INCOMING_CALL);
182 // callFilter.addAction(CallManagerCallBack.CALL_STATE_CHANGED);
183 // LocalBroadcastManager.getInstance(this).registerReceiver(mCallList, callFilter);
184 //
185 // mAccountList = mApplication.getAccountList();
186 // Log.w(TAG, "mAccountList=" + mAccountList + ", mCallElementList=" + mCallElementList);
alisionf76de3b2013-04-16 15:35:22 -0400187
alision5f899632013-04-22 17:26:56 -0400188 IntentFilter accountFilter = new IntentFilter(ConfigurationManagerCallback.ACCOUNTS_CHANGED);
alisionf76de3b2013-04-16 15:35:22 -0400189 accountFilter.addAction(ConfigurationManagerCallback.ACCOUNT_STATE_CHANGED);
alision371b77e2013-04-23 14:51:26 -0400190 // LocalBroadcastManager.getInstance(this).registerReceiver(mAccountList, accountFilter);
alisionf76de3b2013-04-16 15:35:22 -0400191
alisione2a38e12013-04-25 14:20:20 -0400192 // SipCall.setSFLPhoneHomeContext(this);
alision5f899632013-04-22 17:26:56 -0400193 }
alisionf76de3b2013-04-16 15:35:22 -0400194
alision5f899632013-04-22 17:26:56 -0400195 @Override
196 protected void onStart() {
197 Log.i(TAG, "onStart");
198 super.onStart();
199 }
alisionf76de3b2013-04-16 15:35:22 -0400200
alision5f899632013-04-22 17:26:56 -0400201 /* user gets back to the activity, e.g. through task manager */
202 @Override
203 protected void onRestart() {
204 super.onRestart();
205 }
alisionf76de3b2013-04-16 15:35:22 -0400206
alision5f899632013-04-22 17:26:56 -0400207 /* activity gets back to the foreground and user input */
208 @Override
209 protected void onResume() {
210 Log.i(TAG, "onResume");
211 super.onResume();
212 }
alisionf76de3b2013-04-16 15:35:22 -0400213
alision5f899632013-04-22 17:26:56 -0400214 /* activity no more in foreground */
215 @Override
216 protected void onPause() {
217 super.onPause();
218 }
alisionf76de3b2013-04-16 15:35:22 -0400219
alision5f899632013-04-22 17:26:56 -0400220 /* activity is no longer visible */
221 @Override
222 protected void onStop() {
223 super.onStop();
224 }
alisionf76de3b2013-04-16 15:35:22 -0400225
alision5f899632013-04-22 17:26:56 -0400226 /* activity finishes itself or is being killed by the system */
227 @Override
228 protected void onDestroy() {
229 /* stop the service, if no other bound user, no need to check if it is running */
230 if (mBound) {
231 Log.i(TAG, "onStop: Unbinding service...");
232 unbindService(mConnection);
233 mBound = false;
234 }
alisionf76de3b2013-04-16 15:35:22 -0400235
alision5f899632013-04-22 17:26:56 -0400236 /* unregister broadcast receiver */
alision371b77e2013-04-23 14:51:26 -0400237 // LocalBroadcastManager.getInstance(this).unregisterReceiver(mCallList);
238 // LocalBroadcastManager.getInstance(this).unregisterReceiver(mAccountList);
alisionf76de3b2013-04-16 15:35:22 -0400239
alision5f899632013-04-22 17:26:56 -0400240 super.onDestroy();
241 }
alisione2a38e12013-04-25 14:20:20 -0400242
243 public void launchCallActivity(SipCall.CallInfo infos) {
alision371b77e2013-04-23 14:51:26 -0400244 Log.i(TAG, "Launch Call Activity");
245 Bundle bundle = new Bundle();
246 bundle.putParcelable("CallInfo", infos);
247 Intent intent = new Intent().setClass(this, CallActivity.class);
248 intent.putExtras(bundle);
249 startActivity(intent);
250 }
alisionf76de3b2013-04-16 15:35:22 -0400251
alision5f899632013-04-22 17:26:56 -0400252 /** Defines callbacks for service binding, passed to bindService() */
253 private ServiceConnection mConnection = new ServiceConnection() {
alisionf76de3b2013-04-16 15:35:22 -0400254
alision5f899632013-04-22 17:26:56 -0400255 private ISipClient callback = new ISipClient.Stub() {
alision371b77e2013-04-23 14:51:26 -0400256
alision5f899632013-04-22 17:26:56 -0400257 @Override
alision371b77e2013-04-23 14:51:26 -0400258 public void incomingCall(Intent call) throws RemoteException {
259 Log.i(TAG, "Incoming call transfered from Service");
260 SipCall.CallInfo infos = new SipCall.CallInfo(call);
alisione2a38e12013-04-25 14:20:20 -0400261
alision371b77e2013-04-23 14:51:26 -0400262 SipCall c = new SipCall(infos);
263 mCallElementList.addCall(c);
Adrien Béraud1947a102013-04-26 22:05:34 +1000264
265 launchCallActivity(infos);
alision371b77e2013-04-23 14:51:26 -0400266 }
267
268 @Override
269 public void callStateChanged(Intent callState) throws RemoteException {
270 Bundle b = callState.getBundleExtra("com.savoirfairelinux.sflphone.service.newstate");
271 String cID = b.getString("CallID");
272 String state = b.getString("State");
alisione2a38e12013-04-25 14:20:20 -0400273 Log.i(TAG, "callStateChanged" + cID + " " + state);
alision371b77e2013-04-23 14:51:26 -0400274 mCallElementList.updateCall(cID, state);
275
alision5f899632013-04-22 17:26:56 -0400276 }
277 };
alisionf76de3b2013-04-16 15:35:22 -0400278
alision5f899632013-04-22 17:26:56 -0400279 @Override
280 public void onServiceConnected(ComponentName className, IBinder binder) {
281 service = ISipService.Stub.asInterface(binder);
alision371b77e2013-04-23 14:51:26 -0400282
alisione2a38e12013-04-25 14:20:20 -0400283
284 mBound = true;
285 mCallElementList.onServiceSipBinded(service);
286 mHistorySectionFragment.onServiceSipBinded(service);
287 Log.d(TAG, "Service connected service=" + service);
288
alision5f899632013-04-22 17:26:56 -0400289 try {
alision371b77e2013-04-23 14:51:26 -0400290 service.registerClient(callback);
alision5f899632013-04-22 17:26:56 -0400291 } catch (RemoteException e) {
alision371b77e2013-04-23 14:51:26 -0400292 Log.e(TAG, e.toString());
alision5f899632013-04-22 17:26:56 -0400293 }
alision5f899632013-04-22 17:26:56 -0400294 }
295
296 @Override
297 public void onServiceDisconnected(ComponentName arg0) {
alisione2a38e12013-04-25 14:20:20 -0400298
alision5f899632013-04-22 17:26:56 -0400299 mBound = false;
300 Log.d(TAG, "Service disconnected service=" + service);
301 }
302 };
303
304 @Override
305 public boolean onOptionsItemSelected(MenuItem item) {
306 Log.i("SFLphone", "onOptionsItemSelected " + item.getItemId());
307 if (item.getItemId() != 0) {
308 // When the button is clicked, launch an activity through this intent
309 Intent launchPreferencesIntent = new Intent().setClass(this, SFLPhonePreferenceActivity.class);
310
311 // Make it a subactivity so we know when it returns
312 startActivityForResult(launchPreferencesIntent, REQUEST_CODE_PREFERENCES);
313 }
314
315 return super.onOptionsItemSelected(item);
316 }
alision371b77e2013-04-23 14:51:26 -0400317
alision5f899632013-04-22 17:26:56 -0400318 @Override
alision371b77e2013-04-23 14:51:26 -0400319 public void onActivityResult(int requestCode, int resultCode, Intent data) {
alision5f899632013-04-22 17:26:56 -0400320 super.onActivityResult(requestCode, resultCode, data);
alision371b77e2013-04-23 14:51:26 -0400321 if (REQUEST_CODE_PREFERENCES == requestCode && service != null) {
322 // Refresh Spinner with modified accounts
alision5f899632013-04-22 17:26:56 -0400323 mCallElementList.onServiceSipBinded(service);
324 }
325 }
326
327 @Override
328 public boolean onCreateOptionsMenu(Menu menu) {
329 getMenuInflater().inflate(R.menu.activity_sflphone_home, menu);
330 return true;
331 }
332
333 @Override
334 public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
335 }
336
337 @Override
338 public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
339 // When the given tab is selected, switch to the corresponding page in the ViewPager.
340 mViewPager.setCurrentItem(tab.getPosition());
341 }
342
343 @Override
344 public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
345 // Log.d(TAG, "onTabReselected");
346 }
347
alision5f899632013-04-22 17:26:56 -0400348 public void processingHangUpAction() {
349 SipCall call = (SipCall) buttonHangup.getTag();
350 if (call != null)
351 call.notifyServiceHangup(service);
352 }
alisionf76de3b2013-04-16 15:35:22 -0400353
alision5f899632013-04-22 17:26:56 -0400354 /**
355 * A {@link FragmentStatePagerAdapter} that returns a fragment corresponding to one of the primary sections of the app.
356 */
357 public class SectionsPagerAdapter extends FragmentStatePagerAdapter {
alisionf76de3b2013-04-16 15:35:22 -0400358
alision5f899632013-04-22 17:26:56 -0400359 public SectionsPagerAdapter(FragmentManager fm) {
360 super(fm);
361 }
alisionf76de3b2013-04-16 15:35:22 -0400362
alision5f899632013-04-22 17:26:56 -0400363 @Override
364 public Fragment getItem(int i) {
365 Fragment fragment;
alisionf76de3b2013-04-16 15:35:22 -0400366
alision5f899632013-04-22 17:26:56 -0400367 switch (i) {
368 case 0:
369 mContactListFragment = new ContactListFragment();
370 fragment = mContactListFragment;
371 Log.w(TAG, "getItem() ContactListFragment=" + fragment);
372 break;
373 case 1:
374 mCallElementList = new CallElementListFragment();
alisione2a38e12013-04-25 14:20:20 -0400375 // SipCall.setCallElementList(mCallElementList);
alision371b77e2013-04-23 14:51:26 -0400376 // mCallElementList.setAccountList(mAccountList);
alision5f899632013-04-22 17:26:56 -0400377 fragment = mCallElementList;
378 Log.w(TAG, "getItem() CallElementList=" + fragment);
379 break;
380 case 2:
381 fragment = new HistoryFragment();
382 Log.w(TAG, "getItem() HistoryFragment=" + fragment);
383 break;
384 default:
385 Log.e(TAG, "getItem() unknown tab position " + i);
386 return null;
387 }
alisionf76de3b2013-04-16 15:35:22 -0400388
alision5f899632013-04-22 17:26:56 -0400389 // Log.i(TAG, "getItem() fragment is " + fragment);
390 Bundle args = new Bundle();
391 args.putInt(HistoryFragment.ARG_SECTION_NUMBER, i + 1);
392 fragment.setArguments(args);
393 return fragment;
394 }
alisionf76de3b2013-04-16 15:35:22 -0400395
alision5f899632013-04-22 17:26:56 -0400396 public Fragment getFragment(int i) {
397 Fragment fragment;
alisionf76de3b2013-04-16 15:35:22 -0400398
alision5f899632013-04-22 17:26:56 -0400399 switch (i) {
400 case 0:
401 fragment = mContactListFragment;
402 break;
403 case 1:
404 fragment = mCallElementList;
405 break;
406 case 2:
407 fragment = mHistorySectionFragment;
408 break;
409 default:
410 Log.e(TAG, "getClassName: unknown fragment position " + i);
411 fragment = null;
412 }
alisionf76de3b2013-04-16 15:35:22 -0400413
alision5f899632013-04-22 17:26:56 -0400414 // Log.w(TAG, "getFragment: fragment=" + fragment);
415 return fragment;
416 }
alisionf76de3b2013-04-16 15:35:22 -0400417
alision5f899632013-04-22 17:26:56 -0400418 public String getClassName(int i) {
419 String name;
alisionf76de3b2013-04-16 15:35:22 -0400420
alision5f899632013-04-22 17:26:56 -0400421 switch (i) {
422 case 0:
423 name = ContactListFragment.class.getName();
424 break;
425 case 1:
426 name = CallElementListFragment.class.getName();
427 break;
428 case 2:
429 name = HistoryFragment.class.getName();
430 break;
alisionf76de3b2013-04-16 15:35:22 -0400431
alision5f899632013-04-22 17:26:56 -0400432 default:
433 Log.e(TAG, "getClassName: unknown fragment position " + i);
434 return null;
435 }
alisionf76de3b2013-04-16 15:35:22 -0400436
alision5f899632013-04-22 17:26:56 -0400437 // Log.w(TAG, "getClassName: name=" + name);
438 return name;
439 }
alisionf76de3b2013-04-16 15:35:22 -0400440
alision5f899632013-04-22 17:26:56 -0400441 @Override
442 public int getCount() {
443 return 3;
444 }
alisionf76de3b2013-04-16 15:35:22 -0400445
alision5f899632013-04-22 17:26:56 -0400446 @Override
447 public CharSequence getPageTitle(int position) {
448 switch (position) {
449 case 0:
450 return getString(R.string.title_section0).toUpperCase();
451 case 1:
452 return getString(R.string.title_section1).toUpperCase();
453 case 2:
454 return getString(R.string.title_section2).toUpperCase();
455 case 3:
456 return getString(R.string.title_section3).toUpperCase();
457 default:
458 Log.e(TAG, "getPageTitle: unknown tab position " + position);
459 break;
460 }
461 return null;
462 }
463 }
alisionf76de3b2013-04-16 15:35:22 -0400464
alision371b77e2013-04-23 14:51:26 -0400465 @Override
466 public void onCallSelected(SipCall c) {
467 launchCallActivity(c.mCallInfo);
alisione2a38e12013-04-25 14:20:20 -0400468
469 }
470
471 @Override
472 public ISipService getService() {
473 return service;
alision371b77e2013-04-23 14:51:26 -0400474 }
475
alisionf76de3b2013-04-16 15:35:22 -0400476}