Alexandre Savard | fccd1dc | 2012-10-17 17:31:38 -0400 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (C) 2010-2012 Regis Montoya (aka r3gis - www.r3gis.fr) |
| 3 | * Copyright (C) 2004-2012 Savoir-Faire Linux Inc. |
| 4 | * |
| 5 | * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> |
| 6 | * |
| 7 | * This program is free software: you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation, either version 3 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * If you own a pjsip commercial license you can also redistribute it |
| 12 | * and/or modify it under the terms of the GNU Lesser General Public License |
| 13 | * as an android library. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | */ |
| 23 | package com.savoirfairelinux.sflphone.service; |
| 24 | |
Alexandre Savard | 4f11d7a | 2012-10-18 13:15:36 -0400 | [diff] [blame] | 25 | import android.content.Context; |
| 26 | import android.content.Intent; |
| 27 | import android.support.v4.content.LocalBroadcastManager; |
Alexandre Savard | fccd1dc | 2012-10-17 17:31:38 -0400 | [diff] [blame] | 28 | import android.util.Log; |
| 29 | |
| 30 | public class ConfigurationManagerCallback extends ConfigurationCallback { |
Alexandre Savard | 4f11d7a | 2012-10-18 13:15:36 -0400 | [diff] [blame] | 31 | private static final String TAG = "ConfigurationManagerCallback"; |
| 32 | Context mContext; |
| 33 | |
| 34 | ConfigurationManagerCallback(Context context) { |
| 35 | mContext = context; |
| 36 | } |
Alexandre Savard | fccd1dc | 2012-10-17 17:31:38 -0400 | [diff] [blame] | 37 | |
| 38 | @Override |
| 39 | public void on_account_state_changed() { |
| 40 | Log.i(TAG, "on_account_state_changed ninja!!!!!!!!!!!!!!"); |
Alexandre Savard | 4f11d7a | 2012-10-18 13:15:36 -0400 | [diff] [blame] | 41 | sendAccountsChangedMessage(); |
| 42 | } |
| 43 | |
| 44 | private void sendAccountsChangedMessage() { |
| 45 | Log.d("sender", "Boradcasting message"); |
| 46 | Intent intent = new Intent("accounts-changed"); |
| 47 | intent.putExtra("message", "Accounts Changed"); |
| 48 | LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); |
Alexandre Savard | fccd1dc | 2012-10-17 17:31:38 -0400 | [diff] [blame] | 49 | } |
| 50 | } |