A bit of refactoring...

This commit is contained in:
Sylvain Berfini 2017-10-20 15:28:58 +02:00
parent 0d1fb872be
commit 6bf535ab37
86 changed files with 347 additions and 625 deletions

View file

@ -70,7 +70,7 @@
android:label="@string/app_name"
android:largeHeap="true">
<activity
android:name=".LinphoneLauncherActivity"
android:name=".activities.LinphoneLauncherActivity"
android:exported="true"
android:launchMode="singleTask"
android:label="@string/app_name"
@ -121,7 +121,7 @@
</intent-filter>
</activity>
<activity
android:name=".LinphoneActivity"
android:name=".activities.LinphoneActivity"
android:launchMode="singleTask"
android:theme="@style/NoTitle">
<intent-filter>
@ -129,7 +129,7 @@
</intent-filter>
</activity>
<activity
android:name=".CallIncomingActivity"
android:name=".call.CallIncomingActivity"
android:launchMode="singleTop"
android:theme="@style/NoTitle">
<intent-filter>
@ -137,7 +137,7 @@
</intent-filter>
</activity>
<activity
android:name=".CallOutgoingActivity"
android:name=".call.CallOutgoingActivity"
android:launchMode="singleTop"
android:theme="@style/NoTitle">
<intent-filter>
@ -145,7 +145,7 @@
</intent-filter>
</activity>
<activity
android:name=".CallActivity"
android:name=".call.CallActivity"
android:launchMode="singleTop"
android:theme="@style/FullScreen">
<intent-filter>
@ -228,16 +228,16 @@
android:resource="@xml/authenticator"/>
</service>
<receiver android:name=".NetworkManager">
<receiver android:name=".receivers.NetworkManager">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
<receiver
android:name=".BluetoothManager"
android:name=".receivers.BluetoothManager"
android:enabled="false">
</receiver>
<receiver android:name=".BootReceiver">
<receiver android:name=".receivers.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
@ -245,22 +245,22 @@
<action android:name="android.intent.action.ACTION_SHUTDOWN"/>
</intent-filter>
</receiver>
<receiver android:name=".PhoneStateChangedReceiver">
<receiver android:name=".receivers.PhoneStateChangedReceiver">
<intent-filter android:priority="999">
<action android:name="android.intent.action.PHONE_STATE"/>
</intent-filter>
</receiver>
<!-- This one needs to be registered from application -->
<receiver android:name=".KeepAliveReceiver"/>
<receiver android:name=".receivers.KeepAliveReceiver"/>
<receiver android:name=".HookReceiver" >
<receiver android:name=".receivers.HookReceiver" >
<intent-filter>
<action android:name="com.base.module.phone.HOOKEVENT" />
</intent-filter>
</receiver>
<receiver android:name=".OutgoingCallReceiver"
<receiver android:name=".receivers.OutgoingCallReceiver"
android:permission="android.permission.PROCESS_OUTGOING_CALLS">
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
@ -286,7 +286,7 @@
-->
<receiver
android:name=".AccountEnableReceiver"
android:name=".receivers.AccountEnableReceiver"
android:permission="android.permission.USE_SIP">
<intent-filter>
<action android:name="org.linphone.intent.ACCOUNTACTIVATE"/>
@ -314,49 +314,7 @@
android:resource="@xml/provider_paths"/>
</provider>
<activity
android:name=".tutorials.TutorialLauncherActivity"
android:theme="@style/NoTitle">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
<activity
android:name=".tutorials.TutorialBuddyStatusActivity"
android:theme="@style/NoTitle">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
<activity
android:name=".tutorials.TutorialChatRoomActivity"
android:theme="@style/NoTitle">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
<activity
android:name=".tutorials.TutorialHelloWorldActivity"
android:theme="@style/NoTitle">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
<activity
android:name=".tutorials.TutorialRegistrationActivity"
android:theme="@style/NoTitle">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
<activity
android:name=".tutorials.TutorialCardDavSync"
android:theme="@style/NoTitle">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
<activity android:name=".LinphoneGenericActivity">
</activity>
<activity android:name=".activities.LinphoneGenericActivity"/>
</application>
</manifest>

View file

@ -483,7 +483,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="35dp"
tools:layout="@layout/status" />

View file

@ -8,7 +8,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="40dp"
tools:layout="@layout/status" />

View file

@ -8,7 +8,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
tools:layout="@layout/status"
android:layout_width="match_parent"
android:layout_height="40dp"/>

View file

@ -7,7 +7,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="35dp"
tools:layout="@layout/status" />

View file

@ -7,7 +7,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="35dp"
tools:layout="@layout/status" />

View file

@ -8,7 +8,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="40dp"
tools:layout="@layout/status" />

View file

@ -8,7 +8,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
tools:layout="@layout/status"
android:layout_width="match_parent"
android:layout_height="40dp"/>

View file

@ -7,7 +7,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="35dp"
tools:layout="@layout/status" />

View file

@ -7,7 +7,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="40dp"
tools:layout="@layout/status" />

View file

@ -8,7 +8,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="40dp"
tools:layout="@layout/status"/>

View file

@ -477,7 +477,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="40dp"
tools:layout="@layout/status" />

View file

@ -8,7 +8,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="40dp"
tools:layout="@layout/status" />

View file

@ -8,7 +8,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
tools:layout="@layout/status"
android:layout_width="match_parent"
android:layout_height="40dp"/>

View file

@ -8,7 +8,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="40dp"
tools:layout="@layout/status"/>

View file

@ -7,7 +7,7 @@
<fragment
android:id="@+id/status"
android:name="org.linphone.StatusFragment"
android:name="org.linphone.fragments.StatusFragment"
android:layout_width="match_parent"
android:layout_height="40dp"
tools:layout="@layout/status" />

View file

@ -1,94 +0,0 @@
package org.linphone;
/*
GroupContactsListAdapter.java
Copyright (C) 2017 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
public class GroupContactsListAdapter extends BaseAdapter {
private class ViewHolder {
public TextView name;
public TextView admin;
public ImageView linphoneContact;
public ImageView isAdmin;
public ImageView photo;
public ViewHolder(View view) {
name = (TextView) view.findViewById(R.id.sip_uri);
linphoneContact = (ImageView) view.findViewById(R.id.contact_linphone);
isAdmin = (ImageView) view.findViewById(R.id.contact_is_select);
admin = (TextView) view.findViewById(R.id.admin);
photo = (ImageView) view.findViewById(R.id.contact_picture);
}
}
public List<ContactAddress> getGroupContacts() {
return groupContacts;
}
public void setGroupContacts(List<ContactAddress> groupContacts) {
this.groupContacts = groupContacts;
}
private List<ContactAddress> groupContacts;
private LayoutInflater mInflater;
public GroupContactsListAdapter(LayoutInflater inf) {
mInflater = inf;
}
@Override
public int getCount() {
return groupContacts.size();
}
@Override
public Object getItem(int i) {
return groupContacts.get(i);
}
@Override
public long getItemId(int i) {
return i;
}
@Override
public View getView(int i, View convertView, ViewGroup parent) {
View view;
ViewHolder holder;
if (convertView != null) {
view = convertView;
holder = (ViewHolder) view.getTag();
} else {
view = mInflater.inflate(R.layout.search_contact_cell, parent, false);
holder = new ViewHolder(view);
view.setTag(holder);
}
return view;
}
}

View file

@ -1,38 +0,0 @@
package org.linphone;
/*
CoreException.java
Copyright (C) 2017 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
@SuppressWarnings("serial")
public class LinphoneException extends Exception {
public LinphoneException() {}
public LinphoneException(String detailMessage) {
super(detailMessage);
}
public LinphoneException(Throwable throwable) {
super(throwable);
}
public LinphoneException(String detailMessage, Throwable throwable) {
super(detailMessage, throwable);
}
}

View file

@ -72,9 +72,14 @@ import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import org.linphone.call.CallActivity;
import org.linphone.call.CallIncomingActivity;
import org.linphone.activities.LinphoneActivity;
import org.linphone.assistant.AssistantActivity;
import org.linphone.call.CallManager;
import org.linphone.contacts.ContactsManager;
import org.linphone.contacts.LinphoneContact;
import org.linphone.core.AccountCreatorListener;
import org.linphone.core.Call.Dir;
import org.linphone.core.AccountCreator;
import org.linphone.core.Address;
import org.linphone.core.AuthInfo;
@ -103,8 +108,6 @@ import org.linphone.core.Event;
import org.linphone.core.Friend;
import org.linphone.core.FriendList;
import org.linphone.core.InfoMessage;
import org.linphone.core.Participant;
import org.linphone.core.PresenceActivity;
import org.linphone.core.ProxyConfig;
import org.linphone.core.VersionUpdateCheckResult;
import org.linphone.core.tools.OpenH264DownloadHelperListener;
@ -123,14 +126,18 @@ import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration.
import org.linphone.mediastream.video.capture.hwconf.Hacks;
import org.linphone.core.tools.H264Helper;
import org.linphone.core.tools.OpenH264DownloadHelper;
import org.linphone.receivers.BluetoothManager;
import org.linphone.receivers.DozeReceiver;
import org.linphone.receivers.HookReceiver;
import org.linphone.receivers.KeepAliveReceiver;
import org.linphone.receivers.NetworkManager;
import org.linphone.receivers.OutgoingCallReceiver;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
@ -840,7 +847,7 @@ public class LinphoneManager implements CoreListener, ChatMessageListener, Senso
TimerTask lTask = new TimerTask() {
@Override
public void run() {
UIThreadDispatcher.dispatch(new Runnable() {
LinphoneUtils.dispatchOnUIThread(new Runnable() {
@Override
public void run() {
if (mLc != null) {
@ -889,16 +896,6 @@ public class LinphoneManager implements CoreListener, ChatMessageListener, Senso
private synchronized void initLiblinphone(Core lc) throws CoreException {
mLc = lc;
PreferencesMigrator prefMigrator = new PreferencesMigrator(mServiceContext);
prefMigrator.migrateRemoteProvisioningUriIfNeeded();
prefMigrator.migrateSharingServerUrlIfNeeded();
prefMigrator.doPresenceMigrationIfNeeded();
if (prefMigrator.isMigrationNeeded()) {
prefMigrator.doMigration();
}
mLc.setZrtpSecretsFile(basePath + "/zrtp_secrets");
try {
@ -981,7 +978,7 @@ public class LinphoneManager implements CoreListener, ChatMessageListener, Senso
callGsmON = false;
}
protected void setHandsetMode(Boolean on){
public void setHandsetMode(Boolean on){
if (mLc.isIncomingInvitePending() && on) {
handsetON = true;
mLc.acceptCall(mLc.getCurrentCall());
@ -996,7 +993,7 @@ public class LinphoneManager implements CoreListener, ChatMessageListener, Senso
}
}
protected boolean isHansetModeOn(){
public boolean isHansetModeOn(){
return handsetON;
}
@ -1834,26 +1831,6 @@ public class LinphoneManager implements CoreListener, ChatMessageListener, Senso
callGsmON = on;
}
@SuppressWarnings("serial")
public static class ConfigException extends LinphoneException {
public ConfigException() {
super();
}
public ConfigException(String detailMessage, Throwable throwable) {
super(detailMessage, throwable);
}
public ConfigException(String detailMessage) {
super(detailMessage);
}
public ConfigException(Throwable throwable) {
super(throwable);
}
}
@Override
public void onTransferStateChanged(Core lc, Call call,
State new_call_state) {

View file

@ -1432,7 +1432,7 @@ public class LinphonePreferences {
}
public String getActivityToLaunchOnIncomingReceived() {
return getConfig().getString("app", "incoming_call_activity", "org.linphone.LinphoneActivity");
return getConfig().getString("app", "incoming_call_activity", "org.linphone.activities.LinphoneActivity");
}
public void setActivityToLaunchOnIncomingReceived(String name) {

View file

@ -23,7 +23,10 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import org.linphone.activities.LinphoneActivity;
import org.linphone.compatibility.Compatibility;
import org.linphone.contacts.ContactsManager;
import org.linphone.contacts.LinphoneContact;
import org.linphone.core.Address;
import org.linphone.core.Call;
import org.linphone.core.Call.State;
@ -31,13 +34,13 @@ import org.linphone.core.CallLog.CallStatus;
import org.linphone.core.Core;
import org.linphone.core.Core.GlobalState;
import org.linphone.core.Core.RegistrationState;
import org.linphone.core.CoreException;
import org.linphone.core.Factory;
import org.linphone.core.CoreListenerStub;
import org.linphone.core.LogCollectionState;
import org.linphone.core.ProxyConfig;
import org.linphone.mediastream.Log;
import org.linphone.mediastream.Version;
import org.linphone.receivers.KeepAliveReceiver;
import org.linphone.ui.LinphoneOverlay;
import android.annotation.TargetApi;

View file

@ -35,6 +35,8 @@ import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.os.ParcelFileDescriptor;
import android.provider.MediaStore;
import android.provider.MediaStore.Images;
@ -49,8 +51,8 @@ import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import org.linphone.contacts.ContactsManager;
import org.linphone.core.DialPlan;
import org.linphone.core.AccountCreator;
import org.linphone.core.Address;
@ -58,7 +60,6 @@ import org.linphone.core.Call;
import org.linphone.core.Call.State;
import org.linphone.core.ChatMessage;
import org.linphone.core.Core;
import org.linphone.core.CoreException;
import org.linphone.core.Factory;
import org.linphone.core.ProxyConfig;
import org.linphone.mediastream.Log;
@ -97,8 +98,15 @@ import static android.view.View.VISIBLE;
*/
public final class LinphoneUtils {
private static Context context = null;
private static Handler mHandler = new Handler(Looper.getMainLooper());
private LinphoneUtils(){}
private LinphoneUtils() {
}
public static void dispatchOnUIThread(Runnable r) {
mHandler.post(r);
}
//private static final String sipAddressRegExp = "^(sip:)?(\\+)?[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\\.-][a-z0-9]+)*)+\\.[a-z]{2,}(:[0-9]{2,5})?$";
//private static final String strictSipAddressRegExp = "^sip:(\\+)?[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\\.-][a-z0-9]+)*)+\\.[a-z]{2,}$";

View file

@ -1,192 +0,0 @@
package org.linphone;
/*
PreferencesMigrator.java
Copyright (C) 2017 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.LinphonePreferences.AccountBuilder;
import org.linphone.core.Core;
import org.linphone.core.CoreException;
import org.linphone.core.ProxyConfig;
import org.linphone.core.Config;
import org.linphone.mediastream.Log;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.res.Resources;
import android.preference.PreferenceManager;
public class PreferencesMigrator {
private LinphonePreferences mNewPrefs;
private SharedPreferences mOldPrefs;
private Resources mResources;
public PreferencesMigrator(Context context) {
mNewPrefs = LinphonePreferences.instance();
mResources = context.getResources();
mOldPrefs = PreferenceManager.getDefaultSharedPreferences(context);
}
public boolean isEchoMigratioNeeded() {
Core lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
if (lc == null) {
return false;
}
if (mNewPrefs.isEchoConfigurationUpdated()) {
return false;
}
return (!lc.isEchoCancellerCalibrationRequired() && mNewPrefs.echoCancellationEnabled());
}
public boolean isMigrationNeeded() {
int accountNumber = mOldPrefs.getInt(getString(R.string.pref_extra_accounts), -1);
return accountNumber != -1;
}
public void doMigration() {
mNewPrefs.firstLaunchSuccessful(); // If migration is needed, it is safe to assume Linphone has already been started once.
mNewPrefs.removePreviousVersionAuthInfoRemoval(); // Remove flag in linphonerc asking core not to store auths infos
mNewPrefs.setFrontCamAsDefault(getPrefBoolean(R.string.pref_video_use_front_camera_key, true));
mNewPrefs.setWifiOnlyEnabled(getPrefBoolean(R.string.pref_wifi_only_key, false));
mNewPrefs.useRandomPort(getPrefBoolean(R.string.pref_transport_use_random_ports_key, true), false);
mNewPrefs.setPushNotificationEnabled(getPrefBoolean(R.string.pref_push_notification_key, false));
mNewPrefs.setPushNotificationRegistrationID(getPrefString(R.string.push_reg_id_key, null));
mNewPrefs.setDebugEnabled(getPrefBoolean(R.string.pref_debug_key, false));
mNewPrefs.setBackgroundModeEnabled(getPrefBoolean(R.string.pref_background_mode_key, true));
mNewPrefs.setAutoStart(getPrefBoolean(R.string.pref_autostart_key, false));
mNewPrefs.setSharingPictureServerUrl(getPrefString(R.string.pref_image_sharing_server_key, null));
mNewPrefs.setRemoteProvisioningUrl(getPrefString(R.string.pref_remote_provisioning_key, null));
doAccountsMigration();
deleteAllOldPreferences();
}
public void migrateRemoteProvisioningUriIfNeeded() {
String oldUri = mNewPrefs.getConfig().getString("app", "remote_provisioning", null);
String currentUri = mNewPrefs.getRemoteProvisioningUrl();
if (oldUri != null && oldUri.length() > 0 && currentUri == null) {
mNewPrefs.setRemoteProvisioningUrl(oldUri);
mNewPrefs.getConfig().setString("app", "remote_provisioning", null);
mNewPrefs.getConfig().sync();
}
}
public void migrateSharingServerUrlIfNeeded() {
String currentUrl = mNewPrefs.getConfig().getString("app", "sharing_server", null);
if (currentUrl == null || currentUrl.equals("https://www.linphone.org:444/upload.php")) {
mNewPrefs.setSharingPictureServerUrl("https://www.linphone.org:444/lft.php");
mNewPrefs.getConfig().sync();
}
}
private void doAccountsMigration() {
Core lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
lc.clearAllAuthInfo();
lc.clearProxyConfig();
for (int i = 0; i < mOldPrefs.getInt(getString(R.string.pref_extra_accounts), 1); i++) {
doAccountMigration(i, i == getPrefInt(R.string.pref_default_account_key, 0));
}
}
private void doAccountMigration(int index, boolean isDefaultAccount) {
String key = index == 0 ? "" : String.valueOf(index);
String username = getPrefString(getString(R.string.pref_username_key) + key, null);
String userid = getPrefString(getString(R.string.pref_auth_userid_key) + key, null);
String password = getPrefString(getString(R.string.pref_passwd_key) + key, null);
String domain = getPrefString(getString(R.string.pref_domain_key) + key, null);
if (username != null && username.length() > 0 && password != null) {
String proxy = getPrefString(getString(R.string.pref_proxy_key) + key, null);
String expire = getPrefString(R.string.pref_expire_key, null);
AccountBuilder builder = new AccountBuilder(LinphoneManager.getLc())
.setUsername(username)
.setUserid(userid)
.setDomain(domain)
.setPassword(password)
.setServerAddr(proxy)
.setExpires(expire);
if (getPrefBoolean(getString(R.string.pref_enable_outbound_proxy_key) + key, false)) {
builder.setOutboundProxyEnabled(true);
}
if (mResources.getBoolean(R.bool.enable_push_id)) {
String regId = mNewPrefs.getPushNotificationRegistrationID();
String appId = getString(R.string.push_sender_id);
if (regId != null && mNewPrefs.isPushNotificationEnabled()) {
String contactInfos = "app-id=" + appId + ";pn-type=" + getString(R.string.push_type) + ";pn-tok=" + regId;
builder.setContactParameters(contactInfos);
}
}
try {
builder.saveNewAccount();
} catch (CoreException e) {
Log.e(e);
}
if (isDefaultAccount) {
mNewPrefs.setDefaultAccount(index);
}
}
}
public void doPresenceMigrationIfNeeded() {
Core lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
Config cfg = lc.getConfig();
if (cfg.getString("app", "friendlist_subscription_enabled", null) == null){
ProxyConfig proxy = lc.getDefaultProxyConfig();
if (proxy != null) {
String domain = proxy.getDomain();
if (domain!=null && domain.equals(getString(R.string.default_domain))) {
cfg.setBool("app", "friendlist_subscription_enabled", true);
}
}
}
}
private void deleteAllOldPreferences() {
Editor editor = mOldPrefs.edit();
editor.clear();
editor.apply();
}
private String getString(int key) {
return mResources.getString(key);
}
private boolean getPrefBoolean(int key, boolean defaultValue) {
return mOldPrefs.getBoolean(mResources.getString(key), defaultValue);
}
private boolean getPrefBoolean(String key, boolean defaultValue) {
return mOldPrefs.getBoolean(key, defaultValue);
}
private String getPrefString(int key, String defaultValue) {
return mOldPrefs.getString(mResources.getString(key), defaultValue);
}
private int getPrefInt(int key, int defaultValue) {
return mOldPrefs.getInt(mResources.getString(key), defaultValue);
}
private String getPrefString(String key, String defaultValue) {
return mOldPrefs.getString(key, defaultValue);
}
}

View file

@ -1,31 +0,0 @@
package org.linphone;
/*
UIThreadDispatcher.java
Copyright (C) 2017 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import android.os.Handler;
import android.os.Looper;
public class UIThreadDispatcher {
private static Handler mHandler = new Handler(Looper.getMainLooper());
public static void dispatch(Runnable r) {
mHandler.post(r);
}
}

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.activities;
/*
LinphoneActivity.java
@ -62,12 +62,37 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import org.linphone.call.CallActivity;
import org.linphone.call.CallIncomingActivity;
import org.linphone.call.CallOutgoingActivity;
import org.linphone.fragments.AboutFragment;
import org.linphone.fragments.AccountPreferencesFragment;
import org.linphone.contacts.ContactAddress;
import org.linphone.contacts.ContactDetailsFragment;
import org.linphone.contacts.ContactEditorFragment;
import org.linphone.contacts.ContactsListFragment;
import org.linphone.contacts.ContactsManager;
import org.linphone.fragments.DialerFragment;
import org.linphone.fragments.EmptyFragment;
import org.linphone.fragments.FragmentsAvailable;
import org.linphone.fragments.HistoryDetailFragment;
import org.linphone.fragments.HistoryListFragment;
import org.linphone.chat.InfoGroupChatFragment;
import org.linphone.contacts.LinphoneContact;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneManager.AddressType;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.fragments.SettingsFragment;
import org.linphone.fragments.StatusFragment;
import org.linphone.assistant.AssistantActivity;
import org.linphone.assistant.RemoteProvisioningLoginActivity;
import org.linphone.chat.ChatCreationFragment;
import org.linphone.chat.ChatFragment;
import org.linphone.chat.ChatListFragment;
import org.linphone.chat.GroupChatFragment;
import org.linphone.compatibility.Compatibility;
import org.linphone.core.Address;
import org.linphone.core.AuthInfo;
@ -102,7 +127,7 @@ import java.util.Comparator;
import java.util.Date;
import java.util.List;
import static org.linphone.LinphoneActivity.ChatRoomContainer.createChatroomContainer;
import static org.linphone.activities.LinphoneActivity.ChatRoomContainer.createChatroomContainer;
public class LinphoneActivity extends LinphoneGenericActivity implements OnClickListener, ContactPicked, ActivityCompat.OnRequestPermissionsResultCallback {
public static final String PREF_FIRST_LAUNCH = "pref_first_launch";

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.activities;
/*
LinphoneGenericActivity.java
@ -22,6 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import android.app.Activity;
import android.os.Bundle;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneService;
public class LinphoneGenericActivity extends Activity {
@Override

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.activities;
/*
LinphoneLauncherActivity.java
@ -27,7 +27,15 @@ import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import org.linphone.receivers.BluetoothManager;
import org.linphone.contacts.ContactsManager;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.assistant.RemoteProvisioningActivity;
import org.linphone.call.CallActivity;
import org.linphone.mediastream.Version;
import static android.content.Intent.ACTION_MAIN;

View file

@ -22,16 +22,16 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.linphone.ContactsManager;
import org.linphone.LinphoneActivity;
import org.linphone.LinphoneLauncherActivity;
import org.linphone.contacts.ContactsManager;
import org.linphone.activities.LinphoneActivity;
import org.linphone.activities.LinphoneLauncherActivity;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphonePreferences.AccountBuilder;
import org.linphone.LinphoneService;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.StatusFragment;
import org.linphone.fragments.StatusFragment;
import org.linphone.core.AccountCreatorListener;
import org.linphone.core.DialPlan;
import org.linphone.core.AccountCreator;

View file

@ -22,7 +22,7 @@ import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.linphone.LinphoneActivity;
import org.linphone.activities.LinphoneActivity;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneUtils;
@ -31,7 +31,6 @@ import org.linphone.core.DialPlan;
import org.linphone.core.AccountCreator;
import org.linphone.core.AccountCreatorListener;
import org.linphone.core.AccountCreator.Status;
import org.linphone.core.Factory;
import org.linphone.core.ProxyConfig;
import android.accounts.Account;

View file

@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import org.linphone.LinphoneLauncherActivity;
import org.linphone.activities.LinphoneLauncherActivity;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
@ -189,7 +189,7 @@ public class RemoteProvisioningActivity extends Activity {
private void goToLinphoneActivity() {
if (LinphoneService.isReady()) {
LinphoneService.instance().setActivityToLaunchOnIncomingReceived("org.linphone.LinphoneLauncherActivity");
LinphoneService.instance().setActivityToLaunchOnIncomingReceived("org.linphone.activities.LinphoneLauncherActivity");
//finish(); // To prevent the user to come back to this page using back button
startActivity(new Intent().setClass(this, LinphoneLauncherActivity.class));
} else {

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.call;
/*
CallActivity.java
@ -24,21 +24,15 @@ import android.app.Activity;
import android.app.Dialog;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.PowerManager;
import android.os.SystemClock;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
@ -62,6 +56,16 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import org.linphone.receivers.BluetoothManager;
import org.linphone.contacts.ContactsManager;
import org.linphone.contacts.LinphoneContact;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.activities.LinphoneGenericActivity;
import org.linphone.core.Address;
import org.linphone.core.Call;
import org.linphone.core.Call.State;
@ -71,11 +75,11 @@ import org.linphone.core.CallStats.AddressFamily;
import org.linphone.core.ChatMessage;
import org.linphone.core.ChatRoom;
import org.linphone.core.Core;
import org.linphone.core.CoreException;
import org.linphone.core.CoreListenerStub;
import org.linphone.core.Player;
import org.linphone.core.PayloadType;
import org.linphone.core.StreamType;
import org.linphone.fragments.StatusFragment;
import org.linphone.mediastream.Log;
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
import org.linphone.ui.Numpad;
@ -456,7 +460,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
switch (requestCode) {
case PERMISSIONS_REQUEST_CAMERA:
UIThreadDispatcher.dispatch(new Runnable() {
LinphoneUtils.dispatchOnUIThread(new Runnable() {
@Override
public void run() {
acceptCallUpdate(grantResults[0] == PackageManager.PERMISSION_GRANTED);
@ -464,7 +468,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
});
break;
case PERMISSIONS_ENABLED_CAMERA:
UIThreadDispatcher.dispatch(new Runnable() {
LinphoneUtils.dispatchOnUIThread(new Runnable() {
@Override
public void run() {
disableVideo(grantResults[0] != PackageManager.PERMISSION_GRANTED);
@ -472,7 +476,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
});
break;
case PERMISSIONS_ENABLED_MIC:
UIThreadDispatcher.dispatch(new Runnable() {
LinphoneUtils.dispatchOnUIThread(new Runnable() {
@Override
public void run() {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
@ -511,11 +515,11 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
displayMissedChats();
}
protected void setSpeakerEnabled(boolean enabled){
public void setSpeakerEnabled(boolean enabled){
isSpeakerEnabled = enabled;
}
protected void refreshInCallActions() {
public void refreshInCallActions() {
if (!LinphonePreferences.instance().isVideoEnabled() || isConferenceRunning) {
enabledVideoButton(false);
} else {

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.call;
/*
CallAudioFragment.java
@ -26,6 +26,9 @@ import android.view.View;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import org.linphone.call.CallActivity;
import org.linphone.R;
public class CallAudioFragment extends Fragment {
private CallActivity incallActvityInstance;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.call;
/*
CallIncomingActivity.java
@ -33,6 +33,15 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import org.linphone.contacts.ContactsManager;
import org.linphone.contacts.LinphoneContact;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.activities.LinphoneGenericActivity;
import org.linphone.core.Address;
import org.linphone.core.Call;
import org.linphone.core.Call.State;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.call;
/*
CallManager.java
@ -19,6 +19,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.BandwidthManager;
import org.linphone.LinphoneManager;
import org.linphone.core.Address;
import org.linphone.core.Call;
import org.linphone.core.CallParams;
@ -44,9 +46,6 @@ public class CallManager {
return BandwidthManager.getInstance();
}
public void inviteAddress(Address lAddress, boolean videoEnabled, boolean lowBandwidth) throws CoreException {
Core lc = LinphoneManager.getLc();
@ -67,16 +66,13 @@ public class CallManager {
lc.inviteAddressWithParams(lAddress, params);
}
/**
* Add video to a currently running voice only call.
* No re-invite is sent if the current call is already video
* or if the bandwidth settings are too low.
* @return if updateCall called
*/
boolean reinviteWithVideo() {
public boolean reinviteWithVideo() {
Core lc = LinphoneManager.getLc();
Call lCall = lc.getCurrentCall();
if (lCall == null) {
@ -106,7 +102,7 @@ public class CallManager {
/**
* Re-invite with parameters updated from profile.
*/
void reinvite() {
public void reinvite() {
Core lc = LinphoneManager.getLc();
Call lCall = lc.getCurrentCall();
if (lCall == null) {

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.call;
/*
CallOutgoingActivity.java
@ -22,6 +22,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import java.util.ArrayList;
import java.util.List;
import org.linphone.contacts.ContactsManager;
import org.linphone.contacts.LinphoneContact;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.activities.LinphoneGenericActivity;
import org.linphone.core.Address;
import org.linphone.core.Call;
import org.linphone.core.Call.State;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.call;
/*
CallVideoFragment.java
@ -19,13 +19,17 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.compatibility.Compatibility;
import org.linphone.compatibility.CompatibilityScaleGestureDetector;
import org.linphone.compatibility.CompatibilityScaleGestureListener;
import org.linphone.core.Call;
import org.linphone.mediastream.Log;
import org.linphone.mediastream.video.AndroidVideoWindowImpl;
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
import android.app.Fragment;
import android.os.Bundle;

View file

@ -35,12 +35,11 @@ import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import org.linphone.ContactAddress;
import org.linphone.ContactSelectView;
import org.linphone.ContactsUpdatedListener;
import org.linphone.LinphoneActivity;
import org.linphone.contacts.ContactAddress;
import org.linphone.ui.ContactSelectView;
import org.linphone.receivers.ContactsUpdatedListener;
import org.linphone.activities.LinphoneActivity;
import org.linphone.R;
import org.linphone.SearchContactsListAdapter;
import java.util.ArrayList;
import java.util.List;

View file

@ -76,15 +76,14 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import org.linphone.ContactsManager;
import org.linphone.ContactsUpdatedListener;
import org.linphone.LinphoneActivity;
import org.linphone.LinphoneContact;
import org.linphone.contacts.ContactsManager;
import org.linphone.receivers.ContactsUpdatedListener;
import org.linphone.activities.LinphoneActivity;
import org.linphone.contacts.LinphoneContact;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneService;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.SearchContactsListAdapter;
import org.linphone.compatibility.Compatibility;
import org.linphone.core.Address;
import org.linphone.core.Buffer;
@ -115,7 +114,7 @@ import java.util.Locale;
import java.util.regex.Pattern;
import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION;
import static org.linphone.FragmentsAvailable.CHAT;
import static org.linphone.fragments.FragmentsAvailable.CHAT;
interface ChatUpdatedListener {
void onChatUpdated();

View file

@ -43,11 +43,11 @@ import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import org.linphone.ContactsManager;
import org.linphone.ContactsUpdatedListener;
import org.linphone.FragmentsAvailable;
import org.linphone.LinphoneActivity;
import org.linphone.LinphoneContact;
import org.linphone.contacts.ContactsManager;
import org.linphone.receivers.ContactsUpdatedListener;
import org.linphone.fragments.FragmentsAvailable;
import org.linphone.activities.LinphoneActivity;
import org.linphone.contacts.LinphoneContact;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneUtils;
import org.linphone.R;
@ -60,7 +60,7 @@ import org.linphone.core.CoreListenerStub;
import java.util.List;
import static org.linphone.FragmentsAvailable.CHAT_LIST;
import static org.linphone.fragments.FragmentsAvailable.CHAT_LIST;
public class ChatListFragment extends Fragment implements OnClickListener, OnItemClickListener, ContactsUpdatedListener, ChatUpdatedListener {
private LayoutInflater mInflater;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.chat;
import android.app.Fragment;
import android.os.Bundle;
@ -6,6 +6,8 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import org.linphone.R;
/*
GroupChatFragment.java
Copyright (C) 2017 Belledonne Communications, Grenoble, France

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.chat;
/*
InfoGroupChatFragment.java
@ -25,6 +25,8 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import org.linphone.R;
public class InfoGroupChatFragment extends Fragment implements View.OnClickListener {
private LayoutInflater mInflater;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.chat;
/*
SearchContactsListAdapter.java
@ -28,16 +28,17 @@ import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import org.linphone.contacts.ContactAddress;
import org.linphone.contacts.ContactsManager;
import org.linphone.contacts.LinphoneContact;
import org.linphone.LinphoneManager;
import org.linphone.R;
import org.linphone.core.Address;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
/**
* Created by Erwan Croze.
*/
public class SearchContactsListAdapter extends BaseAdapter {
private class ViewHolder {

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.contacts;
/*
ContactAddress.java

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.contacts;
/*
ContactDetailsFragment.java
@ -19,7 +19,12 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.LinphoneManager;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.ProxyConfig;
import org.linphone.fragments.FragmentsAvailable;
import android.annotation.SuppressLint;
import android.app.Dialog;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.contacts;
/*
ContactEditorFragment.java
@ -48,6 +48,10 @@ import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.mediastream.Log;
import org.linphone.mediastream.Version;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.contacts;
/*
ContactsListFragment.java
@ -44,14 +44,19 @@ import android.widget.ProgressBar;
import android.widget.SectionIndexer;
import android.widget.TextView;
import org.linphone.fragments.FragmentsAvailable;
import org.linphone.receivers.ContactsUpdatedListener;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import static org.linphone.FragmentsAvailable.CONTACTS_LIST;
public class ContactsListFragment extends Fragment implements OnClickListener, OnItemClickListener, ContactsUpdatedListener {
private LayoutInflater mInflater;
private ListView contactsList;
@ -419,7 +424,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
@Override
public void onContactsUpdated() {
if (!LinphoneActivity.isInstanciated() || LinphoneActivity.instance().getCurrentFragment() != CONTACTS_LIST)
if (!LinphoneActivity.isInstanciated() || LinphoneActivity.instance().getCurrentFragment() != FragmentsAvailable.CONTACTS_LIST)
return;
ContactsListAdapter adapter = (ContactsListAdapter)contactsList.getAdapter();
if (adapter != null) {

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.contacts;
/*
ContactsManager.java
@ -36,12 +36,17 @@ import android.provider.ContactsContract;
import android.provider.ContactsContract.CommonDataKinds;
import android.provider.ContactsContract.Data;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.R;
import org.linphone.core.Address;
import org.linphone.core.Core;
import org.linphone.core.Friend;
import org.linphone.core.FriendList;
import org.linphone.core.ProxyConfig;
import org.linphone.mediastream.Log;
import org.linphone.receivers.ContactsUpdatedListener;
import java.util.ArrayList;
import java.util.Collections;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.contacts;
/*
LinphoneContact.java
@ -25,9 +25,10 @@ import java.util.Collections;
import java.util.List;
import java.util.Locale;
import org.linphone.LinphoneManager;
import org.linphone.R;
import org.linphone.core.Address;
import org.linphone.core.Core;
import org.linphone.core.CoreException;
import org.linphone.core.Friend;
import org.linphone.core.Friend.SubscribePolicy;
import org.linphone.core.FriendList;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.contacts;
/*
LinphoneNumberOrAddress.java

View file

@ -23,7 +23,7 @@ import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.FirebaseInstanceIdService;
import org.linphone.LinphonePreferences;
import org.linphone.UIThreadDispatcher;
import org.linphone.LinphoneUtils;
public class FirebaseIdService extends FirebaseInstanceIdService {
@ -38,7 +38,7 @@ public class FirebaseIdService extends FirebaseInstanceIdService {
private void sendRegistrationToServer(final String refreshedToken) {
android.util.Log.i("FirebaseIdService", "[Push Notification] Send token to server: " + refreshedToken);
UIThreadDispatcher.dispatch(new Runnable() {
LinphoneUtils.dispatchOnUIThread(new Runnable() {
@Override
public void run() {
LinphonePreferences.instance().setPushNotificationRegistrationID(refreshedToken);

View file

@ -26,9 +26,9 @@ import com.google.firebase.messaging.RemoteMessage;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneService;
import org.linphone.UIThreadDispatcher;
import static android.content.Intent.ACTION_MAIN;
import org.linphone.LinphoneUtils;
import static android.content.Intent.ACTION_MAIN;
public class FirebaseMessaging extends FirebaseMessagingService {
public FirebaseMessaging() {
@ -41,7 +41,7 @@ public class FirebaseMessaging extends FirebaseMessagingService {
if (!LinphoneService.isReady()) {
startService(new Intent(ACTION_MAIN).setClass(this, LinphoneService.class));
} else if (LinphoneManager.isInstanciated() && LinphoneManager.getLc().getCallsNb() == 0) {
UIThreadDispatcher.dispatch(new Runnable(){
LinphoneUtils.dispatchOnUIThread(new Runnable(){
@Override
public void run() {
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc().getCallsNb() == 0){

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.fragments;
/*
AboutFragment.java
Copyright (C) 2017 Belledonne Communications, Grenoble, France
@ -18,6 +18,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.Core;
import org.linphone.core.Core.LogCollectionUploadState;
import org.linphone.core.CoreListenerStub;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.fragments;
/*
AccountPreferencesFragment.java
Copyright (C) 2017 Belledonne Communications, Grenoble, France
@ -21,12 +21,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import java.util.ArrayList;
import java.util.List;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphonePreferences.AccountBuilder;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.assistant.AssistantActivity;
import org.linphone.core.AccountCreator;
import org.linphone.core.AccountCreatorListener;
import org.linphone.core.CoreException;
import org.linphone.core.Factory;
import org.linphone.core.NatPolicy;
import org.linphone.core.ProxyConfig;
import org.linphone.mediastream.Log;
@ -36,8 +40,6 @@ import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
@ -47,11 +49,9 @@ import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceCategory;
import android.preference.PreferenceScreen;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.EditText;
public class AccountPreferencesFragment extends PreferencesListFragment implements AccountCreatorListener {

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.fragments;
/*
DialerFragment.java
@ -31,6 +31,11 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import org.linphone.contacts.ContactsManager;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneService;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.Core;
import org.linphone.mediastream.Log;
import org.linphone.ui.AddressAware;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.fragments;
/*
EmptyFragment.java
@ -25,6 +25,8 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import org.linphone.R;
public class EmptyFragment extends Fragment {
@Override

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.fragments;
/*
FragmentsAvailable.java

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.fragments;
/*
HistoryDetailFragment.java
@ -29,10 +29,13 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import org.linphone.contacts.ContactsManager;
import org.linphone.contacts.LinphoneContact;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.Address;
import org.linphone.core.CoreException;
import org.linphone.core.Factory;
import org.linphone.mediastream.Log;
public class HistoryDetailFragment extends Fragment implements OnClickListener {
private ImageView dialBack, chat, addToContacts, goToContact, back;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.fragments;
/*
HistoryListFragment.java
@ -25,8 +25,14 @@ import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import org.linphone.contacts.ContactsManager;
import org.linphone.receivers.ContactsUpdatedListener;
import org.linphone.contacts.LinphoneContact;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.Call;
import org.linphone.core.Call.Dir;
import org.linphone.core.Address;
import org.linphone.core.CallLog;
import org.linphone.core.CallLog.CallStatus;
@ -53,8 +59,6 @@ import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import static org.linphone.FragmentsAvailable.HISTORY_LIST;
public class HistoryListFragment extends Fragment implements OnClickListener, OnItemClickListener, ContactsUpdatedListener {
private ListView historyList;
private LayoutInflater mInflater;
@ -224,7 +228,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
@Override
public void onContactsUpdated() {
if (!LinphoneActivity.isInstanciated() || LinphoneActivity.instance().getCurrentFragment() != HISTORY_LIST)
if (!LinphoneActivity.isInstanciated() || LinphoneActivity.instance().getCurrentFragment() != FragmentsAvailable.HISTORY_LIST)
return;
CallHistoryAdapter adapter = (CallHistoryAdapter)historyList.getAdapter();
if (adapter != null) {

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.fragments;
/*
SettingsFragment.java
@ -23,6 +23,12 @@ import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.Address;
import org.linphone.core.Core;
import org.linphone.core.Core.EcCalibratorStatus;
@ -50,8 +56,6 @@ import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.media.AudioManager;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.CheckBoxPreference;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.fragments;
/*
StatusFragment.java
Copyright (C) 2017 Belledonne Communications, Grenoble, France
@ -17,8 +17,12 @@ 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.call.CallActivity;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneService;
import org.linphone.R;
import org.linphone.activities.LinphoneActivity;
import org.linphone.assistant.AssistantActivity;
import org.linphone.core.Call.Dir;
import org.linphone.core.Call;
import org.linphone.core.Content;
import org.linphone.core.Core;

View file

@ -23,9 +23,10 @@ import static android.content.Intent.ACTION_MAIN;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.LinphoneUtils;
import org.linphone.R;
import org.linphone.UIThreadDispatcher;
import org.linphone.core.Factory;
import org.linphone.core.LogCollectionState;
import org.linphone.mediastream.Log;
import android.content.Context;
@ -43,7 +44,7 @@ public class GCMService extends GCMBaseIntentService {
private void initLogger(Context context) {
LinphonePreferences.instance().setContext(context);
boolean isDebugEnabled = LinphonePreferences.instance().isDebugEnabled();
Factory.instance().enableLogCollection(isDebugEnabled);
Factory.instance().enableLogCollection(isDebugEnabled ? LogCollectionState.Enabled : LogCollectionState.Disabled);
Factory.instance().setDebugMode(isDebugEnabled, context.getString(R.string.app_name));
}
@ -61,7 +62,7 @@ public class GCMService extends GCMBaseIntentService {
if (!LinphoneService.isReady()) {
context.startService(new Intent(ACTION_MAIN).setClass(context, LinphoneService.class));
} else if (LinphoneManager.isInstanciated() && LinphoneManager.getLc().getCallsNb() == 0) {
UIThreadDispatcher.dispatch(new Runnable(){
LinphoneUtils.dispatchOnUIThread(new Runnable(){
@Override
public void run() {
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc().getCallsNb() == 0){
@ -77,7 +78,7 @@ public class GCMService extends GCMBaseIntentService {
protected void onRegistered(Context context, final String regId) {
initLogger(context);
Log.d("[Push Notification] Registered: " + regId);
UIThreadDispatcher.dispatch(new Runnable(){
LinphoneUtils.dispatchOnUIThread(new Runnable(){
@Override
public void run() {
LinphonePreferences.instance().setPushNotificationRegistrationID(regId);
@ -90,7 +91,7 @@ public class GCMService extends GCMBaseIntentService {
initLogger(context);
Log.w("[Push Notification] Unregistered: " + regId);
UIThreadDispatcher.dispatch(new Runnable(){
LinphoneUtils.dispatchOnUIThread(new Runnable(){
@Override
public void run() {
LinphonePreferences.instance().setPushNotificationRegistrationID(null);

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.receivers;
/*
AccountEnableReceiver.java
@ -24,6 +24,8 @@ import android.content.Context;
import android.content.Intent;
import android.util.Log;
import org.linphone.LinphonePreferences;
public class AccountEnableReceiver extends BroadcastReceiver {
private static final String TAG = "AccountEnableReceiver";
private static final String FIELD_ID = "id";

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.receivers;
/*
BluetoothManager.java
Copyright (C) 2017 Belledonne Communications, Grenoble, France
@ -20,6 +20,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import java.util.List;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneService;
import org.linphone.call.CallActivity;
import org.linphone.mediastream.Log;
import android.annotation.TargetApi;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.receivers;
/*
BootReceiver.java
@ -19,6 +19,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.core.Factory;
import org.linphone.core.Config;
import org.linphone.mediastream.Log;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.receivers;
/*
ContactsUpdatedListener.java

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.receivers;
/*
DozeReceiver.java
@ -19,6 +19,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.R;
import org.linphone.core.Core;
import org.linphone.core.Factory;
import org.linphone.core.LogCollectionState;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.receivers;
/*
HookReceiver.java
@ -24,6 +24,7 @@ import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import org.linphone.LinphoneManager;
import org.linphone.mediastream.Log;
public class HookReceiver extends BroadcastReceiver {

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.receivers;
/*
KeepAliveReceiver.java
@ -19,6 +19,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.R;
import org.linphone.compatibility.Compatibility;
import org.linphone.core.Core;
import org.linphone.core.Factory;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.receivers;
/*
ContactPickerActivity.java
@ -24,6 +24,8 @@ import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import org.linphone.LinphoneManager;
/**
*
* Intercept network state changes and update linphone core through LinphoneManager.

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.receivers;
/*
OutgoingCallReceiver.java
@ -24,6 +24,8 @@ import android.content.Context;
import android.content.Intent;
import android.util.Log;
import org.linphone.LinphonePreferences;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.receivers;
/*
PhoneStateReceiver.java
@ -24,6 +24,8 @@ import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
import org.linphone.LinphoneManager;
/**
* Pause current SIP calls when GSM phone rings or is active.
*/

View file

@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.DialerFragment;
import org.linphone.fragments.DialerFragment;
import org.linphone.LinphoneManager.AddressType;
import org.linphone.R;

View file

@ -1,4 +1,4 @@
package org.linphone;
package org.linphone.ui;
/*
ContactSelectView.java
@ -25,6 +25,10 @@ import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import org.linphone.contacts.ContactAddress;
import org.linphone.LinphoneManager;
import org.linphone.R;
public class ContactSelectView extends View {
private TextView contactName;
private ImageView deleteContact;

View file

@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.CallActivity;
import org.linphone.call.CallActivity;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;

View file

@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.LinphoneActivity;
import org.linphone.activities.LinphoneActivity;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneService;
import org.linphone.core.Call;

View file

@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import junit.framework.Assert;
import org.linphone.activities.LinphoneActivity;
import org.linphone.assistant.AssistantActivity;
import org.linphone.core.LinphoneNatPolicy;
import org.linphone.core.LinphoneProxyConfig;

View file

@ -21,11 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import junit.framework.Assert;
import org.linphone.FragmentsAvailable;
import org.linphone.LinphoneActivity;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.LinphoneProxyConfig;
import org.linphone.fragments.FragmentsAvailable;
import android.test.suitebuilder.annotation.LargeTest;

View file

@ -21,6 +21,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import junit.framework.Assert;
import org.linphone.call.CallActivity;
import org.linphone.call.CallIncomingActivity;
import org.linphone.call.CallOutgoingActivity;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCoreException;
@ -34,8 +38,6 @@ import android.view.View;
import android.widget.ImageView;
import static android.test.TouchUtils.dragViewToX;
import static android.view.Gravity.CENTER_HORIZONTAL;
import static android.view.Gravity.CENTER_VERTICAL;
public class CallsAudio extends SampleTest {

View file

@ -21,13 +21,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import junit.framework.Assert;
import org.linphone.CallActivity;
import org.linphone.CallIncomingActivity;
import org.linphone.CallOutgoingActivity;
import org.linphone.LinphoneActivity;
import org.linphone.LinphoneManager;
import org.linphone.call.CallActivity;
import org.linphone.call.CallIncomingActivity;
import org.linphone.call.CallOutgoingActivity;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.LinphoneCall;
import org.linphone.mediastream.Log;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCoreException;
import org.linphone.core.PayloadType;
@ -35,13 +33,9 @@ import org.linphone.core.PayloadType;
import android.test.suitebuilder.annotation.SmallTest;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import static android.test.TouchUtils.dragViewToX;
import static android.view.Gravity.CENTER_HORIZONTAL;
import static android.view.Gravity.CENTER_VERTICAL;
public class CallsVideo extends SampleTest {

View file

@ -21,11 +21,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import junit.framework.Assert;
import org.linphone.LinphoneActivity;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.LinphoneChatMessage;
import org.linphone.core.LinphoneChatMessage.State;
import org.linphone.core.LinphoneChatRoom;
import org.linphone.mediastream.Log;
import com.robotium.solo.Solo;
@ -33,7 +32,6 @@ import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
import android.widget.EditText;
import android.widget.AutoCompleteTextView;
public class Chat extends SampleTest {

View file

@ -22,6 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import junit.framework.Assert;
import org.linphone.call.CallActivity;
import org.linphone.call.CallIncomingActivity;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCoreException;
import org.linphone.mediastream.Log;

View file

@ -26,6 +26,8 @@ import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
import org.linphone.activities.LinphoneActivity;
public class Contacts extends SampleTest {
@MediumTest

View file

@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import junit.framework.Assert;
import org.linphone.CallActivity;
import org.linphone.LinphoneActivity;
import org.linphone.call.CallActivity;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.LinphoneCall;
import android.test.suitebuilder.annotation.LargeTest;

View file

@ -133,11 +133,7 @@ public class LinphoneTestManager implements LinphoneCoreListener{
t.tcp = -1;
mLc.setSignalingTransportPorts(t);
try {
initFromConf(mLc);
} catch (LinphoneException e) {
Log.w("no config ready yet");
}
TimerTask lTask = new TimerTask() {
@Override
@ -170,7 +166,7 @@ public class LinphoneTestManager implements LinphoneCoreListener{
LinphoneManager.getLc().setVideoDevice(camId);
}
public void initFromConf(LinphoneCore mLc) throws LinphoneConfigException, LinphoneCoreException {
public void initFromConf(LinphoneCore mLc) {
LinphoneCoreFactory.instance().setDebugMode(true, "LinphoneTester");
initAccounts(mLc);

View file

@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import org.linphone.activities.LinphoneLauncherActivity;
import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCore;

View file

@ -21,9 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import junit.framework.Assert;
import org.linphone.CallActivity;
import org.linphone.LinphoneActivity;
import org.linphone.LinphoneManager;
import org.linphone.call.CallActivity;
import org.linphone.activities.LinphoneActivity;
import org.linphone.core.LinphoneCall;
import org.linphone.mediastream.Log;