Added option to disable incall notification

This commit is contained in:
Sylvain Berfini 2013-03-20 14:02:32 +01:00
parent db119739f7
commit 9974965c7c
4 changed files with 53 additions and 3 deletions

45
res/raw/lpconfig.xsd Normal file
View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.linphone.org/xsds/lpconfig.xsd"
xmlns:tns="http://www.linphone.org/xsds/lpconfig.xsd"
elementFormDefault="qualified">
<xs:element name="config" type="tns:LPConfig"></xs:element>
<xs:complexType name="LPConfig">
<xs:sequence>
<xs:element name="section" type="tns:LPSection" minOccurs="0" maxOccurs="unbounded"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="LPSection">
<xs:sequence>
<xs:element name="entry" type="tns:LPEntry" maxOccurs="unbounded" minOccurs="0">
</xs:element>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"></xs:minLength>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="LPEntry">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="overwrite" type="xs:boolean"
use="optional" default="false">
</xs:attribute>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"></xs:minLength>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:schema>

View file

@ -64,5 +64,7 @@
<string name="about_bugreport_email">linphone-android@belledonne-communications.com</string>
<string name="temp_photo_name">linphone-android-photo-temp.jpg</string>
<string name="temp_photo_name_with_date">linphone-android-photo-%s.jpg</string>
<bool name="enable_call_notification">true</bool>
</resources>

View file

@ -448,7 +448,8 @@ public final class LinphoneManager implements LinphoneCoreListener {
public void enableCamera(LinphoneCall call, boolean enable) {
if (call != null) {
call.enableCamera(enable);
LinphoneService.instance().refreshIncallIcon(mLc.getCurrentCall());
if (mServiceContext.getResources().getBoolean(R.bool.enable_call_notification))
LinphoneService.instance().refreshIncallIcon(mLc.getCurrentCall());
}
}

View file

@ -572,10 +572,12 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
if (state == State.StreamsRunning) {
// Workaround bug current call seems to be updated after state changed to streams running
refreshIncallIcon(call);
if (getResources().getBoolean(R.bool.enable_call_notification))
refreshIncallIcon(call);
mWifiLock.acquire();
} else {
refreshIncallIcon(LinphoneManager.getLc().getCurrentCall());
if (getResources().getBoolean(R.bool.enable_call_notification))
refreshIncallIcon(LinphoneManager.getLc().getCurrentCall());
}
if ((state == State.CallEnd || state == State.Error) && LinphoneManager.getLc().getCallsNb() < 1) {
mWifiLock.release();