Merge branch 'newUI' of git.linphone.org:linphone-android into newUI
This commit is contained in:
commit
0626a76f66
20 changed files with 65 additions and 78 deletions
|
@ -19,9 +19,6 @@
|
|||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.READ_LOGS" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<!-- Needed to use bluetooth headset -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH"/>
|
||||
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
|
||||
|
||||
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true"/>
|
||||
|
||||
|
|
BIN
res/drawable-hdpi/setup_mark.png
Normal file
BIN
res/drawable-hdpi/setup_mark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 531 B |
BIN
res/drawable-mdpi/setup_mark.png
Normal file
BIN
res/drawable-mdpi/setup_mark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 371 B |
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true"
|
||||
<item
|
||||
android:state_pressed="true"
|
||||
android:drawable="@color/main_app_color" />
|
||||
<item
|
||||
android:drawable="@color/transparent" />
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
|
||||
<ListView
|
||||
android:id="@+id/chatList"
|
||||
android:listSelector="@drawable/list_selector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:divider="@android:color/darker_gray"
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:background="@drawable/list_selector"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingBottom="10dp"
|
||||
android:background="@drawable/list_selector"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
|
||||
<ListView
|
||||
android:id="@+id/contactsList"
|
||||
android:listSelector="@drawable/list_selector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:divider="@android:color/darker_gray"
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
|
||||
<ExpandableListView
|
||||
android:id="@+id/historyList"
|
||||
android:listSelector="@drawable/list_selector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:divider="@android:color/darker_gray"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/list_selector"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
|
|
|
@ -4,18 +4,45 @@
|
|||
android:background="@drawable/background"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/mark"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:visibility="invisible"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/setup_mark"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_weight="0.5"/>
|
||||
|
||||
<ImageView
|
||||
android:visibility="invisible"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/setup_mark"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_weight="0.5"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/fragmentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="75dp"
|
||||
android:padding="20dp"
|
||||
android:layout_above="@id/mark"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
@ -23,8 +50,9 @@
|
|||
android:contentDescription="@string/content_description_cancel"
|
||||
android:id="@+id/setup_cancel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/setup_cancel"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_weight="0.5"/>
|
||||
|
||||
|
@ -32,8 +60,9 @@
|
|||
android:contentDescription="@string/content_description_next"
|
||||
android:id="@+id/setup_next"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/setup_next"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_weight="0.5"/>
|
||||
|
||||
|
@ -42,8 +71,9 @@
|
|||
android:id="@+id/setup_back"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/setup_back"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_weight="0.5"/>
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
<string name="first_launch_suceeded_once_key">first_launch_suceeded_once_key</string>
|
||||
|
||||
<string name="pref_wifi_only_key">pref_wifi_only_key</string>
|
||||
<string name="pref_use_bluetooth_if_available_key">pref_use_bluetooth_if_available_key</string>
|
||||
|
||||
<string name="pref_video_use_front_camera_key">pref_video_use_front_camera_key</string>
|
||||
<string name="pref_video_codec_h263_key">pref_video_codec_h263_key</string>
|
||||
|
|
|
@ -239,8 +239,6 @@
|
|||
|
||||
<string name="pref_sipaccounts">SIP Accounts</string>
|
||||
<string name="pref_wifi_only">Use wifi only</string>
|
||||
<string name="pref_use_bluetooth_if_available">Use bluetooth headset</string>
|
||||
<string name="pref_use_bluetooth_if_available_summary">Route incoming audio to bluetooth headset if available.</string>
|
||||
|
||||
<string name="wizard_failed">An error occurred, try again later.</string>
|
||||
<string name="wizard_server_unavailable">Server unreachable, verify your internet connection.</string>
|
||||
|
|
|
@ -66,14 +66,6 @@
|
|||
<PreferenceCategory
|
||||
android:title="@string/pref_audio">
|
||||
|
||||
<SwitchPreference
|
||||
android:key="@string/pref_use_bluetooth_if_available_key"
|
||||
android:defaultValue="true"
|
||||
android:switchTextOn="@string/yes"
|
||||
android:switchTextOff="@string/no"
|
||||
android:title="@string/pref_use_bluetooth_if_available"
|
||||
android:summary="@string/pref_use_bluetooth_if_available_summary"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="@string/pref_echo_limiter_key"
|
||||
android:title="@string/pref_echo_limiter"
|
||||
|
|
|
@ -43,10 +43,6 @@
|
|||
|
||||
|
||||
<PreferenceCategory android:title="@string/pref_audio">
|
||||
<CheckBoxPreference android:key="@string/pref_use_bluetooth_if_available_key"
|
||||
android:defaultValue="true"
|
||||
android:title="@string/pref_use_bluetooth_if_available" android:summary="@string/pref_use_bluetooth_if_available_summary"/>
|
||||
|
||||
<CheckBoxPreference android:key="@string/pref_echo_limiter_key"
|
||||
android:title="@string/pref_echo_limiter" android:summary="@string/pref_echo_limiter_summary"/>
|
||||
|
||||
|
@ -149,7 +145,7 @@
|
|||
android:title="@string/pref_escape_plus"></CheckBoxPreference>
|
||||
|
||||
<CheckBoxPreference android:key="@string/pref_debug_key"
|
||||
android:title="@string/pref_debug" android:enabled="true"></CheckBoxPreference>
|
||||
android:title="@string/pref_debug" android:defaultValue="false"></CheckBoxPreference>
|
||||
|
||||
|
||||
<PreferenceScreen android:title="@string/pref_network_title">
|
||||
|
|
|
@ -49,7 +49,6 @@ import java.util.TimerTask;
|
|||
import org.linphone.LinphoneSimpleListener.LinphoneOnAudioChangedListener;
|
||||
import org.linphone.LinphoneSimpleListener.LinphoneOnAudioChangedListener.AudioState;
|
||||
import org.linphone.LinphoneSimpleListener.LinphoneServiceListener;
|
||||
import org.linphone.compatibility.Compatibility;
|
||||
import org.linphone.core.CallDirection;
|
||||
import org.linphone.core.LinphoneAddress;
|
||||
import org.linphone.core.LinphoneAuthInfo;
|
||||
|
@ -196,37 +195,33 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
private BroadcastReceiver mKeepAliveReceiver = new KeepAliveReceiver();
|
||||
|
||||
private native void hackSpeakerState(boolean speakerOn);
|
||||
private static void sRouteAudioToSpeakerOrBluetoothHelper(boolean speakerOn) {
|
||||
getInstance().routeAudioToSpeakerOrBluetoothHelper(speakerOn);
|
||||
private static void sRouteAudioToSpeakerHelperHelper(boolean speakerOn) {
|
||||
getInstance().routeAudioToSpeakerHelperHelper(speakerOn);
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
private void routeAudioToSpeakerOrBluetoothHelper(boolean speakerOn) {
|
||||
private void routeAudioToSpeakerHelperHelper(boolean speakerOn) {
|
||||
boolean different = isSpeakerOn() ^ speakerOn;
|
||||
if (!different) {
|
||||
Log.d("Skipping change audio route by the same route ",
|
||||
speakerOn ? "speaker" : "earpiece");
|
||||
return;
|
||||
}
|
||||
if (mPref.getBoolean(getString(R.string.pref_use_bluetooth_if_available), true) && Compatibility.enableBluetoothHeadset(mAudioManager)) {
|
||||
return;
|
||||
if (Hacks.needGalaxySAudioHack() || sLPref.useGalaxySHack())
|
||||
setAudioModeIncallForGalaxyS();
|
||||
|
||||
if (sLPref.useSpecificAudioModeHack() != -1)
|
||||
mAudioManager.setMode(sLPref.useSpecificAudioModeHack());
|
||||
|
||||
if (Hacks.needRoutingAPI() || sLPref.useAudioRoutingAPIHack()) {
|
||||
mAudioManager.setRouting(
|
||||
MODE_NORMAL,
|
||||
speakerOn? ROUTE_SPEAKER : ROUTE_EARPIECE,
|
||||
AudioManager.ROUTE_ALL);
|
||||
} else {
|
||||
if (Hacks.needGalaxySAudioHack() || sLPref.useGalaxySHack())
|
||||
setAudioModeIncallForGalaxyS();
|
||||
|
||||
if (sLPref.useSpecificAudioModeHack() != -1)
|
||||
mAudioManager.setMode(sLPref.useSpecificAudioModeHack());
|
||||
|
||||
if (Hacks.needRoutingAPI() || sLPref.useAudioRoutingAPIHack()) {
|
||||
mAudioManager.setRouting(
|
||||
MODE_NORMAL,
|
||||
speakerOn? ROUTE_SPEAKER : ROUTE_EARPIECE,
|
||||
AudioManager.ROUTE_ALL);
|
||||
} else {
|
||||
mAudioManager.setSpeakerphoneOn(speakerOn);
|
||||
}
|
||||
for (LinphoneOnAudioChangedListener listener : getSimpleListeners(LinphoneOnAudioChangedListener.class)) {
|
||||
listener.onAudioStateChanged(speakerOn ? AudioState.SPEAKER : AudioState.EARPIECE);
|
||||
}
|
||||
mAudioManager.setSpeakerphoneOn(speakerOn);
|
||||
}
|
||||
for (LinphoneOnAudioChangedListener listener : getSimpleListeners(LinphoneOnAudioChangedListener.class)) {
|
||||
listener.onAudioStateChanged(speakerOn ? AudioState.SPEAKER : AudioState.EARPIECE);
|
||||
}
|
||||
}
|
||||
private synchronized void routeAudioToSpeakerHelper(boolean speakerOn) {
|
||||
|
@ -235,7 +230,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
Log.d("Hack to have speaker=",speakerOn," while on call");
|
||||
hackSpeakerState(speakerOn);
|
||||
} else {
|
||||
routeAudioToSpeakerOrBluetoothHelper(speakerOn);
|
||||
routeAudioToSpeakerHelperHelper(speakerOn);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -642,7 +637,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
|
||||
public void initFromConf() throws LinphoneConfigException {
|
||||
|
||||
|
||||
LinphoneCoreFactory.instance().setDebugMode(getPrefBoolean(R.string.pref_debug_key,true));
|
||||
initFromConfTunnel();
|
||||
|
||||
if (initialTransports == null)
|
||||
|
|
|
@ -28,7 +28,6 @@ import static org.linphone.R.string.pref_echo_cancellation_key;
|
|||
import static org.linphone.R.string.pref_echo_canceller_calibration_key;
|
||||
import static org.linphone.R.string.pref_echo_limiter_key;
|
||||
import static org.linphone.R.string.pref_media_encryption_key;
|
||||
import static org.linphone.R.string.pref_use_bluetooth_if_available_key;
|
||||
import static org.linphone.R.string.pref_video_enable_key;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -260,10 +259,6 @@ public class PreferencesActivity extends LinphonePreferencesActivity implements
|
|||
}
|
||||
findPreference(pref_echo_limiter_key).setEnabled(true);
|
||||
|
||||
if (!Version.sdkAboveOrEqual(8)) {
|
||||
uncheckAndDisableCheckbox(pref_use_bluetooth_if_available_key);
|
||||
}
|
||||
|
||||
initializeMediaEncryptionPreferences();
|
||||
|
||||
detectAudioCodec(pref_codec_amr_key,"AMR", 8000, false);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.linphone.compatibility;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.media.AudioManager;
|
||||
import android.view.Display;
|
||||
|
||||
/*
|
||||
|
@ -31,14 +30,4 @@ public class ApiEightPlus {
|
|||
public static int getRotation(Display display) {
|
||||
return display.getRotation();
|
||||
}
|
||||
|
||||
public static boolean enableBluetoothHeadset(AudioManager mAudioManager) {
|
||||
if (mAudioManager.isBluetoothScoAvailableOffCall()){
|
||||
mAudioManager.setBluetoothScoOn(true);
|
||||
mAudioManager.setMode(AudioManager.MODE_IN_CALL);
|
||||
mAudioManager.startBluetoothSco();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import android.media.AudioManager;
|
|||
import android.net.Uri;
|
||||
import android.preference.Preference;
|
||||
import android.view.Display;
|
||||
import android.view.Window;
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
|
@ -180,15 +181,9 @@ public class Compatibility {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static boolean enableBluetoothHeadset(AudioManager mAudioManager) {
|
||||
if (Version.sdkAboveOrEqual(8)) {
|
||||
return ApiEightPlus.enableBluetoothHeadset(mAudioManager);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void setPreferenceChecked(Preference preference, boolean checked) {
|
||||
if (Version.sdkAboveOrEqual(8)) {
|
||||
if (Version.sdkAboveOrEqual(14)) {
|
||||
ApiFourteenPlus.setPreferenceChecked(preference, checked);
|
||||
} else {
|
||||
ApiFivePlus.setPreferenceChecked(preference, checked);
|
||||
|
@ -196,7 +191,7 @@ public class Compatibility {
|
|||
}
|
||||
|
||||
public static boolean isPreferenceChecked(Preference preference) {
|
||||
if (Version.sdkAboveOrEqual(8)) {
|
||||
if (Version.sdkAboveOrEqual(14)) {
|
||||
return ApiFourteenPlus.isPreferenceChecked(preference);
|
||||
} else {
|
||||
return ApiFivePlus.isPreferenceChecked(preference);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit e1c3d22d293f41702dc1e26aaa366a3e607c10a9
|
||||
Subproject commit dc5b821d22ae39eda6a5c448a3f9e35e8b81f008
|
Loading…
Reference in a new issue