Added license to BT manager class + mini fix for audio route icon

This commit is contained in:
Sylvain Berfini 2013-05-13 12:17:44 +02:00
parent bae4290cc6
commit fef1da4ebd
2 changed files with 34 additions and 14 deletions

View file

@ -1,5 +1,22 @@
package org.linphone; 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 org.linphone.mediastream.Log;
import android.annotation.TargetApi; import android.annotation.TargetApi;
@ -10,6 +27,9 @@ import android.content.Intent;
import android.media.AudioManager; import android.media.AudioManager;
import android.os.Build; import android.os.Build;
/**
* @author Sylvain Berfini
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public class BluetoothManager extends BroadcastReceiver { public class BluetoothManager extends BroadcastReceiver {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")

View file

@ -248,6 +248,20 @@ public class InCallActivity extends FragmentActivity implements
slideOutBottomToTop = AnimationUtils.loadAnimation(this, R.anim.slide_out_bottom_to_top); slideOutBottomToTop = AnimationUtils.loadAnimation(this, R.anim.slide_out_bottom_to_top);
slideOutTopToBottom = AnimationUtils.loadAnimation(this, R.anim.slide_out_top_to_bottom); 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() { 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 { try {
if (isSpeakerEnabled) { if (isSpeakerEnabled) {
speaker.setBackgroundResource(R.drawable.speaker_on); speaker.setBackgroundResource(R.drawable.speaker_on);