Added license to BT manager class + mini fix for audio route icon
This commit is contained in:
parent
bae4290cc6
commit
fef1da4ebd
2 changed files with 34 additions and 14 deletions
|
@ -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")
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue