Enhancements:
- Numpad component factorizing setAddressWidget - Digit uses style - No more NewOutgoingCallReceiver and the associated magic Now uses CALL_PRIVILEDGED - Move Video classes to core.video package and lower visibility - Merged AndroidCameraRecord5Impl and AndroidCameraRecordImpl
This commit is contained in:
parent
d89d9c3a3b
commit
97ba73de8d
30 changed files with 331 additions and 406 deletions
|
@ -67,12 +67,6 @@
|
||||||
<intent-filter><action android:name="android.net.conn.CONNECTIVITY_CHANGE"></action></intent-filter>
|
<intent-filter><action android:name="android.net.conn.CONNECTIVITY_CHANGE"></action></intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name="OutgoingCallReceiver">
|
|
||||||
<intent-filter android:priority="0">
|
|
||||||
<action android:name="android.intent.action.NEW_OUTGOING_CALL"/>
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
<receiver android:name="BootReceiver">
|
<receiver android:name="BootReceiver">
|
||||||
<intent-filter><action android:name="android.intent.action.BOOT_COMPLETED"></action></intent-filter>
|
<intent-filter><action android:name="android.intent.action.BOOT_COMPLETED"></action></intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
@ -84,7 +78,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<activity android:name=".core.tutorials.TestVideoActivity"
|
<activity android:name="core.tutorials.video.TestVideoActivity"
|
||||||
android:label="Video test"
|
android:label="Video test"
|
||||||
android:theme="@android:style/Theme.NoTitleBar"
|
android:theme="@android:style/Theme.NoTitleBar"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
android:orientation="vertical" android:layout_width="fill_parent"
|
android:orientation="vertical" android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/LinearLayout02"
|
|
||||||
android:layout_height="wrap_content" android:layout_width="fill_parent">
|
<LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent">
|
||||||
<LinearLayout android:layout_height="wrap_content"
|
<LinearLayout android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent" android:id="@+id/Addresslayout">
|
android:layout_width="fill_parent" android:id="@+id/Addresslayout">
|
||||||
<org.linphone.ui.AddressText android:id="@+id/SipUri" android:layout_height="wrap_content"
|
<org.linphone.ui.AddressText android:id="@+id/SipUri" android:layout_height="wrap_content"
|
||||||
|
@ -15,11 +15,9 @@
|
||||||
android:text="<"/>
|
android:text="<"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout android:layout_height="wrap_content"
|
<FrameLayout android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent" android:id="@+id/IncallAddressLayout">
|
android:layout_width="fill_parent" android:id="@+id/IncallAddressLayout">
|
||||||
<EditText android:text="@+id/EditText01"
|
<EditText android:layout_height="wrap_content" android:lines="1"
|
||||||
android:layout_height="wrap_content" android:lines="1"
|
|
||||||
android:id="@+id/DisplayNameView" android:clickable="false"
|
android:id="@+id/DisplayNameView" android:clickable="false"
|
||||||
android:cursorVisible="false" android:gravity="center"
|
android:cursorVisible="false" android:gravity="center"
|
||||||
android:layout_width="fill_parent"></EditText>
|
android:layout_width="fill_parent"></EditText>
|
||||||
|
@ -35,30 +33,30 @@
|
||||||
android:layout_gravity="right|center_vertical" />
|
android:layout_gravity="right|center_vertical" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<TableLayout android:layout_width="fill_parent" android:id="@+id/Dialer"
|
|
||||||
android:layout_height="fill_parent" android:layout_weight="1">
|
|
||||||
<TableRow android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/IncallControlRow" >
|
<View android:layout_width="0px" android:visibility="invisible" android:layout_weight="1" android:layout_height="fill_parent" />
|
||||||
<org.linphone.ui.AddVideoButton android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/AddVideo" android:layout_weight="1" android:src="@drawable/startvideo_green" android:background="@drawable/clavier_bg"/>
|
|
||||||
<org.linphone.ui.HangCallButton android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/HangUp" android:layout_weight="1" android:src="@drawable/stopcall_red" android:background="@drawable/clavier_bg"/>
|
|
||||||
</TableRow>
|
|
||||||
</TableLayout>
|
<LinearLayout android:id="@+id/CallControlRow" android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="bottom">
|
||||||
<LinearLayout android:layout_height="fill_parent"
|
|
||||||
android:layout_width="fill_parent" android:id="@+id/CallControlRow" android:layout_weight="1">
|
|
||||||
<org.linphone.ui.CallButton android:id="@+id/Call"
|
<org.linphone.ui.CallButton android:id="@+id/Call"
|
||||||
android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="0.25" android:background="@drawable/clavier_bg" android:src="@drawable/startcall_green"/>
|
android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="0.25" android:background="@drawable/clavier_bg" android:src="@drawable/startcall_green"/>
|
||||||
<org.linphone.ui.HangCallButton android:layout_height="fill_parent" android:layout_width="fill_parent"
|
<org.linphone.ui.HangCallButton android:id="@+id/Decline" android:layout_height="fill_parent" android:layout_width="fill_parent"
|
||||||
android:layout_weight="0.25" android:id="@+id/Decline" android:background="@drawable/clavier_bg" android:src="@drawable/stopcall_red"/>
|
android:layout_weight="0.25" android:background="@drawable/clavier_bg" android:src="@drawable/stopcall_red"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<EditText android:layout_width="fill_parent" android:id="@+id/status_label"
|
|
||||||
|
<LinearLayout android:id="@+id/IncallControlRow" android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="bottom">
|
||||||
|
<org.linphone.ui.AddVideoButton android:id="@+id/AddVideo" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="0.25" android:src="@drawable/startvideo_green" android:background="@drawable/clavier_bg"/>
|
||||||
|
<org.linphone.ui.HangCallButton android:id="@+id/HangUp" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="0.25" android:src="@drawable/stopcall_red" android:background="@drawable/clavier_bg"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<EditText android:id="@+id/status_label" android:layout_width="fill_parent"
|
||||||
android:clickable="false" android:focusable="false"
|
android:clickable="false" android:focusable="false"
|
||||||
android:cursorVisible="false" android:textSize="12sp" android:height="15sp"
|
android:cursorVisible="false" android:textSize="12sp" android:height="15sp"
|
||||||
android:background="@android:color/transparent" android:textColor="@android:color/white"
|
android:background="@android:color/transparent" android:textColor="@android:color/white"
|
||||||
android:lines="1" android:layout_height="wrap_content"></EditText>
|
android:lines="1" android:layout_height="wrap_content"></EditText>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
android:orientation="vertical" android:layout_width="fill_parent"
|
android:orientation="vertical" android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/LinearLayout02"
|
<LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent">
|
||||||
android:layout_height="wrap_content" android:layout_width="fill_parent">
|
|
||||||
<LinearLayout android:layout_height="wrap_content"
|
<LinearLayout android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent" android:id="@+id/Addresslayout">
|
android:layout_width="fill_parent" android:id="@+id/Addresslayout">
|
||||||
<org.linphone.ui.AddressText android:id="@+id/SipUri" android:background="@drawable/clavier_bg_grey" android:hint="sip:" android:layout_width="fill_parent"
|
<org.linphone.ui.AddressText android:id="@+id/SipUri" android:background="@drawable/clavier_bg_grey" android:hint="sip:" android:layout_width="fill_parent"
|
||||||
|
@ -33,52 +32,23 @@
|
||||||
android:layout_height="wrap_content" android:layout_width="wrap_content"
|
android:layout_height="wrap_content" android:layout_width="wrap_content"
|
||||||
checked="@drawable/speaker_32_on" unchecked="@drawable/speaker_32_off"
|
checked="@drawable/speaker_32_on" unchecked="@drawable/speaker_32_off"
|
||||||
android:layout_gravity="right|center_vertical"/>
|
android:layout_gravity="right|center_vertical"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TableLayout android:layout_width="fill_parent" android:id="@+id/Dialer"
|
<org.linphone.ui.Numpad android:id="@+id/Dialer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="4" />
|
||||||
android:layout_height="fill_parent" android:layout_weight="1">
|
|
||||||
<TableRow android:layout_height="fill_parent"
|
|
||||||
android:layout_weight="1" android:id="@+id/DialerRow01"
|
|
||||||
android:layout_width="fill_parent">
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit1" android:text="1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit2" android:text="2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit3" android:text="3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TableRow android:layout_height="fill_parent"
|
<LinearLayout android:layout_height="wrap_content" android:orientation="vertical" android:layout_width="fill_parent">
|
||||||
android:layout_weight="1" android:id="@+id/DialerRow02"
|
<LinearLayout android:id="@+id/CallControlRow" android:layout_height="fill_parent" android:layout_width="fill_parent">
|
||||||
android:layout_width="fill_parent">
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit4" android:text="4" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit5" android:text="5" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit6" android:text="6" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TableRow android:layout_weight="1" android:layout_height="fill_parent"
|
|
||||||
android:id="@+id/DialerRow03" android:layout_width="fill_parent">
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit7" android:text="7" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit8" android:text="8" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit9" android:text="9" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TableRow android:layout_weight="1" android:layout_height="fill_parent"
|
|
||||||
android:id="@+id/DialerRow04" android:layout_width="fill_parent">
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/DigitStar" android:text="*" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/Digit00" android:text="0+" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
<org.linphone.ui.Digit android:id="@+id/DigitHash" android:text="#" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/IncallControlRow">
|
|
||||||
<org.linphone.ui.AddVideoButton android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/AddVideo" android:layout_weight="1" android:src="@drawable/startvideo_green" android:background="@drawable/clavier_bg"/>
|
|
||||||
<org.linphone.ui.HangCallButton android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/HangUp" android:layout_weight="1" android:src="@drawable/stopcall_red" android:background="@drawable/clavier_bg"/>
|
|
||||||
</TableRow>
|
|
||||||
</TableLayout>
|
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/LinearLayout01" android:layout_height="wrap_content" android:orientation="vertical" android:layout_width="fill_parent">
|
|
||||||
<LinearLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/CallControlRow">
|
|
||||||
<org.linphone.ui.CallButton android:id="@+id/Call" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="0.25" android:src="@drawable/startcall_green" android:background="@drawable/clavier_bg"/>
|
<org.linphone.ui.CallButton android:id="@+id/Call" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="0.25" android:src="@drawable/startcall_green" android:background="@drawable/clavier_bg"/>
|
||||||
<org.linphone.ui.HangCallButton android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="0.25" android:id="@+id/Decline" android:src="@drawable/stopcall_red" android:background="@drawable/clavier_bg"/>
|
<org.linphone.ui.HangCallButton android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="0.25" android:id="@+id/Decline" android:src="@drawable/stopcall_red" android:background="@drawable/clavier_bg"/>
|
||||||
</LinearLayout><EditText android:layout_width="fill_parent" android:id="@+id/status_label" android:clickable="false" android:focusable="false" android:cursorVisible="false" android:textSize="12sp" android:height="15sp" android:layout_height="wrap_content" android:background="@android:color/transparent" android:textColor="@android:color/white"></EditText>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout android:id="@+id/IncallControlRow" android:layout_height="fill_parent" android:layout_width="fill_parent">
|
||||||
|
<org.linphone.ui.AddVideoButton android:id="@+id/AddVideo" android:src="@drawable/startvideo_green" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="0.25" android:background="@drawable/clavier_bg"/>
|
||||||
|
<org.linphone.ui.HangCallButton android:id="@+id/HangUp" android:src="@drawable/stopcall_red" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="0.25" android:background="@drawable/clavier_bg"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<EditText android:id="@+id/status_label" android:clickable="false" android:focusable="false" android:cursorVisible="false" android:textSize="12sp" android:height="15sp" android:layout_height="wrap_content" android:layout_width="fill_parent" android:background="@android:color/transparent" android:textColor="@android:color/white" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
31
res/layout/numpad.xml
Normal file
31
res/layout/numpad.xml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="fill_parent" android:layout_height="fill_parent">
|
||||||
|
|
||||||
|
<TableRow android:layout_height="fill_parent" android:layout_weight="1" android:layout_width="fill_parent">
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/Digit1" android:text="1" style="@style/DialerDigit" />
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/Digit2" android:text="2" style="@style/DialerDigit" />
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/Digit3" android:text="3" style="@style/DialerDigit" />
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:layout_height="fill_parent" android:layout_weight="1" android:layout_width="fill_parent">
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/Digit4" android:text="4" style="@style/DialerDigit" />
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/Digit5" android:text="5" style="@style/DialerDigit" />
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/Digit6" android:text="6" style="@style/DialerDigit" />
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent">
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/Digit7" android:text="7" style="@style/DialerDigit" />
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/Digit8" android:text="8" style="@style/DialerDigit" />
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/Digit9" android:text="9" style="@style/DialerDigit" />
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent">
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/DigitStar" android:text="*" style="@style/DialerDigit" />
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/Digit00" android:text="0+" style="@style/DialerDigit" />
|
||||||
|
<org.linphone.ui.Digit android:id="@+id/DigitHash" android:text="#" style="@style/DialerDigit" />
|
||||||
|
</TableRow>
|
||||||
|
</TableLayout>
|
||||||
|
<!-- android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@android:color/black" android:background="@drawable/clavier_bg" android:textStyle="bold" android:textSize="20sp" android:layout_weight="1" -->
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:padding="6dip" android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/outcall_chooser_linear_v" android:layout_width="fill_parent"
|
|
||||||
android:gravity="center">
|
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/LinearLayout02"
|
|
||||||
android:layout_height="wrap_content" android:layout_width="fill_parent"
|
|
||||||
android:layout_weight="0.5" android:gravity="center">
|
|
||||||
<ImageButton android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" android:src="@drawable/logo_linphone_57x57"
|
|
||||||
android:id="@+id/outcall_chooser_linphone_button" android:background="@android:color/transparent"></ImageButton>
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout android:id="@+id/LinearLayout01"
|
|
||||||
android:layout_width="fill_parent" android:layout_weight=".5"
|
|
||||||
android:gravity="center" android:layout_height="fill_parent">
|
|
||||||
<Button android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" android:text="@string/outcall_chooser_cellular"
|
|
||||||
android:layout_below="@+id/outcall_text" android:layout_alignRight="@+id/outcall_text"
|
|
||||||
android:id="@+id/outcall_chooser_cellular_button"></Button>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<string-array name="pref_handle_outcall_keys">
|
|
||||||
<item>off</item>
|
|
||||||
<item>ask_for_outcall_interception</item>
|
|
||||||
<item>alway_intercept_out_call</item>
|
|
||||||
</string-array>
|
|
||||||
</resources>
|
|
|
@ -37,9 +37,6 @@
|
||||||
<string name="pref_ilbc_summary">iLBC might be unavailable depending on ARM processor and Android OS version.</string>
|
<string name="pref_ilbc_summary">iLBC might be unavailable depending on ARM processor and Android OS version.</string>
|
||||||
<string name="pref_echo_cancellation">Echo cancellation</string>
|
<string name="pref_echo_cancellation">Echo cancellation</string>
|
||||||
<string name="pref_echo_cancellation_key">pref_echo_cancellation_key</string>
|
<string name="pref_echo_cancellation_key">pref_echo_cancellation_key</string>
|
||||||
<string name="pref_handle_outcall_summarry">Configure how cellular calls are redirected to voip when possible</string>
|
|
||||||
<string name="pref_handle_outcall">Redirect cellular calls</string>
|
|
||||||
<string name="pref_handle_outcall_key">pref_handle_outcall_key_v2</string>
|
|
||||||
<string name="pref_autostart">Start at boot time</string>
|
<string name="pref_autostart">Start at boot time</string>
|
||||||
<string name="pref_autostart_key">pref_autostart_key</string>
|
<string name="pref_autostart_key">pref_autostart_key</string>
|
||||||
<string name="outcall_chooser_cellular">Cellular</string>
|
<string name="outcall_chooser_cellular">Cellular</string>
|
||||||
|
@ -109,10 +106,4 @@
|
||||||
<string name="ec_calibrating">Calibrating...</string>
|
<string name="ec_calibrating">Calibrating...</string>
|
||||||
<string name="ec_calibrated">Calibrated [%s ms]</string>
|
<string name="ec_calibrated">Calibrated [%s ms]</string>
|
||||||
<string name="failed">failed</string>
|
<string name="failed">failed</string>
|
||||||
|
|
||||||
<string-array name="pref_handle_outcall_values">
|
|
||||||
<item>Off</item>
|
|
||||||
<item>On demand</item>
|
|
||||||
<item>Always</item>
|
|
||||||
</string-array>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
|
|
||||||
<EditTextPreference android:title="@string/pref_stun_server"
|
<EditTextPreference android:title="@string/pref_stun_server"
|
||||||
android:key="@string/pref_stun_server_key"></EditTextPreference>
|
android:key="@string/pref_stun_server_key"></EditTextPreference>
|
||||||
<ListPreference android:key="@string/pref_handle_outcall_key" android:title="@string/pref_handle_outcall" android:summary="@string/pref_handle_outcall_summarry" android:entryValues="@array/pref_handle_outcall_keys" android:entries="@array/pref_handle_outcall_values" android:defaultValue="ask_for_outcall_interception"></ListPreference>
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone;
|
package org.linphone;
|
||||||
|
|
||||||
import org.linphone.core.AndroidCameraRecordManager;
|
|
||||||
import org.linphone.core.LinphoneCallParams;
|
import org.linphone.core.LinphoneCallParams;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.VideoSize;
|
import org.linphone.core.VideoSize;
|
||||||
|
import org.linphone.core.video.AndroidCameraRecordManager;
|
||||||
|
|
||||||
public class BandwidthManager {
|
public class BandwidthManager {
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone;
|
package org.linphone;
|
||||||
|
|
||||||
import org.linphone.core.AndroidCameraRecordManager;
|
|
||||||
import org.linphone.core.LinphoneAddress;
|
import org.linphone.core.LinphoneAddress;
|
||||||
import org.linphone.core.LinphoneCall;
|
import org.linphone.core.LinphoneCall;
|
||||||
import org.linphone.core.LinphoneCallParams;
|
import org.linphone.core.LinphoneCallParams;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.LinphoneCoreException;
|
import org.linphone.core.LinphoneCoreException;
|
||||||
|
import org.linphone.core.video.AndroidCameraRecordManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle call updating, reinvites.
|
* Handle call updating, reinvites.
|
||||||
|
|
|
@ -20,14 +20,14 @@ package org.linphone;
|
||||||
|
|
||||||
import org.linphone.LinphoneManager.NewOutgoingCallUiListener;
|
import org.linphone.LinphoneManager.NewOutgoingCallUiListener;
|
||||||
import org.linphone.LinphoneService.LinphoneGuiListener;
|
import org.linphone.LinphoneService.LinphoneGuiListener;
|
||||||
import org.linphone.core.AndroidCameraRecordManager;
|
|
||||||
import org.linphone.core.LinphoneCall;
|
import org.linphone.core.LinphoneCall;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.LinphoneCall.State;
|
import org.linphone.core.LinphoneCall.State;
|
||||||
|
import org.linphone.core.video.AndroidCameraRecordManager;
|
||||||
import org.linphone.ui.AddVideoButton;
|
import org.linphone.ui.AddVideoButton;
|
||||||
|
import org.linphone.ui.AddressAwareWidget;
|
||||||
import org.linphone.ui.AddressText;
|
import org.linphone.ui.AddressText;
|
||||||
import org.linphone.ui.CallButton;
|
import org.linphone.ui.CallButton;
|
||||||
import org.linphone.ui.Digit;
|
|
||||||
import org.linphone.ui.EraseButton;
|
import org.linphone.ui.EraseButton;
|
||||||
import org.linphone.ui.MuteMicButton;
|
import org.linphone.ui.MuteMicButton;
|
||||||
import org.linphone.ui.SpeakerButton;
|
import org.linphone.ui.SpeakerButton;
|
||||||
|
@ -46,8 +46,6 @@ import android.preference.PreferenceManager;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TableRow;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -76,8 +74,8 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
private MuteMicButton mMute;
|
private MuteMicButton mMute;
|
||||||
private SpeakerButton mSpeaker;
|
private SpeakerButton mSpeaker;
|
||||||
|
|
||||||
private LinearLayout mCallControlRow;
|
private View mCallControlRow;
|
||||||
private TableRow mInCallControlRow;
|
private View mInCallControlRow;
|
||||||
private View mAddressLayout;
|
private View mAddressLayout;
|
||||||
private View mInCallAddressLayout;
|
private View mInCallAddressLayout;
|
||||||
|
|
||||||
|
@ -138,12 +136,12 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
mHangup = findViewById(R.id.HangUp);
|
mHangup = findViewById(R.id.HangUp);
|
||||||
|
|
||||||
|
|
||||||
mCallControlRow = (LinearLayout) findViewById(R.id.CallControlRow);
|
mCallControlRow = findViewById(R.id.CallControlRow);
|
||||||
mAddressLayout = (View) findViewById(R.id.Addresslayout);
|
mAddressLayout = findViewById(R.id.Addresslayout);
|
||||||
|
|
||||||
mInCallControlRow = (TableRow) findViewById(R.id.IncallControlRow);
|
mInCallControlRow = findViewById(R.id.IncallControlRow);
|
||||||
mInCallControlRow.setVisibility(View.GONE);
|
mInCallControlRow.setVisibility(View.GONE);
|
||||||
mInCallAddressLayout = (View) findViewById(R.id.IncallAddressLayout);
|
mInCallAddressLayout = findViewById(R.id.IncallAddressLayout);
|
||||||
mInCallAddressLayout.setVisibility(View.GONE);
|
mInCallAddressLayout.setVisibility(View.GONE);
|
||||||
mMute = (MuteMicButton) findViewById(R.id.mic_mute_button);
|
mMute = (MuteMicButton) findViewById(R.id.mic_mute_button);
|
||||||
mSpeaker = (SpeakerButton) findViewById(R.id.speaker_button);
|
mSpeaker = (SpeakerButton) findViewById(R.id.speaker_button);
|
||||||
|
@ -181,21 +179,10 @@ public class DialerActivity extends Activity implements LinphoneGuiListener, Alr
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddressAwareWidget numpad = (AddressAwareWidget) findViewById(R.id.Dialer);
|
||||||
|
if (numpad != null)
|
||||||
|
numpad.setAddressWidget(mAddress);
|
||||||
|
|
||||||
if (findViewById(R.id.Digit00) != null) { // In landscape view, no keyboard
|
|
||||||
((Digit) findViewById(R.id.Digit00)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.Digit1)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.Digit2)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.Digit3)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.Digit4)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.Digit5)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.Digit6)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.Digit7)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.Digit8)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.Digit9)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.DigitStar)).setAddressWidget(mAddress);
|
|
||||||
((Digit) findViewById(R.id.DigitHash)).setAddressWidget(mAddress);
|
|
||||||
}
|
|
||||||
mStatus = (TextView) findViewById(R.id.status_label);
|
mStatus = (TextView) findViewById(R.id.status_label);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ import java.io.InputStream;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
import org.linphone.core.AndroidCameraRecordManager;
|
|
||||||
import org.linphone.core.LinphoneAddress;
|
import org.linphone.core.LinphoneAddress;
|
||||||
import org.linphone.core.LinphoneAuthInfo;
|
import org.linphone.core.LinphoneAuthInfo;
|
||||||
import org.linphone.core.LinphoneCall;
|
import org.linphone.core.LinphoneCall;
|
||||||
|
@ -42,16 +41,16 @@ import org.linphone.core.LinphoneCore.EcCalibratorStatus;
|
||||||
import org.linphone.core.LinphoneCore.FirewallPolicy;
|
import org.linphone.core.LinphoneCore.FirewallPolicy;
|
||||||
import org.linphone.core.LinphoneCore.GlobalState;
|
import org.linphone.core.LinphoneCore.GlobalState;
|
||||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||||
|
import org.linphone.core.video.AndroidCameraRecordManager;
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ComponentName;
|
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.hardware.Camera;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
|
@ -83,7 +82,6 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
|
|
||||||
private static LinphoneManager instance;
|
private static LinphoneManager instance;
|
||||||
private AudioManager mAudioManager;
|
private AudioManager mAudioManager;
|
||||||
private NewOutgoingCallUiListener newOutgoingCallUiListener;
|
|
||||||
private SharedPreferences mPref;
|
private SharedPreferences mPref;
|
||||||
private Resources mR;
|
private Resources mR;
|
||||||
private LinphoneCore mLc;
|
private LinphoneCore mLc;
|
||||||
|
@ -95,7 +93,6 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
mAudioManager = ((AudioManager) c.getSystemService(Context.AUDIO_SERVICE));
|
mAudioManager = ((AudioManager) c.getSystemService(Context.AUDIO_SERVICE));
|
||||||
mVibrator = (Vibrator) c.getSystemService(Context.VIBRATOR_SERVICE);
|
mVibrator = (Vibrator) c.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
mPref = PreferenceManager.getDefaultSharedPreferences(c);
|
mPref = PreferenceManager.getDefaultSharedPreferences(c);
|
||||||
mPackageManager = c.getPackageManager();
|
|
||||||
mR = c.getResources();
|
mR = c.getResources();
|
||||||
|
|
||||||
// Register a sensor to track phoneOrientation for placing new calls.
|
// Register a sensor to track phoneOrientation for placing new calls.
|
||||||
|
@ -111,6 +108,20 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
mPhoneOrientation = o;
|
mPhoneOrientation = o;
|
||||||
}
|
}
|
||||||
}.enable();
|
}.enable();
|
||||||
|
|
||||||
|
detectIfHasCamera();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void detectIfHasCamera() {
|
||||||
|
Log.i(TAG, "Detecting if a camera is present");
|
||||||
|
try {
|
||||||
|
Camera camera = Camera.open();
|
||||||
|
if (hasCamera = camera != null) {
|
||||||
|
camera.release();
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {}
|
||||||
|
Log.i(TAG, (hasCamera ? "A" : "No") + " camera is present");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String TAG="Linphone";
|
public static final String TAG="Linphone";
|
||||||
|
@ -123,7 +134,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
private Timer mTimer = new Timer("Linphone scheduler");
|
private Timer mTimer = new Timer("Linphone scheduler");
|
||||||
|
|
||||||
private BroadcastReceiver mKeepAliveReceiver = new KeepAliveReceiver();
|
private BroadcastReceiver mKeepAliveReceiver = new KeepAliveReceiver();
|
||||||
private PackageManager mPackageManager;
|
private boolean hasCamera;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -157,12 +168,14 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized static final LinphoneManager createAndStart(Context c, LinphoneServiceListener listener) {
|
public synchronized static final LinphoneManager createAndStart(
|
||||||
|
Context c, LinphoneServiceListener listener) {
|
||||||
if (instance != null)
|
if (instance != null)
|
||||||
throw new RuntimeException("Linphone Manager is already initialized");
|
throw new RuntimeException("Linphone Manager is already initialized");
|
||||||
|
|
||||||
instance = new LinphoneManager(c);
|
instance = new LinphoneManager(c);
|
||||||
instance.startLibLinphone(c, listener);
|
instance.serviceListener = listener;
|
||||||
|
instance.startLibLinphone(c);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,20 +199,16 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
|
|
||||||
public void newOutgoingCall(AddressType address) {
|
public void newOutgoingCall(AddressType address) {
|
||||||
String to = address.getText().toString();
|
String to = address.getText().toString();
|
||||||
if (to.contains(OutgoingCallReceiver.TAG)) {
|
|
||||||
to = to.replace(OutgoingCallReceiver.TAG, "");
|
|
||||||
address.setText(to);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mLc.isIncall()) {
|
if (mLc.isIncall()) {
|
||||||
newOutgoingCallUiListener.onAlreadyInCall();
|
serviceListener.tryingNewOutgoingCallButAlreadyInCall();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LinphoneAddress lAddress;
|
LinphoneAddress lAddress;
|
||||||
try {
|
try {
|
||||||
lAddress = mLc.interpretUrl(to);
|
lAddress = mLc.interpretUrl(to);
|
||||||
} catch (LinphoneCoreException e) {
|
} catch (LinphoneCoreException e) {
|
||||||
newOutgoingCallUiListener.onWrongDestinationAddress();
|
serviceListener.tryingNewOutgoingCallButWrongDestinationAddress();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lAddress.setDisplayName(address.getDisplayedName());
|
lAddress.setDisplayName(address.getDisplayedName());
|
||||||
|
@ -211,7 +220,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
CallManager.getInstance().inviteAddress(lAddress, prefVideoEnable && prefInitiateWithVideo);
|
CallManager.getInstance().inviteAddress(lAddress, prefVideoEnable && prefInitiateWithVideo);
|
||||||
|
|
||||||
} catch (LinphoneCoreException e) {
|
} catch (LinphoneCoreException e) {
|
||||||
newOutgoingCallUiListener.onCannotGetCallParameters();
|
serviceListener.tryingNewOutgoingCallButCannotGetCallParameters();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,10 +232,6 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
AndroidCameraRecordManager.getInstance().setPhoneOrientation(mPhoneOrientation);
|
AndroidCameraRecordManager.getInstance().setPhoneOrientation(mPhoneOrientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNewOutgoingCallUiListener(NewOutgoingCallUiListener l) {
|
|
||||||
this.newOutgoingCallUiListener = l;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static interface AddressType {
|
public static interface AddressType {
|
||||||
void setText(CharSequence s);
|
void setText(CharSequence s);
|
||||||
CharSequence getText();
|
CharSequence getText();
|
||||||
|
@ -288,9 +293,8 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
sendStaticImage(rm.toggleMute());
|
sendStaticImage(rm.toggleMute());
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void startLibLinphone(final Context context, final LinphoneServiceListener listener) {
|
private synchronized void startLibLinphone(final Context context) {
|
||||||
try {
|
try {
|
||||||
this.serviceListener = listener;
|
|
||||||
copyAssetsFromPackage(context);
|
copyAssetsFromPackage(context);
|
||||||
|
|
||||||
mLc = LinphoneCoreFactory.instance().createLinphoneCore(
|
mLc = LinphoneCoreFactory.instance().createLinphoneCore(
|
||||||
|
@ -370,28 +374,6 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String sOutcalls = mPref.getString(getString(R.string.pref_handle_outcall_key), OutgoingCallReceiver.key_on_demand);
|
|
||||||
boolean handleOutcalls = !sOutcalls.equalsIgnoreCase(OutgoingCallReceiver.key_off);
|
|
||||||
|
|
||||||
/* Now useless, see enablePkgComponent
|
|
||||||
* if (handleOutcalls){
|
|
||||||
IntentFilter lFilter = new IntentFilter(Intent.ACTION_SCREEN_ON);
|
|
||||||
lFilter.setPriority(0);
|
|
||||||
lFilter.addAction(Intent.ACTION_NEW_OUTGOING_CALL);
|
|
||||||
if (mOutgoingCallReceiver == null) {
|
|
||||||
mOutgoingCallReceiver = new OutgoingCallReceiver();
|
|
||||||
}
|
|
||||||
context.registerReceiver(mOutgoingCallReceiver,lFilter);
|
|
||||||
} else if (mOutgoingCallReceiver!=null) {
|
|
||||||
context.unregisterReceiver(mOutgoingCallReceiver);
|
|
||||||
mOutgoingCallReceiver=null;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Enable/disable outgoing call receiver according to user wishes
|
|
||||||
// Could be done already once when the preference is changed in UI.
|
|
||||||
enablePkgComponent(context, OutgoingCallReceiver.class, handleOutcalls);
|
|
||||||
|
|
||||||
|
|
||||||
mLc.enableEchoCancellation(mPref.getBoolean(getString(R.string.pref_echo_cancellation_key),false));
|
mLc.enableEchoCancellation(mPref.getBoolean(getString(R.string.pref_echo_cancellation_key),false));
|
||||||
} catch (LinphoneCoreException e) {
|
} catch (LinphoneCoreException e) {
|
||||||
throw new LinphoneConfigException(getString(R.string.wrong_settings),e);
|
throw new LinphoneConfigException(getString(R.string.wrong_settings),e);
|
||||||
|
@ -480,14 +462,6 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void enablePkgComponent(Context context, Class<?> clazz, boolean state) {
|
|
||||||
mPackageManager.setComponentEnabledSetting(
|
|
||||||
new ComponentName(context, clazz),
|
|
||||||
state ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
|
||||||
: PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void enableDisableAudioCodec(String codec, int rate, int key) throws LinphoneCoreException {
|
private void enableDisableAudioCodec(String codec, int rate, int key) throws LinphoneCoreException {
|
||||||
PayloadType pt = mLc.findPayloadType(codec, rate);
|
PayloadType pt = mLc.findPayloadType(codec, rate);
|
||||||
if (pt !=null) {
|
if (pt !=null) {
|
||||||
|
@ -517,7 +491,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasCamera() {
|
public boolean hasCamera() {
|
||||||
return mPackageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA);
|
return hasCamera;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized void destroy(Context context) {
|
public static synchronized void destroy(Context context) {
|
||||||
|
@ -555,6 +529,9 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
|
|
||||||
public interface LinphoneServiceListener {
|
public interface LinphoneServiceListener {
|
||||||
void onGlobalStateChanged(GlobalState state, String message);
|
void onGlobalStateChanged(GlobalState state, String message);
|
||||||
|
void tryingNewOutgoingCallButCannotGetCallParameters();
|
||||||
|
void tryingNewOutgoingCallButWrongDestinationAddress();
|
||||||
|
void tryingNewOutgoingCallButAlreadyInCall();
|
||||||
void onRegistrationStateChanged(RegistrationState state, String message);
|
void onRegistrationStateChanged(RegistrationState state, String message);
|
||||||
void onCallStateChanged(LinphoneCall call, State state, String message);
|
void onCallStateChanged(LinphoneCall call, State state, String message);
|
||||||
void onEcCalibrationStatus(EcCalibratorStatus status, Object data,
|
void onEcCalibrationStatus(EcCalibratorStatus status, Object data,
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.linphone;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.linphone.LinphoneManager.LinphoneServiceListener;
|
import org.linphone.LinphoneManager.LinphoneServiceListener;
|
||||||
|
import org.linphone.LinphoneManager.NewOutgoingCallUiListener;
|
||||||
import org.linphone.core.LinphoneCall;
|
import org.linphone.core.LinphoneCall;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.LinphoneCall.State;
|
import org.linphone.core.LinphoneCall.State;
|
||||||
|
@ -234,7 +235,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface LinphoneGuiListener {
|
public interface LinphoneGuiListener extends NewOutgoingCallUiListener {
|
||||||
void onDisplayStatus(String message);
|
void onDisplayStatus(String message);
|
||||||
void onGlobalStateChangedToOn(String message);
|
void onGlobalStateChangedToOn(String message);
|
||||||
// void onRegistrationStateChanged(RegistrationState state, String message);
|
// void onRegistrationStateChanged(RegistrationState state, String message);
|
||||||
|
@ -250,5 +251,32 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
||||||
Log.e(LinphoneManager.TAG, "cannot set ringtone", e);
|
Log.e(LinphoneManager.TAG, "cannot set ringtone", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void tryingNewOutgoingCallButAlreadyInCall() {
|
||||||
|
mHandler.post(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
if (guiListener() != null)
|
||||||
|
guiListener().onAlreadyInCall();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void tryingNewOutgoingCallButCannotGetCallParameters() {
|
||||||
|
mHandler.post(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
if (guiListener() != null)
|
||||||
|
guiListener().onCannotGetCallParameters();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void tryingNewOutgoingCallButWrongDestinationAddress() {
|
||||||
|
mHandler.post(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
if (guiListener() != null)
|
||||||
|
guiListener().onWrongDestinationAddress();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
/*
|
|
||||||
OutgoingCallReceiver.java
|
|
||||||
Copyright (C) 2010 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.
|
|
||||||
*/
|
|
||||||
package org.linphone;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Intercept outgoing calls dialed through Android dialer.
|
|
||||||
* Redirect the calls through Linphone according to user preferences.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class OutgoingCallReceiver extends BroadcastReceiver {
|
|
||||||
public static final String TAG = ";0000000";
|
|
||||||
public static final String key_off="off";
|
|
||||||
public static final String key_on_demand="ask_for_outcall_interception";
|
|
||||||
public static final String key_always="alway_intercept_out_call";
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceive(Context context, Intent intent) {
|
|
||||||
String to = intent.getStringExtra("android.intent.extra.PHONE_NUMBER");
|
|
||||||
|
|
||||||
//do not catch ussd codes
|
|
||||||
if (to==null || to.contains("#"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!to.contains(TAG)) {
|
|
||||||
if (LinphoneService.isReady() && LinphoneManager.getLc().getDefaultProxyConfig()==null) {
|
|
||||||
//just return
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setResult(Activity.RESULT_OK,null, null);
|
|
||||||
Intent lIntent = new Intent();
|
|
||||||
// 1 check config
|
|
||||||
if (PreferenceManager.getDefaultSharedPreferences(context).getString(context.getString(R.string.pref_handle_outcall_key),key_on_demand).equals(key_always)) {
|
|
||||||
//start linphone directly
|
|
||||||
lIntent.setClass(context, LinphoneActivity.class);
|
|
||||||
} else {
|
|
||||||
//start activity chooser
|
|
||||||
lIntent.setAction(Intent.ACTION_CALL);
|
|
||||||
}
|
|
||||||
|
|
||||||
lIntent.setData(Uri.parse("tel:"+to+TAG));
|
|
||||||
lIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
context.startActivity(lIntent);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
setResult(Activity.RESULT_OK,to.replace(TAG, ""),null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -20,10 +20,10 @@ package org.linphone;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import org.linphone.core.AndroidCameraRecordManager;
|
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.Version;
|
import org.linphone.core.Version;
|
||||||
import org.linphone.core.VideoSize;
|
import org.linphone.core.VideoSize;
|
||||||
|
import org.linphone.core.video.AndroidCameraRecordManager;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -38,6 +38,11 @@ import android.view.MenuItem;
|
||||||
import android.view.SurfaceView;
|
import android.view.SurfaceView;
|
||||||
import android.view.ViewGroup.LayoutParams;
|
import android.view.ViewGroup.LayoutParams;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For Android SDK >=
|
||||||
|
* @author Guillaume Beraudo
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class VideoCallActivity extends Activity {
|
public class VideoCallActivity extends Activity {
|
||||||
private SurfaceView mVideoView;
|
private SurfaceView mVideoView;
|
||||||
private SurfaceView mVideoCaptureView;
|
private SurfaceView mVideoCaptureView;
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
/*
|
|
||||||
AndroidCameraRecordImplAPI5.java
|
|
||||||
Copyright (C) 2010 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.
|
|
||||||
*/
|
|
||||||
package org.linphone.core;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import android.hardware.Camera;
|
|
||||||
import android.hardware.Camera.Parameters;
|
|
||||||
import android.hardware.Camera.Size;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
|
|
||||||
public class AndroidCameraRecord5Impl extends AndroidCameraRecordImpl {
|
|
||||||
|
|
||||||
public AndroidCameraRecord5Impl(RecorderParams parameters) {
|
|
||||||
super(parameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onSettingCameraParameters(Parameters parameters) {
|
|
||||||
super.onSettingCameraParameters(parameters);
|
|
||||||
|
|
||||||
if (parameters.getSupportedFocusModes().contains(Camera.Parameters.FOCUS_MODE_AUTO)) {
|
|
||||||
Log.w(tag, "Auto Focus supported by camera device");
|
|
||||||
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
|
|
||||||
} else {
|
|
||||||
Log.w(tag, "Auto Focus not supported by camera device");
|
|
||||||
if (parameters.getSupportedFocusModes().contains(Camera.Parameters.FOCUS_MODE_INFINITY)) {
|
|
||||||
Log.w(tag, "Infinity Focus supported by camera device");
|
|
||||||
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_INFINITY);
|
|
||||||
} else {
|
|
||||||
Log.w(tag, "Infinity Focus not supported by camera device");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Size> oneShotSupportedVideoSizes() {
|
|
||||||
Camera camera = Camera.open();
|
|
||||||
List<Size> supportedVideoSizes =camera.getParameters().getSupportedPreviewSizes();
|
|
||||||
camera.release();
|
|
||||||
return supportedVideoSizes;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected List<Size> getSupportedPreviewSizes(Parameters parameters) {
|
|
||||||
return parameters.getSupportedPreviewSizes();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -38,4 +38,8 @@ public class Version {
|
||||||
return buildVersion < value;
|
return buildVersion < value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int sdk() {
|
||||||
|
return buildVersion;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -23,11 +23,12 @@ import android.widget.TextView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write notifications to a TextView widget.
|
* Write notifications to a TextView widget.
|
||||||
|
* This is an helper class, not a test activity.
|
||||||
*
|
*
|
||||||
* @author Guillaume Beraudo
|
* @author Guillaume Beraudo
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class AndroidTutorialNotifier extends TutorialNotifier {
|
class AndroidTutorialNotifier extends TutorialNotifier {
|
||||||
|
|
||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
private TextView outputTextView;
|
private TextView outputTextView;
|
||||||
|
|
|
@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.core.tutorials;
|
package org.linphone.core.tutorials;
|
||||||
|
|
||||||
import org.linphone.core.AndroidCameraRecord;
|
import org.linphone.core.video.AndroidCameraRecord;
|
||||||
|
|
||||||
import android.hardware.Camera;
|
import android.hardware.Camera;
|
||||||
import android.hardware.Camera.PreviewCallback;
|
import android.hardware.Camera.PreviewCallback;
|
||||||
|
@ -26,7 +26,13 @@ import android.hardware.Camera.Size;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
public class JavaCameraRecordImpl extends AndroidCameraRecord implements PreviewCallback {
|
/**
|
||||||
|
* This is an helper class, not a test activity.
|
||||||
|
*
|
||||||
|
* @author Guillaume Beraudo
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class JavaCameraRecordImpl extends AndroidCameraRecord implements PreviewCallback {
|
||||||
|
|
||||||
private TextView debug;
|
private TextView debug;
|
||||||
private long count = 0;
|
private long count = 0;
|
||||||
|
|
|
@ -21,8 +21,8 @@ package org.linphone.core.tutorials;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.core.AndroidCameraRecord;
|
|
||||||
import org.linphone.core.VideoSize;
|
import org.linphone.core.VideoSize;
|
||||||
|
import org.linphone.core.video.AndroidCameraRecord;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
|
@ -16,13 +16,13 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.core;
|
package org.linphone.core.video;
|
||||||
|
|
||||||
import org.linphone.Hacks;
|
import org.linphone.Hacks;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class AndroidCameraConf {
|
class AndroidCameraConf {
|
||||||
private static final String tag = "Linphone";
|
private static final String tag = "Linphone";
|
||||||
|
|
||||||
public void findFrontAndRearCameraIds(int[] frontCameraId, int[] rearCameraId, int[] cameraId) {
|
public void findFrontAndRearCameraIds(int[] frontCameraId, int[] rearCameraId, int[] cameraId) {
|
||||||
|
@ -39,6 +39,7 @@ public class AndroidCameraConf {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNumberOfCameras() {
|
public int getNumberOfCameras() {
|
||||||
|
Log.i(tag, "Detecting the number of cameras");
|
||||||
// Use hacks to guess the number of cameras
|
// Use hacks to guess the number of cameras
|
||||||
if (Hacks.isGalaxyS()) {
|
if (Hacks.isGalaxyS()) {
|
||||||
Log.d(tag, "Hack Galaxy S : has 2 cameras");
|
Log.d(tag, "Hack Galaxy S : has 2 cameras");
|
|
@ -16,11 +16,11 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.core;
|
package org.linphone.core.video;
|
||||||
|
|
||||||
import android.hardware.Camera;
|
import android.hardware.Camera;
|
||||||
|
|
||||||
public class AndroidCameraConf9 extends AndroidCameraConf {
|
class AndroidCameraConf9 extends AndroidCameraConf {
|
||||||
|
|
||||||
public void findFrontAndRearCameraIds9(Integer frontCameraId, Integer rearCameraId, Integer cameraId) {
|
public void findFrontAndRearCameraIds9(Integer frontCameraId, Integer rearCameraId, Integer cameraId) {
|
||||||
for (int id=0; id < getNumberOfCameras(); id++) {
|
for (int id=0; id < getNumberOfCameras(); id++) {
|
|
@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.core;
|
package org.linphone.core.video;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
|
@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.core;
|
package org.linphone.core.video;
|
||||||
|
|
||||||
import android.hardware.Camera;
|
import android.hardware.Camera;
|
||||||
import android.hardware.Camera.Parameters;
|
import android.hardware.Camera.Parameters;
|
||||||
|
@ -30,10 +30,10 @@ import android.util.Log;
|
||||||
* @author Guillaume Beraudo
|
* @author Guillaume Beraudo
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class AndroidCameraRecord8Impl extends AndroidCameraRecord5Impl {
|
class AndroidCameraRecord8 extends AndroidCameraRecordImpl {
|
||||||
|
|
||||||
|
|
||||||
public AndroidCameraRecord8Impl(RecorderParams parameters) {
|
public AndroidCameraRecord8(RecorderParams parameters) {
|
||||||
super(parameters);
|
super(parameters);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.core;
|
package org.linphone.core.video;
|
||||||
|
|
||||||
import android.hardware.Camera;
|
import android.hardware.Camera;
|
||||||
|
|
||||||
|
@ -26,10 +26,10 @@ import android.hardware.Camera;
|
||||||
* @author Guillaume Beraudo
|
* @author Guillaume Beraudo
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class AndroidCameraRecord9Impl extends AndroidCameraRecord8Impl {
|
class AndroidCameraRecord9 extends AndroidCameraRecord8 {
|
||||||
|
|
||||||
|
|
||||||
public AndroidCameraRecord9Impl(RecorderParams parameters) {
|
public AndroidCameraRecord9(RecorderParams parameters) {
|
||||||
super(parameters);
|
super(parameters);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,19 +16,24 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.core;
|
package org.linphone.core.video;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import android.hardware.Camera;
|
import android.hardware.Camera;
|
||||||
|
import android.hardware.Camera.Parameters;
|
||||||
import android.hardware.Camera.PreviewCallback;
|
import android.hardware.Camera.PreviewCallback;
|
||||||
|
import android.hardware.Camera.Size;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Record from Android camera.
|
* Record from Android camera.
|
||||||
|
* Android >= 5 (2.0) version.
|
||||||
*
|
*
|
||||||
* @author Guillaume Beraudo
|
* @author Guillaume Beraudo
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class AndroidCameraRecordImpl extends AndroidCameraRecord implements PreviewCallback {
|
class AndroidCameraRecordImpl extends AndroidCameraRecord implements PreviewCallback {
|
||||||
|
|
||||||
private long filterCtxPtr;
|
private long filterCtxPtr;
|
||||||
private double timeElapsedBetweenFrames = 0;
|
private double timeElapsedBetweenFrames = 0;
|
||||||
|
@ -85,7 +90,35 @@ public class AndroidCameraRecordImpl extends AndroidCameraRecord implements Prev
|
||||||
putImage(filterCtxPtr, data, rotation);
|
putImage(filterCtxPtr, data, rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onSettingCameraParameters(Parameters parameters) {
|
||||||
|
super.onSettingCameraParameters(parameters);
|
||||||
|
|
||||||
|
if (parameters.getSupportedFocusModes().contains(Camera.Parameters.FOCUS_MODE_AUTO)) {
|
||||||
|
Log.w(tag, "Auto Focus supported by camera device");
|
||||||
|
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
|
||||||
|
} else {
|
||||||
|
Log.w(tag, "Auto Focus not supported by camera device");
|
||||||
|
if (parameters.getSupportedFocusModes().contains(Camera.Parameters.FOCUS_MODE_INFINITY)) {
|
||||||
|
Log.w(tag, "Infinity Focus supported by camera device");
|
||||||
|
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_INFINITY);
|
||||||
|
} else {
|
||||||
|
Log.w(tag, "Infinity Focus not supported by camera device");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<Size> oneShotSupportedVideoSizes() {
|
||||||
|
Camera camera = Camera.open();
|
||||||
|
List<Size> supportedVideoSizes =camera.getParameters().getSupportedPreviewSizes();
|
||||||
|
camera.release();
|
||||||
|
return supportedVideoSizes;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<Size> getSupportedPreviewSizes(Parameters parameters) {
|
||||||
|
return parameters.getSupportedPreviewSizes();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void lowLevelSetPreviewCallback(Camera camera, PreviewCallback cb) {
|
protected void lowLevelSetPreviewCallback(Camera camera, PreviewCallback cb) {
|
|
@ -16,11 +16,12 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.core;
|
package org.linphone.core.video;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.linphone.core.AndroidCameraRecord.RecorderParams;
|
import org.linphone.core.Version;
|
||||||
|
import org.linphone.core.video.AndroidCameraRecord.RecorderParams;
|
||||||
|
|
||||||
import android.hardware.Camera.Size;
|
import android.hardware.Camera.Size;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -173,13 +174,13 @@ public class AndroidCameraRecordManager {
|
||||||
|
|
||||||
parameters.surfaceView = surfaceView;
|
parameters.surfaceView = surfaceView;
|
||||||
if (Version.sdkAboveOrEqual(9)) {
|
if (Version.sdkAboveOrEqual(9)) {
|
||||||
recorder = new AndroidCameraRecord9Impl(parameters);
|
recorder = new AndroidCameraRecord9(parameters);
|
||||||
} else if (Version.sdkAboveOrEqual(8)) {
|
} else if (Version.sdkAboveOrEqual(8)) {
|
||||||
recorder = new AndroidCameraRecord8Impl(parameters);
|
recorder = new AndroidCameraRecord8(parameters);
|
||||||
} else if (Version.sdkAboveOrEqual(5)) {
|
} else if (Version.sdkAboveOrEqual(5)) {
|
||||||
recorder = new AndroidCameraRecord5Impl(parameters);
|
|
||||||
} else {
|
|
||||||
recorder = new AndroidCameraRecordImpl(parameters);
|
recorder = new AndroidCameraRecordImpl(parameters);
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("SDK version unsupported " + Version.sdk());
|
||||||
}
|
}
|
||||||
|
|
||||||
recorder.startPreview();
|
recorder.startPreview();
|
||||||
|
@ -209,7 +210,7 @@ public class AndroidCameraRecordManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Version.sdkAboveOrEqual(5)) {
|
if (Version.sdkAboveOrEqual(5)) {
|
||||||
supportedVideoSizes = AndroidCameraRecord5Impl.oneShotSupportedVideoSizes();
|
supportedVideoSizes = AndroidCameraRecordImpl.oneShotSupportedVideoSizes();
|
||||||
}
|
}
|
||||||
|
|
||||||
// eventually null
|
// eventually null
|
|
@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone.ui;
|
package org.linphone.ui;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public interface AddressAwareWidget {
|
public interface AddressAwareWidget {
|
||||||
|
|
||||||
void setAddressWidget(AddressText address);
|
void setAddressWidget(AddressText address);
|
||||||
|
|
|
@ -25,10 +25,9 @@ import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnLongClickListener;
|
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
|
||||||
public class Digit extends Button implements OnLongClickListener, AddressAwareWidget {
|
public class Digit extends Button implements AddressAwareWidget {
|
||||||
|
|
||||||
private AddressText mAddress;
|
private AddressText mAddress;
|
||||||
|
|
||||||
|
@ -45,40 +44,32 @@ public class Digit extends Button implements OnLongClickListener, AddressAwareWi
|
||||||
setOnTouchListener(lListener);
|
setOnTouchListener(lListener);
|
||||||
|
|
||||||
if ("0+".equals(text)) {
|
if ("0+".equals(text)) {
|
||||||
setOnLongClickListener(this);
|
setOnLongClickListener(lListener);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onLongClick(View arg0) {
|
|
||||||
// Called if "0+" dtmf
|
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
|
||||||
lc.stopDtmf();
|
|
||||||
int lBegin = mAddress.getSelectionStart();
|
|
||||||
if (lBegin == -1) {
|
|
||||||
lBegin = mAddress.getEditableText().length();
|
|
||||||
}
|
|
||||||
if (lBegin >=0) {
|
|
||||||
mAddress.getEditableText().insert(lBegin,"+");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Digit(Context context, AttributeSet attrs, int style) {
|
public Digit(Context context, AttributeSet attrs, int style) {
|
||||||
super(context, attrs, style);
|
super(context, attrs, style);
|
||||||
|
setLongClickable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Digit(Context context, AttributeSet attrs) {
|
public Digit(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
|
setLongClickable(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Digit(Context context) {
|
public Digit(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
setLongClickable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private class DialKeyListener implements OnClickListener, OnTouchListener {
|
private class DialKeyListener implements OnClickListener, OnTouchListener, OnLongClickListener {
|
||||||
final CharSequence mKeyCode;
|
final CharSequence mKeyCode;
|
||||||
boolean mIsDtmfStarted=false;
|
boolean mIsDtmfStarted=false;
|
||||||
|
|
||||||
|
@ -117,6 +108,20 @@ public class Digit extends Button implements OnLongClickListener, AddressAwareWi
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean onLongClick(View v) {
|
||||||
|
// Called if "0+" dtmf
|
||||||
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
|
lc.stopDtmf();
|
||||||
|
int lBegin = mAddress.getSelectionStart();
|
||||||
|
if (lBegin == -1) {
|
||||||
|
lBegin = mAddress.getEditableText().length();
|
||||||
|
}
|
||||||
|
if (lBegin >=0) {
|
||||||
|
mAddress.getEditableText().insert(lBegin,"+");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public void setAddressWidget(AddressText address) {
|
public void setAddressWidget(AddressText address) {
|
||||||
|
|
64
src/org/linphone/ui/Numpad.java
Normal file
64
src/org/linphone/ui/Numpad.java
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
/*
|
||||||
|
NumpadView.java
|
||||||
|
Copyright (C) 2010 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.
|
||||||
|
*/
|
||||||
|
package org.linphone.ui;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import org.linphone.R;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
public class Numpad extends LinearLayout implements AddressAwareWidget {
|
||||||
|
|
||||||
|
public Numpad(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
LayoutInflater.from(context).inflate(R.layout.numpad, this);
|
||||||
|
setLongClickable(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddressWidget(AddressText address) {
|
||||||
|
for (AddressAwareWidget v : retrieveChildren(this)) {
|
||||||
|
v.setAddressWidget(address);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Collection<AddressAwareWidget> retrieveChildren(ViewGroup viewGroup) {
|
||||||
|
final Collection<AddressAwareWidget> views = new ArrayList<AddressAwareWidget>();
|
||||||
|
|
||||||
|
for (int i = 0; i < viewGroup.getChildCount(); i++) {
|
||||||
|
View v = viewGroup.getChildAt(i);
|
||||||
|
if (v instanceof ViewGroup) {
|
||||||
|
views.addAll(retrieveChildren((ViewGroup) v));
|
||||||
|
} else {
|
||||||
|
if (v instanceof AddressAwareWidget)
|
||||||
|
views.add((AddressAwareWidget) v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return views;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue