Remove call to impl classes
This commit is contained in:
parent
7c18d1d7ad
commit
c656a35aef
4 changed files with 23 additions and 25 deletions
|
@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone;
|
package org.linphone;
|
||||||
|
|
||||||
import org.linphone.core.LinphoneCoreFactoryImpl;
|
import org.linphone.core.LinphoneCoreFactory;
|
||||||
import org.linphone.core.LpConfig;
|
import org.linphone.core.LpConfig;
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
|
@ -31,7 +31,7 @@ public class BootReceiver extends BroadcastReceiver {
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
|
||||||
String path = context.getFilesDir().getAbsolutePath() + "/.linphonerc";
|
String path = context.getFilesDir().getAbsolutePath() + "/.linphonerc";
|
||||||
LpConfig lpConfig = LinphoneCoreFactoryImpl.instance().createLpConfig(path);
|
LpConfig lpConfig = LinphoneCoreFactory.instance().createLpConfig(path);
|
||||||
if (lpConfig.getBool("app", "auto_start", false)) {
|
if (lpConfig.getBool("app", "auto_start", false)) {
|
||||||
Intent lLinphoneServiceIntent = new Intent(Intent.ACTION_MAIN);
|
Intent lLinphoneServiceIntent = new Intent(Intent.ACTION_MAIN);
|
||||||
lLinphoneServiceIntent.setClass(context, LinphoneService.class);
|
lLinphoneServiceIntent.setClass(context, LinphoneService.class);
|
||||||
|
|
|
@ -38,6 +38,7 @@ import org.linphone.core.LinphoneCallLog.CallStatus;
|
||||||
import org.linphone.core.LinphoneChatMessage;
|
import org.linphone.core.LinphoneChatMessage;
|
||||||
import org.linphone.core.LinphoneChatRoom;
|
import org.linphone.core.LinphoneChatRoom;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
|
import org.linphone.core.LinphoneCore.LogCollectionUploadState;
|
||||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||||
import org.linphone.core.LinphoneCoreException;
|
import org.linphone.core.LinphoneCoreException;
|
||||||
import org.linphone.core.LinphoneCoreFactory;
|
import org.linphone.core.LinphoneCoreFactory;
|
||||||
|
@ -216,6 +217,11 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||||
|
if (lc != null) {
|
||||||
|
lc.addListener(mListener);
|
||||||
|
}
|
||||||
|
|
||||||
int missedCalls = LinphoneManager.getLc().getMissedCallsCount();
|
int missedCalls = LinphoneManager.getLc().getMissedCallsCount();
|
||||||
displayMissedCalls(missedCalls);
|
displayMissedCalls(missedCalls);
|
||||||
|
|
||||||
|
@ -1210,11 +1216,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
|
||||||
if (lc != null) {
|
|
||||||
lc.removeListener(mListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
getIntent().putExtra("PreviousActivity", 0);
|
getIntent().putExtra("PreviousActivity", 0);
|
||||||
super.onPause();
|
super.onPause();
|
||||||
}
|
}
|
||||||
|
@ -1227,11 +1228,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
||||||
startService(new Intent(ACTION_MAIN).setClass(this, LinphoneService.class));
|
startService(new Intent(ACTION_MAIN).setClass(this, LinphoneService.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
|
||||||
if (lc != null) {
|
|
||||||
lc.addListener(mListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
prepareContactsInBackground();
|
prepareContactsInBackground();
|
||||||
|
|
||||||
updateMissedChatCount();
|
updateMissedChatCount();
|
||||||
|
@ -1265,6 +1261,11 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
||||||
mOrientationHelper = null;
|
mOrientationHelper = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||||
|
if (lc != null) {
|
||||||
|
lc.removeListener(mListener);
|
||||||
|
}
|
||||||
|
|
||||||
instance = null;
|
instance = null;
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
|
||||||
|
@ -1407,7 +1408,6 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ContactPicked {
|
interface ContactPicked {
|
||||||
|
|
|
@ -51,7 +51,6 @@ import org.linphone.core.LinphoneCore.RegistrationState;
|
||||||
import org.linphone.core.LinphoneCore.RemoteProvisioningState;
|
import org.linphone.core.LinphoneCore.RemoteProvisioningState;
|
||||||
import org.linphone.core.LinphoneCoreException;
|
import org.linphone.core.LinphoneCoreException;
|
||||||
import org.linphone.core.LinphoneCoreFactory;
|
import org.linphone.core.LinphoneCoreFactory;
|
||||||
import org.linphone.core.LinphoneCoreFactoryImpl;
|
|
||||||
import org.linphone.core.LinphoneCoreListener;
|
import org.linphone.core.LinphoneCoreListener;
|
||||||
import org.linphone.core.LinphoneEvent;
|
import org.linphone.core.LinphoneEvent;
|
||||||
import org.linphone.core.LinphoneFriend;
|
import org.linphone.core.LinphoneFriend;
|
||||||
|
@ -227,7 +226,7 @@ public class LinphoneManager implements LinphoneCoreListener {
|
||||||
if (isInstanciated() && lc != null && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.Online) {
|
if (isInstanciated() && lc != null && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.Online) {
|
||||||
lc.getPresenceModel().getActivity().setType(PresenceActivityType.Online);
|
lc.getPresenceModel().getActivity().setType(PresenceActivityType.Online);
|
||||||
} else if (isInstanciated() && lc != null && !isPresenceModelActivitySet()) {
|
} else if (isInstanciated() && lc != null && !isPresenceModelActivitySet()) {
|
||||||
PresenceModel model = LinphoneCoreFactoryImpl.instance().createPresenceModel(PresenceActivityType.Online, null);
|
PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.Online, null);
|
||||||
lc.setPresenceModel(model);
|
lc.setPresenceModel(model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +236,7 @@ public class LinphoneManager implements LinphoneCoreListener {
|
||||||
if (isInstanciated() && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.OnThePhone) {
|
if (isInstanciated() && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.OnThePhone) {
|
||||||
lc.getPresenceModel().getActivity().setType(PresenceActivityType.OnThePhone);
|
lc.getPresenceModel().getActivity().setType(PresenceActivityType.OnThePhone);
|
||||||
} else if (isInstanciated() && !isPresenceModelActivitySet()) {
|
} else if (isInstanciated() && !isPresenceModelActivitySet()) {
|
||||||
PresenceModel model = LinphoneCoreFactoryImpl.instance().createPresenceModel(PresenceActivityType.OnThePhone, null);
|
PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.OnThePhone, null);
|
||||||
lc.setPresenceModel(model);
|
lc.setPresenceModel(model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,7 +246,7 @@ public class LinphoneManager implements LinphoneCoreListener {
|
||||||
if (isInstanciated() && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.Offline) {
|
if (isInstanciated() && isPresenceModelActivitySet() && lc.getPresenceModel().getActivity().getType() != PresenceActivityType.Offline) {
|
||||||
lc.getPresenceModel().getActivity().setType(PresenceActivityType.Offline);
|
lc.getPresenceModel().getActivity().setType(PresenceActivityType.Offline);
|
||||||
} else if (isInstanciated() && !isPresenceModelActivitySet()) {
|
} else if (isInstanciated() && !isPresenceModelActivitySet()) {
|
||||||
PresenceModel model = LinphoneCoreFactoryImpl.instance().createPresenceModel(PresenceActivityType.Offline, null);
|
PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.Offline, null);
|
||||||
lc.setPresenceModel(model);
|
lc.setPresenceModel(model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,7 @@ import org.linphone.core.LinphoneCore;
|
||||||
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.LinphoneCoreException;
|
import org.linphone.core.LinphoneCoreException;
|
||||||
import org.linphone.core.LinphoneCoreFactoryImpl;
|
import org.linphone.core.LinphoneCoreFactory;
|
||||||
import org.linphone.core.LinphoneCoreImpl;
|
|
||||||
import org.linphone.core.LinphoneCoreListenerBase;
|
import org.linphone.core.LinphoneCoreListenerBase;
|
||||||
import org.linphone.core.LinphoneProxyConfig;
|
import org.linphone.core.LinphoneProxyConfig;
|
||||||
import org.linphone.mediastream.Log;
|
import org.linphone.mediastream.Log;
|
||||||
|
@ -137,9 +136,10 @@ public final class LinphoneService extends Service {
|
||||||
mNotificationTitle = getString(R.string.service_name);
|
mNotificationTitle = getString(R.string.service_name);
|
||||||
|
|
||||||
// Needed in order for the two next calls to succeed, libraries must have been loaded first
|
// Needed in order for the two next calls to succeed, libraries must have been loaded first
|
||||||
LinphoneCoreFactoryImpl.instance();
|
LinphoneCoreFactory.instance();
|
||||||
LinphoneCoreImpl.setLogCollectionPath(getFilesDir().getAbsolutePath());
|
Log.w(getFilesDir().getAbsolutePath());
|
||||||
LinphoneCoreImpl.enableLogCollection(!(getResources().getBoolean(R.bool.disable_every_log)));
|
LinphoneCoreFactory.instance().setLogCollectionPath(getFilesDir().getAbsolutePath());
|
||||||
|
LinphoneCoreFactory.instance().enableLogCollection(!(getResources().getBoolean(R.bool.disable_every_log)));
|
||||||
|
|
||||||
// Dump some debugging information to the logs
|
// Dump some debugging information to the logs
|
||||||
Log.i(START_LINPHONE_LOGS);
|
Log.i(START_LINPHONE_LOGS);
|
||||||
|
@ -167,7 +167,6 @@ public final class LinphoneService extends Service {
|
||||||
startWifiLock();
|
startWifiLock();
|
||||||
}
|
}
|
||||||
instance = this; // instance is ready once linphone manager has been created
|
instance = this; // instance is ready once linphone manager has been created
|
||||||
|
|
||||||
LinphoneManager.getLc().addListener(mListener = new LinphoneCoreListenerBase(){
|
LinphoneManager.getLc().addListener(mListener = new LinphoneCoreListenerBase(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -322,7 +321,7 @@ public final class LinphoneService extends Service {
|
||||||
String userName = call.getRemoteAddress().getUserName();
|
String userName = call.getRemoteAddress().getUserName();
|
||||||
String domain = call.getRemoteAddress().getDomain();
|
String domain = call.getRemoteAddress().getDomain();
|
||||||
String displayName = call.getRemoteAddress().getDisplayName();
|
String displayName = call.getRemoteAddress().getDisplayName();
|
||||||
LinphoneAddress address = LinphoneCoreFactoryImpl.instance().createLinphoneAddress(userName,domain,null);
|
LinphoneAddress address = LinphoneCoreFactory.instance().createLinphoneAddress(userName,domain,null);
|
||||||
address.setDisplayName(displayName);
|
address.setDisplayName(displayName);
|
||||||
|
|
||||||
Uri pictureUri = LinphoneUtils.findUriPictureOfContactAndSetDisplayName(address, getContentResolver());
|
Uri pictureUri = LinphoneUtils.findUriPictureOfContactAndSetDisplayName(address, getContentResolver());
|
||||||
|
@ -402,7 +401,7 @@ public final class LinphoneService extends Service {
|
||||||
|
|
||||||
Uri pictureUri;
|
Uri pictureUri;
|
||||||
try {
|
try {
|
||||||
pictureUri = LinphoneUtils.findUriPictureOfContactAndSetDisplayName(LinphoneCoreFactoryImpl.instance().createLinphoneAddress(fromSipUri), getContentResolver());
|
pictureUri = LinphoneUtils.findUriPictureOfContactAndSetDisplayName(LinphoneCoreFactory.instance().createLinphoneAddress(fromSipUri), getContentResolver());
|
||||||
} catch (LinphoneCoreException e1) {
|
} catch (LinphoneCoreException e1) {
|
||||||
Log.e("Cannot parse from address",e1);
|
Log.e("Cannot parse from address",e1);
|
||||||
pictureUri=null;
|
pictureUri=null;
|
||||||
|
|
Loading…
Reference in a new issue