Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 31 | package com.savoirfairelinux.sflphone.client; |
| 32 | |
Emeric Vigier | e89b48b | 2012-08-30 14:16:46 -0400 | [diff] [blame] | 33 | import java.util.Random; |
| 34 | |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 35 | import android.app.ActionBar; |
| 36 | import android.app.Activity; |
Emeric Vigier | 12d61d8 | 2012-09-19 15:08:18 -0400 | [diff] [blame] | 37 | import android.app.AlertDialog; |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 38 | import android.app.Fragment; |
| 39 | import android.app.FragmentManager; |
| 40 | import android.app.FragmentTransaction; |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 41 | import android.content.ComponentName; |
| 42 | import android.content.Context; |
Alexandre Savard | 1bcaf53 | 2012-09-05 16:23:02 -0400 | [diff] [blame] | 43 | import android.content.Intent; |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 44 | import android.content.IntentFilter; |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 45 | import android.content.ServiceConnection; |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 46 | import android.os.Bundle; |
Emeric Vigier | 383b2a2 | 2012-08-27 14:20:05 -0400 | [diff] [blame] | 47 | import android.os.Handler; |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 48 | import android.os.IBinder; |
Emeric Vigier | 383b2a2 | 2012-08-27 14:20:05 -0400 | [diff] [blame] | 49 | import android.os.Message; |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 50 | import android.os.RemoteException; |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 51 | import android.support.v13.app.FragmentStatePagerAdapter; |
| 52 | import android.support.v4.view.ViewPager; |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 53 | import android.support.v4.content.LocalBroadcastManager; |
Emeric Vigier | 05e894e | 2012-08-20 13:53:02 -0400 | [diff] [blame] | 54 | import android.util.Log; |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 55 | import android.view.Gravity; |
| 56 | import android.view.LayoutInflater; |
| 57 | import android.view.Menu; |
Alexandre Savard | 1bcaf53 | 2012-09-05 16:23:02 -0400 | [diff] [blame] | 58 | import android.view.MenuItem; |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 59 | import android.view.View; |
| 60 | import android.view.ViewGroup; |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 61 | import android.view.View.OnClickListener; |
Emeric Vigier | a6bdb70 | 2012-08-31 15:34:53 -0400 | [diff] [blame] | 62 | import android.view.animation.AlphaAnimation; |
| 63 | import android.view.animation.Animation; |
| 64 | import android.view.animation.LinearInterpolator; |
Emeric Vigier | eaf2c49 | 2012-09-19 14:38:20 -0400 | [diff] [blame] | 65 | import android.widget.Button; |
Emeric Vigier | d5c17f5 | 2012-08-29 09:29:33 -0400 | [diff] [blame] | 66 | import android.widget.EditText; |
Emeric Vigier | e89b48b | 2012-08-30 14:16:46 -0400 | [diff] [blame] | 67 | import android.widget.ImageButton; |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 68 | import android.widget.TextView; |
| 69 | |
| 70 | import com.savoirfairelinux.sflphone.R; |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 71 | import com.savoirfairelinux.sflphone.service.ISipService; |
Emeric Vigier | eaf2c49 | 2012-09-19 14:38:20 -0400 | [diff] [blame] | 72 | import com.savoirfairelinux.sflphone.service.SipService; |
Alexandre Savard | 6b8d1df | 2012-10-23 16:44:43 -0400 | [diff] [blame] | 73 | import com.savoirfairelinux.sflphone.utils.AccountList; |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 74 | import com.savoirfairelinux.sflphone.utils.CallList; |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 75 | |
Alexandre Savard | 7a902bc | 2012-10-04 16:32:35 -0400 | [diff] [blame] | 76 | import java.util.HashMap; |
| 77 | |
Emeric Vigier | 62ca14d | 2012-08-24 11:05:09 -0400 | [diff] [blame] | 78 | public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnClickListener |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 79 | { |
Emeric Vigier | f24aca9 | 2012-11-06 19:11:24 -0500 | [diff] [blame] | 80 | SectionsPagerAdapter mSectionsPagerAdapter = null; |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 81 | static final String TAG = "SFLPhoneHome"; |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 82 | private static final int REQUEST_CODE_PREFERENCES = 1; |
| 83 | ImageButton buttonCall, buttonHangup; |
Emeric Vigier | 419ba7b | 2012-09-19 14:55:14 -0400 | [diff] [blame] | 84 | static Animation animation; |
Emeric Vigier | f24aca9 | 2012-11-06 19:11:24 -0500 | [diff] [blame] | 85 | private ContactListFragment mContactListFragment = null; |
| 86 | private CallElementList mCallElementList = null; |
| 87 | private HistorySectionFragment mHistorySectionFragment = null; |
| 88 | private ButtonSectionFragment mButtonSectionFragment = null; |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 89 | private boolean mBound = false; |
| 90 | private ISipService service; |
Emeric Vigier | cc0785a | 2012-11-06 19:07:48 -0500 | [diff] [blame] | 91 | public AccountList mAccountList; |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 92 | public CallList mCallList = new CallList(this); |
Emeric Vigier | 1f1ced3 | 2012-11-02 16:56:32 -0400 | [diff] [blame] | 93 | private SFLphoneApplication mApplication; |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 94 | |
Alexandre Savard | 48240e8 | 2012-10-26 10:36:03 -0400 | [diff] [blame] | 95 | private static final int ACTION_BAR_TAB_CONTACT = 0; |
| 96 | private static final int ACTION_BAR_TAB_CALL = 1; |
| 97 | private static final int ACTION_BAR_TAB_HISTORY = 2; |
Emeric Vigier | f24aca9 | 2012-11-06 19:11:24 -0500 | [diff] [blame] | 98 | private static final int ACTION_BAR_TAB_TEST = 3; |
Alexandre Savard | 48240e8 | 2012-10-26 10:36:03 -0400 | [diff] [blame] | 99 | |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 100 | /** |
| 101 | * The {@link ViewPager} that will host the section contents. |
| 102 | */ |
| 103 | ViewPager mViewPager; |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 104 | |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 105 | final private int[] icon_res_id = {R.drawable.ic_tab_call, R.drawable.ic_tab_call, R.drawable.ic_tab_history, R.drawable.ic_tab_play_selected}; |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 106 | |
Alexandre Savard | 817dc50 | 2012-10-22 11:47:29 -0400 | [diff] [blame] | 107 | // public SFLPhoneHome extends Activity implements ActionBar.TabListener, OnClickListener |
| 108 | |
Emeric Vigier | f24aca9 | 2012-11-06 19:11:24 -0500 | [diff] [blame] | 109 | /* called before activity is killed, e.g. rotation */ |
| 110 | @Override |
| 111 | protected void onSaveInstanceState(Bundle bundle) { |
| 112 | super.onSaveInstanceState(bundle); |
| 113 | for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) { |
| 114 | try { |
| 115 | /* putFragment (Bundle bundle, String key, Fragment fragment) */ |
| 116 | getFragmentManager().putFragment(bundle, mSectionsPagerAdapter.getClassName(i), mSectionsPagerAdapter.getFragment(i)); |
| 117 | } catch (IllegalStateException e) { |
| 118 | Log.e(TAG, "IllegalStateException: fragment=" + mSectionsPagerAdapter.getFragment(i)); |
| 119 | } |
| 120 | } |
| 121 | Log.w(TAG, "onSaveInstanceState()"); |
| 122 | } |
| 123 | |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 124 | @Override |
| 125 | public void onCreate(Bundle savedInstanceState) |
| 126 | { |
| 127 | super.onCreate(savedInstanceState); |
Alexandre Savard | 817dc50 | 2012-10-22 11:47:29 -0400 | [diff] [blame] | 128 | |
Emeric Vigier | 1f1ced3 | 2012-11-02 16:56:32 -0400 | [diff] [blame] | 129 | mApplication = (SFLphoneApplication) getApplication(); |
| 130 | |
Alexandre Savard | 817dc50 | 2012-10-22 11:47:29 -0400 | [diff] [blame] | 131 | // Bind to LocalService |
| 132 | if (!mBound) { |
| 133 | Log.i(TAG, "onStart: Binding service..."); |
| 134 | Intent intent = new Intent(this, SipService.class); |
| 135 | bindService(intent, mConnection, Context.BIND_AUTO_CREATE); |
| 136 | } |
| 137 | |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 138 | setContentView(R.layout.activity_sflphone_home); |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 139 | |
Emeric Vigier | f24aca9 | 2012-11-06 19:11:24 -0500 | [diff] [blame] | 140 | if (mSectionsPagerAdapter == null) { |
| 141 | mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager()); |
| 142 | } |
| 143 | |
| 144 | /* getFragment(Bundle, String) */ |
| 145 | if (savedInstanceState != null) { |
| 146 | Log.w(TAG, "Activity restarted, recreating PagerAdapter..."); |
| 147 | /* getFragment (Bundle bundle, String key) */ |
| 148 | mContactListFragment = (ContactListFragment) getFragmentManager().getFragment( |
| 149 | savedInstanceState, mSectionsPagerAdapter.getClassName(ACTION_BAR_TAB_CONTACT)); |
| 150 | mCallElementList = (CallElementList) getFragmentManager().getFragment( |
| 151 | savedInstanceState, mSectionsPagerAdapter.getClassName(ACTION_BAR_TAB_CALL)); |
| 152 | mHistorySectionFragment = (HistorySectionFragment) getFragmentManager().getFragment( |
| 153 | savedInstanceState, mSectionsPagerAdapter.getClassName(ACTION_BAR_TAB_HISTORY)); |
| 154 | mButtonSectionFragment = (ButtonSectionFragment) getFragmentManager().getFragment( |
| 155 | savedInstanceState, mSectionsPagerAdapter.getClassName(ACTION_BAR_TAB_TEST)); |
| 156 | } |
| 157 | |
| 158 | if (mContactListFragment == null) { |
| 159 | mContactListFragment = new ContactListFragment(); |
| 160 | Log.w(TAG, "Recreated mContactListFragment=" + mContactListFragment); |
| 161 | } |
| 162 | if (mCallElementList == null) { |
| 163 | mCallElementList = new CallElementList(); |
| 164 | Log.w(TAG, "Recreated mCallElementList=" + mCallElementList); |
| 165 | } |
| 166 | if (mHistorySectionFragment == null) { |
| 167 | mHistorySectionFragment = new HistorySectionFragment(); |
| 168 | Log.w(TAG, "Recreated mHistorySectionFragment=" + mHistorySectionFragment); |
| 169 | } |
| 170 | if (mButtonSectionFragment == null) { |
| 171 | mButtonSectionFragment = new ButtonSectionFragment(); |
| 172 | Log.w(TAG, "Recreated mButtonSectionFragment=" + mButtonSectionFragment); |
| 173 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 174 | |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 175 | final ActionBar actionBar = getActionBar(); |
| 176 | actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); |
| 177 | // final ActionBar actionBar = getActionBar(); |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 178 | |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 179 | // Set up the ViewPager with the sections adapter. |
| 180 | mViewPager = (ViewPager) findViewById(R.id.pager); |
| 181 | mViewPager.setAdapter(mSectionsPagerAdapter); |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 182 | |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 183 | // When swiping between different sections, select the corresponding tab. |
| 184 | // We can also use ActionBar.Tab#select() to do this if we have a reference to the |
| 185 | // Tab. |
| 186 | mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() |
| 187 | { |
| 188 | @Override |
| 189 | public void onPageSelected(int position) |
| 190 | { |
| 191 | actionBar.setSelectedNavigationItem(position); |
| 192 | } |
| 193 | }); |
Emeric Vigier | 383b2a2 | 2012-08-27 14:20:05 -0400 | [diff] [blame] | 194 | |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 195 | // For each of the sections in the app, add a tab to the action bar. |
| 196 | for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) { |
| 197 | // Create a tab with text corresponding to the page title defined by the adapter. |
| 198 | // Also specify this Activity object, which implements the TabListener interface, as the |
| 199 | // listener for when this tab is selected. |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 200 | actionBar.addTab(actionBar.newTab().setIcon(icon_res_id[i]).setText(mSectionsPagerAdapter.getPageTitle(i)).setTabListener(this)); |
| 201 | } |
Emeric Vigier | 383b2a2 | 2012-08-27 14:20:05 -0400 | [diff] [blame] | 202 | |
Alexandre Savard | 48240e8 | 2012-10-26 10:36:03 -0400 | [diff] [blame] | 203 | actionBar.setSelectedNavigationItem(ACTION_BAR_TAB_CALL); |
Alexandre Savard | cb66fa4 | 2012-10-26 10:06:16 -0400 | [diff] [blame] | 204 | |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 205 | buttonCall = (ImageButton) findViewById(R.id.buttonCall); |
| 206 | buttonHangup = (ImageButton) findViewById(R.id.buttonHangUp); |
Alexandre Savard | def3bfa | 2012-09-12 16:20:06 -0400 | [diff] [blame] | 207 | |
Emeric Vigier | 419ba7b | 2012-09-19 14:55:14 -0400 | [diff] [blame] | 208 | // Change alpha from fully visible to invisible |
| 209 | animation = new AlphaAnimation(1, 0); |
| 210 | // duration - half a second |
| 211 | animation.setDuration(500); |
| 212 | // do not alter animation rate |
| 213 | animation.setInterpolator(new LinearInterpolator()); |
| 214 | // Repeat animation infinitely |
| 215 | animation.setRepeatCount(Animation.INFINITE); |
| 216 | // Reverse |
| 217 | animation.setRepeatMode(Animation.REVERSE); |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 218 | |
| 219 | LocalBroadcastManager.getInstance(this).registerReceiver(mCallList, new IntentFilter("new-call-created")); |
| 220 | LocalBroadcastManager.getInstance(this).registerReceiver(mCallList, new IntentFilter("call-state-changed")); |
| 221 | LocalBroadcastManager.getInstance(this).registerReceiver(mCallList, new IntentFilter("incoming-call")); |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 222 | |
Emeric Vigier | cc0785a | 2012-11-06 19:07:48 -0500 | [diff] [blame] | 223 | mAccountList = mApplication.getAccountList(); |
Emeric Vigier | 364499e | 2012-11-06 19:15:45 -0500 | [diff] [blame^] | 224 | Log.w(TAG, "mAccountList=" + mAccountList + ", mCallElementList=" + mCallElementList); |
Emeric Vigier | cc0785a | 2012-11-06 19:07:48 -0500 | [diff] [blame] | 225 | |
Alexandre Savard | bb6f187 | 2012-11-01 17:25:55 -0400 | [diff] [blame] | 226 | LocalBroadcastManager.getInstance(this).registerReceiver(mAccountList, new IntentFilter("accounts-changed")); |
| 227 | LocalBroadcastManager.getInstance(this).registerReceiver(mAccountList, new IntentFilter("account-state-changed")); |
| 228 | |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 229 | SipCall.setSFLPhoneHomeContext(this); |
Alexandre Savard | 6c0584e | 2012-09-20 09:42:59 -0400 | [diff] [blame] | 230 | } |
Alexandre Savard | 1bcaf53 | 2012-09-05 16:23:02 -0400 | [diff] [blame] | 231 | |
Emeric Vigier | 12d61d8 | 2012-09-19 15:08:18 -0400 | [diff] [blame] | 232 | @Override |
| 233 | protected void onStart() { |
| 234 | Log.i(TAG, "onStart"); |
| 235 | super.onStart(); |
| 236 | } |
Alexandre Savard | 1bcaf53 | 2012-09-05 16:23:02 -0400 | [diff] [blame] | 237 | |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 238 | /* user gets back to the activity, e.g. through task manager */ |
Emeric Vigier | 12d61d8 | 2012-09-19 15:08:18 -0400 | [diff] [blame] | 239 | @Override |
| 240 | protected void onRestart() { |
| 241 | super.onRestart(); |
| 242 | } |
| 243 | |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 244 | /* activity gets back to the foreground and user input */ |
Emeric Vigier | 12d61d8 | 2012-09-19 15:08:18 -0400 | [diff] [blame] | 245 | @Override |
| 246 | protected void onResume() { |
| 247 | Log.i(TAG, "onResume"); |
| 248 | super.onResume(); |
Emeric Vigier | 12d61d8 | 2012-09-19 15:08:18 -0400 | [diff] [blame] | 249 | } |
| 250 | |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 251 | /* activity no more in foreground */ |
Emeric Vigier | 12d61d8 | 2012-09-19 15:08:18 -0400 | [diff] [blame] | 252 | @Override |
| 253 | protected void onPause() { |
Emeric Vigier | 12d61d8 | 2012-09-19 15:08:18 -0400 | [diff] [blame] | 254 | super.onPause(); |
| 255 | } |
| 256 | |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 257 | /* activity is no longer visible */ |
Emeric Vigier | 12d61d8 | 2012-09-19 15:08:18 -0400 | [diff] [blame] | 258 | @Override |
| 259 | protected void onStop() { |
| 260 | super.onStop(); |
Alexandre Savard | 817dc50 | 2012-10-22 11:47:29 -0400 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | /* activity finishes itself or is being killed by the system */ |
| 264 | @Override |
| 265 | protected void onDestroy() { |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 266 | /* stop the service, if no other bound user, no need to check if it is running */ |
| 267 | if (mBound) { |
Emeric Vigier | fae29bd | 2012-09-24 11:32:03 -0400 | [diff] [blame] | 268 | Log.i(TAG, "onStop: Unbinding service..."); |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 269 | unbindService(mConnection); |
| 270 | mBound = false; |
| 271 | } |
Emeric Vigier | cc0785a | 2012-11-06 19:07:48 -0500 | [diff] [blame] | 272 | // Log.i(TAG, "onDestroy: stopping SipService..."); |
| 273 | // stopService(new Intent(this, SipService.class)); |
| 274 | // mApplication.setServiceRunning(false); |
Emeric Vigier | e2729af | 2012-11-05 11:24:02 -0500 | [diff] [blame] | 275 | |
| 276 | /* unregister broadcast receiver */ |
| 277 | LocalBroadcastManager.getInstance(this).unregisterReceiver(mCallList); |
| 278 | LocalBroadcastManager.getInstance(this).unregisterReceiver(mAccountList); |
| 279 | |
Emeric Vigier | 12d61d8 | 2012-09-19 15:08:18 -0400 | [diff] [blame] | 280 | super.onDestroy(); |
| 281 | } |
Emeric Vigier | cc0785a | 2012-11-06 19:07:48 -0500 | [diff] [blame] | 282 | |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 283 | /** Defines callbacks for service binding, passed to bindService() */ |
| 284 | private ServiceConnection mConnection = new ServiceConnection() { |
| 285 | |
| 286 | @Override |
| 287 | public void onServiceConnected(ComponentName className, |
| 288 | IBinder binder) { |
| 289 | service = ISipService.Stub.asInterface(binder); |
Emeric Vigier | 1f1ced3 | 2012-11-02 16:56:32 -0400 | [diff] [blame] | 290 | mApplication.setSipService(service); |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 291 | mBound = true; |
Alexandre Savard | bb6f187 | 2012-11-01 17:25:55 -0400 | [diff] [blame] | 292 | mAccountList.setSipService(service); |
Emeric Vigier | cc0785a | 2012-11-06 19:07:48 -0500 | [diff] [blame] | 293 | Log.d(TAG, "Service connected service=" + service); |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | @Override |
| 297 | public void onServiceDisconnected(ComponentName arg0) { |
Emeric Vigier | 1f1ced3 | 2012-11-02 16:56:32 -0400 | [diff] [blame] | 298 | mApplication.setSipService(null); |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 299 | mBound = false; |
Emeric Vigier | 364499e | 2012-11-06 19:15:45 -0500 | [diff] [blame^] | 300 | Log.d(TAG, "Service disconnected service=" + service); |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 301 | } |
| 302 | }; |
| 303 | |
Emeric Vigier | cc0785a | 2012-11-06 19:07:48 -0500 | [diff] [blame] | 304 | // private void startSipService() { |
| 305 | // Thread thread = new Thread("StartSFLphoneService") { |
| 306 | // public void run() { |
| 307 | // Intent sipServiceIntent = new Intent(SFLPhoneHome.this, SipService.class); |
| 308 | // //sipServiceIntent.putExtra(ServiceConstants.EXTRA_OUTGOING_ACTIVITY, new ComponentName(SFLPhoneHome.this, SFLPhoneHome.class)); |
| 309 | // startService(sipServiceIntent); |
| 310 | // mApplication.setServiceRunning(true); |
| 311 | // }; |
| 312 | // }; |
| 313 | // try { |
| 314 | // thread.start(); |
| 315 | // } catch (IllegalThreadStateException e) { |
| 316 | // AlertDialog.Builder builder = new AlertDialog.Builder(this); |
| 317 | // builder.setMessage("Cannot start SFLPhone SipService!"); |
| 318 | // AlertDialog alert = builder.create(); |
| 319 | // alert.show(); |
| 320 | // finish(); |
| 321 | // } |
| 322 | // } |
Emeric Vigier | 12d61d8 | 2012-09-19 15:08:18 -0400 | [diff] [blame] | 323 | |
| 324 | @Override |
| 325 | public boolean onOptionsItemSelected(MenuItem item) { |
| 326 | Log.i("SFLphone", "onOptionsItemSelected " + item.getItemId()); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 327 | if(item.getItemId() != 0) { |
| 328 | // When the button is clicked, launch an activity through this intent |
| 329 | Intent launchPreferencesIntent = new Intent().setClass(this, SFLPhonePreferenceActivity.class); |
Alexandre Savard | 1bcaf53 | 2012-09-05 16:23:02 -0400 | [diff] [blame] | 330 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 331 | // Make it a subactivity so we know when it returns |
| 332 | startActivityForResult(launchPreferencesIntent, REQUEST_CODE_PREFERENCES); |
Alexandre Savard | 1bcaf53 | 2012-09-05 16:23:02 -0400 | [diff] [blame] | 333 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 334 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 335 | return super.onOptionsItemSelected(item); |
| 336 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 337 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 338 | @Override |
| 339 | public boolean onCreateOptionsMenu(Menu menu) |
| 340 | { |
| 341 | getMenuInflater().inflate(R.menu.activity_sflphone_home, menu); |
| 342 | return true; |
| 343 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 344 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 345 | @Override |
| 346 | public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) |
| 347 | { |
| 348 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 349 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 350 | @Override |
| 351 | public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) |
| 352 | { |
| 353 | // When the given tab is selected, switch to the corresponding page in the ViewPager. |
| 354 | mViewPager.setCurrentItem(tab.getPosition()); |
| 355 | } |
| 356 | |
| 357 | @Override |
| 358 | public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) |
| 359 | { |
| 360 | // Log.d(TAG, "onTabReselected"); |
| 361 | } |
| 362 | |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 363 | public void onSelectedCallAction(SipCall call) { |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 364 | int callState = call.getCallStateInt(); |
| 365 | |
| 366 | if((callState == SipCall.CALL_STATE_NONE) || |
| 367 | (callState == SipCall.CALL_STATE_CURRENT)) { |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 368 | buttonCall.setEnabled(false); |
| 369 | buttonHangup.setEnabled(true); |
| 370 | } |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 371 | else { |
| 372 | buttonCall.setEnabled(true); |
| 373 | buttonHangup.setEnabled(false); |
| 374 | } |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 375 | |
| 376 | buttonCall.setTag(call); |
| 377 | buttonHangup.setTag(call); |
| 378 | } |
| 379 | |
| 380 | public void onUnselectedCallAction() { |
| 381 | buttonCall.setTag(null); |
| 382 | buttonCall.setTag(null); |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 383 | |
| 384 | buttonCall.setEnabled(true); |
| 385 | buttonHangup.setEnabled(false); |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 386 | } |
| 387 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 388 | public void setIncomingCallID(String accountID, String callID, String from) { |
Emeric Vigier | 419ba7b | 2012-09-19 14:55:14 -0400 | [diff] [blame] | 389 | Log.i(TAG, "incomingCall(" + accountID + ", " + callID + ", " + from + ")"); |
Emeric Vigier | 419ba7b | 2012-09-19 14:55:14 -0400 | [diff] [blame] | 390 | buttonCall.startAnimation(animation); |
| 391 | buttonCall.setImageResource(R.drawable.ic_incomingcall); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 392 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 393 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 394 | /** |
| 395 | * A {@link FragmentStatePagerAdapter} that returns a fragment corresponding to |
| 396 | * one of the primary sections of the app. |
| 397 | */ |
| 398 | public class SectionsPagerAdapter extends FragmentStatePagerAdapter |
| 399 | { |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 400 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 401 | public SectionsPagerAdapter(FragmentManager fm) |
| 402 | { |
| 403 | super(fm); |
| 404 | } |
Emeric Vigier | 05e894e | 2012-08-20 13:53:02 -0400 | [diff] [blame] | 405 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 406 | @Override |
| 407 | public Fragment getItem(int i) |
| 408 | { |
| 409 | Fragment fragment; |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 410 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 411 | switch (i) { |
| 412 | case 0: |
Emeric Vigier | 1f1ced3 | 2012-11-02 16:56:32 -0400 | [diff] [blame] | 413 | mContactListFragment = new ContactListFragment(); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 414 | fragment = mContactListFragment; |
Emeric Vigier | 364499e | 2012-11-06 19:15:45 -0500 | [diff] [blame^] | 415 | Log.w(TAG, "getItem() ContactListFragment=" + fragment); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 416 | break; |
| 417 | case 1: |
Emeric Vigier | 1f1ced3 | 2012-11-02 16:56:32 -0400 | [diff] [blame] | 418 | mCallElementList = new CallElementList(); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 419 | SipCall.setCallElementList(mCallElementList); |
Alexandre Savard | bb6f187 | 2012-11-01 17:25:55 -0400 | [diff] [blame] | 420 | mCallElementList.setAccountList(mAccountList); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 421 | fragment = mCallElementList; |
Emeric Vigier | 364499e | 2012-11-06 19:15:45 -0500 | [diff] [blame^] | 422 | Log.w(TAG, "getItem() CallElementList=" + fragment); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 423 | break; |
| 424 | case 2: |
Emeric Vigier | b16eed3 | 2012-11-06 19:12:54 -0500 | [diff] [blame] | 425 | fragment = new HistorySectionFragment(); |
Emeric Vigier | 364499e | 2012-11-06 19:15:45 -0500 | [diff] [blame^] | 426 | Log.w(TAG, "getItem() HistorySectionFragment=" + fragment); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 427 | break; |
| 428 | case 3: |
| 429 | fragment = new ButtonSectionFragment(); |
Emeric Vigier | 364499e | 2012-11-06 19:15:45 -0500 | [diff] [blame^] | 430 | Log.w(TAG, "getItem() ButtonSectionFragment=" + fragment); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 431 | break; |
| 432 | default: |
Emeric Vigier | 364499e | 2012-11-06 19:15:45 -0500 | [diff] [blame^] | 433 | Log.e(TAG, "getItem() unknown tab position " + i); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 434 | return null; |
| 435 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 436 | |
Emeric Vigier | 364499e | 2012-11-06 19:15:45 -0500 | [diff] [blame^] | 437 | // Log.i(TAG, "getItem() fragment is " + fragment); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 438 | Bundle args = new Bundle(); |
Emeric Vigier | b16eed3 | 2012-11-06 19:12:54 -0500 | [diff] [blame] | 439 | args.putInt(HistorySectionFragment.ARG_SECTION_NUMBER, i + 1); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 440 | fragment.setArguments(args); |
| 441 | return fragment; |
| 442 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 443 | |
Emeric Vigier | f24aca9 | 2012-11-06 19:11:24 -0500 | [diff] [blame] | 444 | public Fragment getFragment(int i) |
| 445 | { |
| 446 | Fragment fragment; |
| 447 | |
| 448 | switch (i) { |
| 449 | case 0: |
| 450 | fragment = mContactListFragment; |
| 451 | break; |
| 452 | case 1: |
| 453 | fragment = mCallElementList; |
| 454 | break; |
| 455 | case 2: |
| 456 | fragment = mHistorySectionFragment; |
| 457 | break; |
| 458 | case 3: |
| 459 | fragment = mButtonSectionFragment; |
| 460 | break; |
| 461 | default: |
| 462 | Log.e(TAG, "getClassName: unknown fragment position " + i); |
| 463 | fragment = null; |
| 464 | } |
| 465 | |
| 466 | // Log.w(TAG, "getFragment: fragment=" + fragment); |
| 467 | return fragment; |
| 468 | } |
| 469 | |
| 470 | public String getClassName(int i) |
| 471 | { |
| 472 | String name; |
| 473 | |
| 474 | switch (i) { |
| 475 | case 0: |
| 476 | name = ContactListFragment.class.getName(); |
| 477 | break; |
| 478 | case 1: |
| 479 | name = CallElementList.class.getName(); |
| 480 | break; |
| 481 | case 2: |
| 482 | name = HistorySectionFragment.class.getName(); |
| 483 | break; |
| 484 | case 3: |
| 485 | name = ButtonSectionFragment.class.getName(); |
| 486 | break; |
| 487 | default: |
| 488 | Log.e(TAG, "getClassName: unknown fragment position " + i); |
| 489 | return null; |
| 490 | } |
| 491 | |
| 492 | // Log.w(TAG, "getClassName: name=" + name); |
| 493 | return name; |
| 494 | } |
| 495 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 496 | @Override |
| 497 | public int getCount() |
| 498 | { |
| 499 | return 4; |
| 500 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 501 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 502 | @Override |
| 503 | public CharSequence getPageTitle(int position) |
| 504 | { |
| 505 | switch (position) { |
| 506 | case 0: |
| 507 | return getString(R.string.title_section0).toUpperCase(); |
| 508 | case 1: |
| 509 | return getString(R.string.title_section1).toUpperCase(); |
| 510 | case 2: |
| 511 | return getString(R.string.title_section2).toUpperCase(); |
| 512 | case 3: |
| 513 | return getString(R.string.title_section3).toUpperCase(); |
| 514 | default: |
| 515 | Log.e(TAG, "getPageTitle: unknown tab position " + position); |
| 516 | break; |
| 517 | } |
| 518 | return null; |
| 519 | } |
| 520 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 521 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 522 | /** |
| 523 | * A dummy fragment representing a section of the app, but that simply |
| 524 | * displays dummy text. |
| 525 | */ |
Emeric Vigier | b16eed3 | 2012-11-06 19:12:54 -0500 | [diff] [blame] | 526 | public static class HistorySectionFragment extends Fragment |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 527 | { |
Emeric Vigier | b16eed3 | 2012-11-06 19:12:54 -0500 | [diff] [blame] | 528 | public HistorySectionFragment() |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 529 | { |
| 530 | setRetainInstance(true); |
| 531 | } |
Emeric Vigier | 05e894e | 2012-08-20 13:53:02 -0400 | [diff] [blame] | 532 | |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 533 | public static final String ARG_SECTION_NUMBER = "section_number"; |
| 534 | |
| 535 | @Override |
| 536 | public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) |
| 537 | { |
| 538 | TextView textView = new TextView(getActivity()); |
| 539 | textView.setGravity(Gravity.CENTER); |
| 540 | Bundle args = getArguments(); |
Emeric Vigier | 364499e | 2012-11-06 19:15:45 -0500 | [diff] [blame^] | 541 | textView.setText("ARG_SECTION_NUMBER=" + Integer.toString(args.getInt(ARG_SECTION_NUMBER))); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 542 | return textView; |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | @Override |
Emeric Vigier | 62ca14d | 2012-08-24 11:05:09 -0400 | [diff] [blame] | 547 | public void onClick(View view) |
Emeric Vigier | e89b48b | 2012-08-30 14:16:46 -0400 | [diff] [blame] | 548 | { |
Alexandre Savard | 6b8d1df | 2012-10-23 16:44:43 -0400 | [diff] [blame] | 549 | Log.i(TAG, "onClic from SFLPhoneHome"); |
Alexandre Savard | 9105244 | 2012-10-25 16:14:26 -0400 | [diff] [blame] | 550 | switch (view.getId()) { |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 551 | case R.id.buttonCall: |
Alexandre Savard | 6b8d1df | 2012-10-23 16:44:43 -0400 | [diff] [blame] | 552 | processingNewCallAction(); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 553 | break; |
| 554 | case R.id.buttonHangUp: |
Alexandre Savard | 6b8d1df | 2012-10-23 16:44:43 -0400 | [diff] [blame] | 555 | processingHangUpAction(); |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 556 | break; |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 557 | default: |
| 558 | Log.w(TAG, "unknown button " + view.getId()); |
| 559 | break; |
Emeric Vigier | 6119d78 | 2012-09-21 18:04:14 -0400 | [diff] [blame] | 560 | } |
Emeric Vigier | bbde1ae | 2012-09-21 18:13:56 -0400 | [diff] [blame] | 561 | } |
Alexandre Savard | 6b8d1df | 2012-10-23 16:44:43 -0400 | [diff] [blame] | 562 | |
| 563 | public void processingNewCallAction() { |
Alexandre Savard | 60f0f1c | 2012-11-01 09:40:34 -0400 | [diff] [blame] | 564 | // String accountID = mAccountList.currentAccountID; |
Emeric Vigier | 364499e | 2012-11-06 19:15:45 -0500 | [diff] [blame^] | 565 | Log.w(TAG, "processingNewCallAction() mCallElementList=" + mCallElementList); |
Alexandre Savard | 60f0f1c | 2012-11-01 09:40:34 -0400 | [diff] [blame] | 566 | String accountID = mCallElementList.getSelectedAccount(); |
Alexandre Savard | cb66fa4 | 2012-10-26 10:06:16 -0400 | [diff] [blame] | 567 | EditText editText = (EditText) findViewById(R.id.phoneNumberTextEntry); |
| 568 | String to = editText.getText().toString(); |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 569 | |
Alexandre Savard | 6b8d1df | 2012-10-23 16:44:43 -0400 | [diff] [blame] | 570 | Random random = new Random(); |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 571 | String callID = Integer.toString(random.nextInt()); |
| 572 | SipCall.CallInfo info = new SipCall.CallInfo(); |
Alexandre Savard | 6b8d1df | 2012-10-23 16:44:43 -0400 | [diff] [blame] | 573 | |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 574 | info.mCallID = callID; |
| 575 | info.mAccountID = accountID; |
| 576 | info.mDisplayName = "Cool Guy!"; |
| 577 | info.mPhone = to; |
| 578 | info.mEmail = "coolGuy@coolGuy.com"; |
Alexandre Savard | 2f1ae54 | 2012-10-26 17:05:00 -0400 | [diff] [blame] | 579 | info.mCallType = SipCall.CALL_TYPE_OUTGOING; |
Alexandre Savard | 6b8d1df | 2012-10-23 16:44:43 -0400 | [diff] [blame] | 580 | |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 581 | SipCall call = CallList.getCallInstance(info); |
| 582 | call.launchCallActivity(this); |
| 583 | call.placeCallUpdateUi(); |
| 584 | call.notifyServicePlaceCall(service); |
| 585 | |
| 586 | onSelectedCallAction(call); |
Alexandre Savard | 6b8d1df | 2012-10-23 16:44:43 -0400 | [diff] [blame] | 587 | } |
| 588 | |
| 589 | public void processingHangUpAction() { |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 590 | SipCall call = (SipCall)buttonHangup.getTag(); |
| 591 | if(call != null) |
| 592 | call.notifyServiceHangup(service); |
Alexandre Savard | 6b8d1df | 2012-10-23 16:44:43 -0400 | [diff] [blame] | 593 | } |
Adrien Béraud | ffd3241 | 2012-08-07 18:39:23 -0400 | [diff] [blame] | 594 | } |