From fef1da4ebd20dcb4f846fb2a0f9770483654eee3 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 13 May 2013 12:17:44 +0200 Subject: [PATCH] Added license to BT manager class + mini fix for audio route icon --- src/org/linphone/BluetoothManager.java | 20 ++++++++++++++++++ src/org/linphone/InCallActivity.java | 28 +++++++++++++------------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/org/linphone/BluetoothManager.java b/src/org/linphone/BluetoothManager.java index 86c5b7070..50fb942a1 100644 --- a/src/org/linphone/BluetoothManager.java +++ b/src/org/linphone/BluetoothManager.java @@ -1,5 +1,22 @@ package org.linphone; +/* +BluetoothManager.java +Copyright (C) 2012 Belledonne Communications, Grenoble, France +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 2 +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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ import org.linphone.mediastream.Log; import android.annotation.TargetApi; @@ -10,6 +27,9 @@ import android.content.Intent; import android.media.AudioManager; import android.os.Build; +/** + * @author Sylvain Berfini + */ @TargetApi(Build.VERSION_CODES.HONEYCOMB) public class BluetoothManager extends BroadcastReceiver { @SuppressWarnings("deprecation") diff --git a/src/org/linphone/InCallActivity.java b/src/org/linphone/InCallActivity.java index 975cd5f50..72b4cfc0f 100644 --- a/src/org/linphone/InCallActivity.java +++ b/src/org/linphone/InCallActivity.java @@ -248,6 +248,20 @@ public class InCallActivity extends FragmentActivity implements slideOutBottomToTop = AnimationUtils.loadAnimation(this, R.anim.slide_out_bottom_to_top); slideOutTopToBottom = AnimationUtils.loadAnimation(this, R.anim.slide_out_top_to_bottom); } + + if (LinphoneManager.getInstance().isBluetoothScoConnected) { + try { + routeLayout.setVisibility(View.VISIBLE); + } catch (NullPointerException npe) {} + audioRoute.setVisibility(View.VISIBLE); + speaker.setVisibility(View.GONE); + } else { + try { + routeLayout.setVisibility(View.GONE); + } catch (NullPointerException npe) {} + audioRoute.setVisibility(View.GONE); + speaker.setVisibility(View.VISIBLE); + } } private void refreshInCallActions() { @@ -267,20 +281,6 @@ public class InCallActivity extends FragmentActivity implements } } - if (LinphoneManager.getInstance().isBluetoothScoConnected) { - try { - routeLayout.setVisibility(View.VISIBLE); - } catch (NullPointerException npe) {} - audioRoute.setVisibility(View.VISIBLE); - speaker.setVisibility(View.GONE); - } else { - try { - routeLayout.setVisibility(View.GONE); - } catch (NullPointerException npe) {} - audioRoute.setVisibility(View.GONE); - speaker.setVisibility(View.VISIBLE); - } - try { if (isSpeakerEnabled) { speaker.setBackgroundResource(R.drawable.speaker_on);