Reworks Java code in order to support the new generated Liblinphone's API
This commit is contained in:
parent
b13a4aa0ee
commit
501c2b118b
23 changed files with 129 additions and 112 deletions
|
@ -93,12 +93,12 @@ import org.linphone.core.ChatRoom;
|
|||
import org.linphone.core.ChatRoomCapabilities;
|
||||
import org.linphone.core.Content;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Core.AuthMethod;
|
||||
import org.linphone.core.Core.EcCalibratorStatus;
|
||||
import org.linphone.core.Core.GlobalState;
|
||||
import org.linphone.core.AuthMethod;
|
||||
import org.linphone.core.EcCalibratorStatus;
|
||||
import org.linphone.core.GlobalState;
|
||||
import org.linphone.core.Core.LogCollectionUploadState;
|
||||
import org.linphone.core.Core.RegistrationState;
|
||||
import org.linphone.core.Core.ConfiguringState;
|
||||
import org.linphone.core.RegistrationState;
|
||||
import org.linphone.core.ConfiguringState;
|
||||
import org.linphone.core.CoreException;
|
||||
import org.linphone.core.ErrorInfo;
|
||||
import org.linphone.core.Factory;
|
||||
|
@ -109,6 +109,7 @@ import org.linphone.core.FriendList;
|
|||
import org.linphone.core.InfoMessage;
|
||||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.PublishState;
|
||||
import org.linphone.core.tools.OpenH264DownloadHelperListener;
|
||||
import org.linphone.core.PayloadType;
|
||||
import org.linphone.core.PresenceBasicStatus;
|
||||
|
@ -116,6 +117,7 @@ import org.linphone.core.PresenceModel;
|
|||
import org.linphone.core.Reason;
|
||||
import org.linphone.core.SubscriptionState;
|
||||
//import org.linphone.core.TunnelConfig;
|
||||
import org.linphone.core.VersionUpdateCheckResult;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.mediastream.Version;
|
||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||
|
@ -1097,7 +1099,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
|||
|
||||
public void onGlobalStateChanged(final Core lc, final GlobalState state, final String message) {
|
||||
Log.i("New global state [",state,"]");
|
||||
if (state == Core.GlobalState.On){
|
||||
if (state == GlobalState.On){
|
||||
try {
|
||||
Log.e("LinphoneManager"," onGlobalStateChanged ON");
|
||||
initLiblinphone(lc);
|
||||
|
@ -1585,7 +1587,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
|||
if (content!=null) Log.d("with content "+content.getType()+"/"+content.getSubtype()+" data:"+content.getStringBuffer());
|
||||
}
|
||||
@Override
|
||||
public void onPublishStateChanged(Core lc, Event ev, Event.PublishState state) {
|
||||
public void onPublishStateChanged(Core lc, Event ev, PublishState state) {
|
||||
Log.d("Publish state changed to " + state + " for event name " + ev.getName());
|
||||
}
|
||||
|
||||
|
@ -1627,7 +1629,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onVersionUpdateCheckResultReceived(Core lc, Core.VersionUpdateCheckResult result, String version, String url) {
|
||||
public void onVersionUpdateCheckResultReceived(Core lc, VersionUpdateCheckResult result, String version, String url) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -25,11 +25,12 @@ import android.content.pm.PackageManager;
|
|||
|
||||
import org.linphone.core.AVPFMode;
|
||||
import org.linphone.core.Address;
|
||||
import org.linphone.core.Address.TransportType;
|
||||
import org.linphone.core.TransportType;
|
||||
import org.linphone.core.AuthInfo;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Core.LimeState;
|
||||
import org.linphone.core.Core.MediaEncryption;
|
||||
import org.linphone.core.LimeState;
|
||||
import org.linphone.core.MediaEncryption;
|
||||
import org.linphone.core.LogCollectionState;
|
||||
import org.linphone.core.Transports;
|
||||
import org.linphone.core.CoreException;
|
||||
import org.linphone.core.Factory;
|
||||
|
@ -1188,7 +1189,7 @@ public class LinphonePreferences {
|
|||
// Advanced settings
|
||||
public void setDebugEnabled(boolean enabled) {
|
||||
getConfig().setBool("app", "debug", enabled);
|
||||
Factory.instance().enableLogCollection(Core.LogCollectionState.Enabled);
|
||||
Factory.instance().enableLogCollection(LogCollectionState.Enabled);
|
||||
Factory.instance().setDebugMode(enabled, getString(R.string.app_name));
|
||||
}
|
||||
|
||||
|
|
|
@ -30,11 +30,12 @@ import org.linphone.contacts.LinphoneContact;
|
|||
import org.linphone.core.Address;
|
||||
import org.linphone.core.Call;
|
||||
import org.linphone.core.Call.State;
|
||||
import org.linphone.core.CallLog.CallStatus;
|
||||
import org.linphone.core.Call.Status;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Core.GlobalState;
|
||||
import org.linphone.core.Core.RegistrationState;
|
||||
import org.linphone.core.GlobalState;
|
||||
import org.linphone.core.RegistrationState;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.LogCollectionState;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
@ -298,7 +299,7 @@ public final class LinphoneService extends Service {
|
|||
LinphonePreferences.instance().setContext(getBaseContext());
|
||||
Factory.instance().setLogCollectionPath(getFilesDir().getAbsolutePath());
|
||||
boolean isDebugEnabled = LinphonePreferences.instance().isDebugEnabled();
|
||||
Factory.instance().enableLogCollection(Core.LogCollectionState.Enabled);
|
||||
Factory.instance().enableLogCollection(LogCollectionState.Enabled);
|
||||
Factory.instance().setDebugMode(isDebugEnabled, getString(R.string.app_name));
|
||||
|
||||
// Dump some debugging information to the logs
|
||||
|
@ -360,7 +361,7 @@ public final class LinphoneService extends Service {
|
|||
destroyOverlay();
|
||||
}
|
||||
|
||||
if (state == State.End && call.getCallLog().getStatus() == CallStatus.Missed) {
|
||||
if (state == State.End && call.getCallLog().getStatus() == Call.Status.Missed) {
|
||||
int missedCallCount = LinphoneManager.getLcIfManagerNotDestroyedOrNull().getMissedCallsCount();
|
||||
String body;
|
||||
if (missedCallCount > 1) {
|
||||
|
@ -397,14 +398,14 @@ public final class LinphoneService extends Service {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onGlobalStateChanged(Core lc,Core.GlobalState state, String message) {
|
||||
public void onGlobalStateChanged(Core lc,GlobalState state, String message) {
|
||||
if (!mDisableRegistrationStatus && state == GlobalState.On && displayServiceNotification()) {
|
||||
sendNotification(IC_LEVEL_ORANGE, R.string.notification_started);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistrationStateChanged(Core lc, ProxyConfig cfg, Core.RegistrationState state, String smessage) {
|
||||
public void onRegistrationStateChanged(Core lc, ProxyConfig cfg, RegistrationState state, String smessage) {
|
||||
// if (instance == null) {
|
||||
// Log.i("Service not ready, discarding registration state change to ",state.toString());
|
||||
// return;
|
||||
|
|
|
@ -99,11 +99,11 @@ import org.linphone.core.AuthInfo;
|
|||
import org.linphone.core.Call;
|
||||
import org.linphone.core.Call.State;
|
||||
import org.linphone.core.CallLog;
|
||||
import org.linphone.core.CallLog.CallStatus;
|
||||
import org.linphone.core.Call.Status;
|
||||
import org.linphone.core.ChatMessage;
|
||||
import org.linphone.core.ChatRoom;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Core.RegistrationState;
|
||||
import org.linphone.core.RegistrationState;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
|
@ -242,7 +242,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onRegistrationStateChanged(Core lc, ProxyConfig proxy, Core.RegistrationState state, String smessage) {
|
||||
public void onRegistrationStateChanged(Core lc, ProxyConfig proxy, RegistrationState state, String smessage) {
|
||||
AuthInfo authInfo = lc.findAuthInfo(proxy.getRealm(), proxy.getIdentityAddress().getUsername(), proxy.getDomain());
|
||||
if (state.equals(RegistrationState.Cleared)) {
|
||||
if (lc != null) {
|
||||
|
@ -582,7 +582,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
|||
if (log.getDir() == Call.Dir.Outgoing) {
|
||||
status = getString(R.string.outgoing);
|
||||
} else {
|
||||
if (log.getStatus() == CallStatus.Missed) {
|
||||
if (log.getStatus() == Call.Status.Missed) {
|
||||
status = getString(R.string.missed);
|
||||
} else {
|
||||
status = getString(R.string.incoming);
|
||||
|
@ -603,7 +603,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
|||
extras.putString("DisplayName", displayName);
|
||||
extras.putString("PictureUri", pictureUri);
|
||||
}
|
||||
extras.putString("CallStatus", status);
|
||||
extras.putString("Call.Status", status);
|
||||
extras.putString("CallTime", callTime);
|
||||
extras.putString("CallDate", callDate);
|
||||
|
||||
|
@ -1660,7 +1660,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
|||
});
|
||||
}
|
||||
|
||||
private int getStatusIconResource(Core.RegistrationState state) {
|
||||
private int getStatusIconResource(RegistrationState state) {
|
||||
try {
|
||||
if (state == RegistrationState.Ok) {
|
||||
return R.drawable.led_connected;
|
||||
|
|
|
@ -36,10 +36,11 @@ import org.linphone.core.AccountCreatorListener;
|
|||
import org.linphone.core.DialPlan;
|
||||
import org.linphone.core.AccountCreator;
|
||||
import org.linphone.core.Address;
|
||||
import org.linphone.core.Address.TransportType;
|
||||
import org.linphone.core.TransportType;
|
||||
import org.linphone.core.AuthInfo;
|
||||
import org.linphone.core.ConfiguringState;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Core.RegistrationState;
|
||||
import org.linphone.core.RegistrationState;
|
||||
import org.linphone.core.CoreException;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
|
@ -148,11 +149,11 @@ private static AssistantActivity instance;
|
|||
mListener = new CoreListenerStub() {
|
||||
|
||||
@Override
|
||||
public void onConfiguringStatus(Core lc, final Core.ConfiguringState state, String message) {
|
||||
public void onConfiguringStatus(Core lc, final ConfiguringState state, String message) {
|
||||
if (progress != null) progress.dismiss();
|
||||
if (state == Core.ConfiguringState.Successful) {
|
||||
if (state == ConfiguringState.Successful) {
|
||||
goToLinphoneActivity();
|
||||
} else if (state == Core.ConfiguringState.Failed) {
|
||||
} else if (state == ConfiguringState.Failed) {
|
||||
Toast.makeText(AssistantActivity.instance(), getString(R.string.remote_provisioning_failure), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,9 +23,10 @@ import org.linphone.LinphoneManager;
|
|||
import org.linphone.LinphonePreferences;
|
||||
import org.linphone.R;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Core.EcCalibratorStatus;
|
||||
import org.linphone.core.EcCalibratorStatus;
|
||||
import org.linphone.core.CoreException;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.core.XmlRpcArgType;
|
||||
import org.linphone.core.XmlRpcRequest;
|
||||
import org.linphone.core.XmlRpcRequestListener;
|
||||
//import org.linphone.core.XmlRpcRequestImpl;
|
||||
|
@ -56,7 +57,7 @@ public class EchoCancellerCalibrationFragment extends Fragment implements XmlRpc
|
|||
|
||||
mListener = new CoreListenerStub(){
|
||||
@Override
|
||||
public void onEcCalibrationResult(Core lc, Core.EcCalibratorStatus status, int delay_ms) {
|
||||
public void onEcCalibrationResult(Core lc, EcCalibratorStatus status, int delay_ms) {
|
||||
lc.removeListener(mListener);
|
||||
LinphoneManager.getInstance().routeAudioToReceiver();
|
||||
if (mSendEcCalibrationResult) {
|
||||
|
@ -73,7 +74,7 @@ public class EchoCancellerCalibrationFragment extends Fragment implements XmlRpc
|
|||
};
|
||||
|
||||
xmlRpcSession = LinphoneManager.getLcIfManagerNotDestroyedOrNull().createXmlRpcSession(LinphonePreferences.instance().getXmlrpcUrl());
|
||||
xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.None, "add_ec_calibration_result");
|
||||
xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.None, "add_ec_calibration_result");
|
||||
xmlRpcRequest.setListener(this);
|
||||
|
||||
try {
|
||||
|
|
|
@ -18,7 +18,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.R;
|
||||
import org.linphone.core.Address.TransportType;
|
||||
import org.linphone.core.TransportType;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.os.Bundle;
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.linphone.LinphonePreferences;
|
|||
import org.linphone.LinphoneService;
|
||||
import org.linphone.R;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Core.ConfiguringState;
|
||||
import org.linphone.core.ConfiguringState;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.LinphonePreferences;
|
||||
import org.linphone.R;
|
||||
import org.linphone.core.ConfiguringState;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.xmlrpc.XmlRpcHelper;
|
||||
|
@ -59,10 +60,10 @@ public class RemoteProvisioningLoginActivity extends Activity implements OnClick
|
|||
|
||||
mListener = new CoreListenerStub(){
|
||||
@Override
|
||||
public void onConfiguringStatus(Core lc, final Core.ConfiguringState state, String message) {
|
||||
if (state == Core.ConfiguringState.Successful) {
|
||||
public void onConfiguringStatus(Core lc, final ConfiguringState state, String message) {
|
||||
if (state == ConfiguringState.Successful) {
|
||||
//TODO
|
||||
} else if (state == Core.ConfiguringState.Failed) {
|
||||
} else if (state == ConfiguringState.Failed) {
|
||||
Toast.makeText(RemoteProvisioningLoginActivity.this, R.string.remote_provisioning_failure, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,13 +74,15 @@ import org.linphone.core.Call;
|
|||
import org.linphone.core.Call.State;
|
||||
import org.linphone.core.CallParams;
|
||||
import org.linphone.core.CallStats;
|
||||
import org.linphone.core.CallStats.AddressFamily;
|
||||
import org.linphone.core.AddressFamily;
|
||||
import org.linphone.core.ChatMessage;
|
||||
import org.linphone.core.ChatRoom;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.core.MediaEncryption;
|
||||
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;
|
||||
|
@ -248,7 +250,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
|||
@Override
|
||||
public void onCallEncryptionChanged(Core lc, final Call call, boolean encrypted, String authenticationToken) {
|
||||
if (status != null) {
|
||||
if(call.getCurrentParams().getMediaEncryption().equals(Core.MediaEncryption.ZRTP) && !call.getAuthenticationTokenVerified()){
|
||||
if(call.getCurrentParams().getMediaEncryption().equals(MediaEncryption.ZRTP) && !call.getAuthenticationTokenVerified()){
|
||||
status.showZRTPDialog(call);
|
||||
}
|
||||
status.refreshStatusItems(call, call.getCurrentParams().videoEnabled());
|
||||
|
@ -1732,11 +1734,11 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
|||
if (LinphoneActivity.isInstanciated()) {
|
||||
CallParams params = call.getCurrentParams();
|
||||
if (params != null) {
|
||||
CallStats audioStats = call.getStats(CallStats.StreamType.Audio);
|
||||
CallStats audioStats = call.getStats(StreamType.Audio);
|
||||
CallStats videoStats = null;
|
||||
|
||||
if (params.videoEnabled())
|
||||
videoStats = call.getStats(CallStats.StreamType.Video);
|
||||
videoStats = call.getStats(StreamType.Video);
|
||||
|
||||
PayloadType payloadAudio = params.getUsedAudioPayloadType();
|
||||
PayloadType payloadVideo = params.getUsedVideoPayloadType();
|
||||
|
|
|
@ -59,6 +59,7 @@ import org.linphone.core.ChatMessageListener;
|
|||
import org.linphone.core.Content;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.EventLog;
|
||||
import org.linphone.core.LimeState;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.ui.ListSelectionAdapter;
|
||||
import org.linphone.ui.ListSelectionHelper;
|
||||
|
@ -175,7 +176,7 @@ public class ChatEventsAdapter extends ListSelectionAdapter implements ChatMessa
|
|||
holder.messageSendingInProgress.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!message.isSecured() && LinphoneManager.getLc().limeEnabled() == Core.LimeState.Mandatory && status != ChatMessage.State.InProgress) {
|
||||
if (!message.isSecured() && LinphoneManager.getLc().limeEnabled() == LimeState.Mandatory && status != ChatMessage.State.InProgress) {
|
||||
holder.messageStatus.setVisibility(View.VISIBLE);
|
||||
holder.messageStatus.setImageResource(R.drawable.chat_unsecure);
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ import org.linphone.core.Content;
|
|||
import org.linphone.core.Core;
|
||||
import org.linphone.core.EventLog;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.LimeState;
|
||||
import org.linphone.core.Participant;
|
||||
import org.linphone.contacts.ContactsUpdatedListener;
|
||||
import org.linphone.core.Reason;
|
||||
|
@ -590,7 +591,7 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
|
|||
from.getUsername(), null, getString(R.string.message_cant_be_decrypted_notif));
|
||||
}
|
||||
}
|
||||
} else if (LinphoneManager.getLc().limeEnabled() == Core.LimeState.Mandatory) {
|
||||
} else if (LinphoneManager.getLc().limeEnabled() == LimeState.Mandatory) {
|
||||
final Dialog dialog = LinphoneActivity.instance().displayDialog(
|
||||
getString(R.string.message_cant_be_decrypted)
|
||||
.replace("%s", (contact != null) ? contact.getFullName() : from.getUsername()));
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.linphone.R;
|
|||
import org.linphone.core.Address;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Friend;
|
||||
import org.linphone.core.Friend.SubscribePolicy;
|
||||
import org.linphone.core.SubscribePolicy;
|
||||
import org.linphone.core.FriendList;
|
||||
import org.linphone.core.PresenceBasicStatus;
|
||||
import org.linphone.core.PresenceModel;
|
||||
|
|
|
@ -58,7 +58,7 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
|||
sipUri = getArguments().getString("SipUri");
|
||||
displayName = getArguments().getString("DisplayName");
|
||||
pictureUri = getArguments().getString("PictureUri");
|
||||
String status = getArguments().getString("CallStatus");
|
||||
String status = getArguments().getString("Call.Status");
|
||||
String callTime = getArguments().getString("CallTime");
|
||||
String callDate = getArguments().getString("CallDate");
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.linphone.activities.LinphoneActivity;
|
|||
import org.linphone.core.Call;
|
||||
import org.linphone.core.Address;
|
||||
import org.linphone.core.CallLog;
|
||||
import org.linphone.core.CallLog.CallStatus;
|
||||
import org.linphone.core.Call.Status;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
|
@ -174,7 +174,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
if (onlyDisplayMissedCalls) {
|
||||
List<CallLog> missedCalls = new ArrayList<CallLog>();
|
||||
for (CallLog log : mLogs) {
|
||||
if (log.getStatus() == CallStatus.Missed) {
|
||||
if (log.getStatus() == Call.Status.Missed) {
|
||||
missedCalls.add(log);
|
||||
}
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
|
||||
if (log.getDir() == Call.Dir.Incoming) {
|
||||
address = log.getFromAddress();
|
||||
if (log.getStatus() == CallStatus.Missed) {
|
||||
if (log.getStatus() == Call.Status.Missed) {
|
||||
holder.callDirection.setImageResource(R.drawable.call_status_missed);
|
||||
} else {
|
||||
holder.callDirection.setImageResource(R.drawable.call_status_incoming);
|
||||
|
|
|
@ -31,14 +31,15 @@ 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;
|
||||
import org.linphone.core.Core.LimeState;
|
||||
import org.linphone.core.Core.MediaEncryption;
|
||||
import org.linphone.core.EcCalibratorStatus;
|
||||
import org.linphone.core.LimeState;
|
||||
import org.linphone.core.MediaEncryption;
|
||||
import org.linphone.core.CoreException;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
import org.linphone.core.PayloadType;
|
||||
import org.linphone.core.RegistrationState;
|
||||
import org.linphone.core.VideoDefinition;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.mediastream.Version;
|
||||
|
@ -101,7 +102,7 @@ public class SettingsFragment extends PreferencesListFragment {
|
|||
|
||||
mListener = new CoreListenerStub() {
|
||||
@Override
|
||||
public void onEcCalibrationResult(Core lc, Core.EcCalibratorStatus status, int delayMs) {
|
||||
public void onEcCalibrationResult(Core lc, EcCalibratorStatus status, int delayMs) {
|
||||
lc.removeListener(mListener);
|
||||
LinphoneManager.getInstance().routeAudioToReceiver();
|
||||
|
||||
|
@ -377,11 +378,11 @@ public class SettingsFragment extends PreferencesListFragment {
|
|||
for (ProxyConfig lpc : LinphoneManager.getLc().getProxyConfigList()) {
|
||||
Address addr = lpc.getIdentityAddress();
|
||||
if (addr.getUsername().equals(username) && addr.getDomain().equals(domain)) {
|
||||
if (lpc.getState() == Core.RegistrationState.Ok) {
|
||||
if (lpc.getState() == RegistrationState.Ok) {
|
||||
me.setLed(R.drawable.led_connected);
|
||||
} else if (lpc.getState() == Core.RegistrationState.Failed) {
|
||||
} else if (lpc.getState() == RegistrationState.Failed) {
|
||||
me.setLed(R.drawable.led_error);
|
||||
} else if (lpc.getState() == Core.RegistrationState.Progress) {
|
||||
} else if (lpc.getState() == RegistrationState.Progress) {
|
||||
me.setLed(R.drawable.led_inprogress);
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -26,8 +26,8 @@ import org.linphone.assistant.AssistantActivity;
|
|||
import org.linphone.core.Call;
|
||||
import org.linphone.core.Content;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Core.MediaEncryption;
|
||||
import org.linphone.core.Core.RegistrationState;
|
||||
import org.linphone.core.MediaEncryption;
|
||||
import org.linphone.core.RegistrationState;
|
||||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.core.Event;
|
||||
import org.linphone.core.ProxyConfig;
|
||||
|
@ -81,7 +81,7 @@ public class StatusFragment extends Fragment {
|
|||
|
||||
mListener = new CoreListenerStub(){
|
||||
@Override
|
||||
public void onRegistrationStateChanged(final Core lc, final ProxyConfig proxy, final Core.RegistrationState state, String smessage) {
|
||||
public void onRegistrationStateChanged(final Core lc, final ProxyConfig proxy, final RegistrationState state, String smessage) {
|
||||
if (!isAttached || !LinphoneService.isReady()) {
|
||||
return;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ public class StatusFragment extends Fragment {
|
|||
menu.setEnabled(enabled);
|
||||
}
|
||||
|
||||
private int getStatusIconResource(Core.RegistrationState state, boolean isDefaultAccount) {
|
||||
private int getStatusIconResource(RegistrationState state, boolean isDefaultAccount) {
|
||||
try {
|
||||
Core lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||
boolean defaultAccountConnected = (isDefaultAccount && lc != null && lc.getDefaultProxyConfig() != null && lc.getDefaultProxyConfig().getState() == RegistrationState.Ok) || !isDefaultAccount;
|
||||
|
@ -223,7 +223,7 @@ public class StatusFragment extends Fragment {
|
|||
return R.drawable.led_disconnected;
|
||||
}
|
||||
|
||||
private String getStatusIconText(Core.RegistrationState state) {
|
||||
private String getStatusIconText(RegistrationState state) {
|
||||
Context context = getActivity();
|
||||
if (!isAttached && LinphoneActivity.isInstanciated())
|
||||
context = LinphoneActivity.instance();
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.linphone.LinphoneService;
|
|||
import org.linphone.LinphoneUtils;
|
||||
import org.linphone.R;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.Core.LogCollectionState;
|
||||
import org.linphone.core.LogCollectionState;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
import android.content.Context;
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.linphone.LinphoneService;
|
|||
import org.linphone.R;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.LogCollectionState;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
import android.content.Context;
|
||||
|
@ -42,7 +43,7 @@ public class DozeReceiver extends android.content.BroadcastReceiver {
|
|||
if (!LinphoneService.isReady()) return;
|
||||
|
||||
boolean isDebugEnabled = LinphonePreferences.instance().isDebugEnabled();
|
||||
Factory.instance().enableLogCollection(isDebugEnabled ? Core.LogCollectionState.Enabled : Core.LogCollectionState.Disabled);
|
||||
Factory.instance().enableLogCollection(isDebugEnabled ? LogCollectionState.Enabled : LogCollectionState.Disabled);
|
||||
Factory.instance().setDebugMode(isDebugEnabled, context.getString(R.string.app_name));
|
||||
Core lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||
if (lc == null) return;
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.linphone.R;
|
|||
import org.linphone.compatibility.Compatibility;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.LogCollectionState;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
|
@ -45,7 +46,7 @@ public class KeepAliveReceiver extends BroadcastReceiver {
|
|||
return;
|
||||
} else {
|
||||
boolean isDebugEnabled = LinphonePreferences.instance().isDebugEnabled();
|
||||
Factory.instance().enableLogCollection(isDebugEnabled ? Core.LogCollectionState.Enabled : Core.LogCollectionState.Disabled);
|
||||
Factory.instance().enableLogCollection(isDebugEnabled ? LogCollectionState.Enabled : LogCollectionState.Disabled);
|
||||
Factory.instance().setDebugMode(isDebugEnabled, context.getString(R.string.app_name));
|
||||
Core lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||
if (lc == null) return;
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.linphone.LinphoneService;
|
|||
import org.linphone.R;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.Factory;
|
||||
import org.linphone.core.LogCollectionState;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
|
@ -138,7 +139,7 @@ public class Digit extends Button implements AddressAware {
|
|||
public void onClick(DialogInterface dialog, int which) {
|
||||
if(which == 0){
|
||||
LinphonePreferences.instance().setDebugEnabled(false);
|
||||
Factory.instance().enableLogCollection(Core.LogCollectionState.Disabled);
|
||||
Factory.instance().enableLogCollection(LogCollectionState.Disabled);
|
||||
}
|
||||
if(which == 1) {
|
||||
Core lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||
|
@ -154,7 +155,7 @@ public class Digit extends Button implements AddressAware {
|
|||
public void onClick(DialogInterface dialog, int which) {
|
||||
if(which == 0) {
|
||||
LinphonePreferences.instance().setDebugEnabled(true);
|
||||
Factory.instance().enableLogCollection(Core.LogCollectionState.Enabled);
|
||||
Factory.instance().enableLogCollection(LogCollectionState.Enabled);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -21,10 +21,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.LinphonePreferences;
|
||||
import org.linphone.core.XmlRpcArgType;
|
||||
import org.linphone.core.XmlRpcRequest;
|
||||
import org.linphone.core.XmlRpcRequestListener;
|
||||
//import org.linphone.core.XmlRpcRequestImpl;
|
||||
import org.linphone.core.XmlRpcSession;
|
||||
import org.linphone.core.XmlRpcStatus;
|
||||
//import org.linphone.core.XmlRpcSessionImpl;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
||||
|
@ -50,19 +52,19 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void createAccountAsync(final XmlRpcListener listener, String username, String email, String password) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "create_account");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "create_account");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
return;
|
||||
}
|
||||
listener.onAccountCreated(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -75,19 +77,19 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void getAccountExpireAsync(final XmlRpcListener listener, String username, String password) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "get_account_expiration");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "get_account_expiration");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
return;
|
||||
}
|
||||
listener.onAccountExpireFetched(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -99,19 +101,19 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void updateAccountExpireAsync(final XmlRpcListener listener, String username, String password, String domain, String payload, String signature) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "update_expiration_date");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "update_expiration_date");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
return;
|
||||
}
|
||||
listener.onAccountExpireUpdated(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -126,19 +128,19 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void activateAccountAsync(final XmlRpcListener listener, String username, String password) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "activate_account");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "activate_account");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
return;
|
||||
}
|
||||
listener.onAccountActivated(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -150,12 +152,12 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void isAccountActivatedAsync(final XmlRpcListener listener, String username) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "check_account_activated");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "check_account_activated");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if ("OK".equals(result)) {
|
||||
listener.onAccountActivatedFetched(true);
|
||||
return;
|
||||
|
@ -164,7 +166,7 @@ public class XmlRpcHelper {
|
|||
listener.onError(result);
|
||||
}
|
||||
listener.onAccountActivatedFetched(false);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -175,17 +177,17 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void isTrialAccountAsync(final XmlRpcListener listener, String username, String password) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "is_account_trial");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "is_account_trial");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (!"NOK".equals(result) && !"OK".equals(result)) {
|
||||
listener.onError(result);
|
||||
}
|
||||
listener.onTrialAccountFetched("OK".equals(result));
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -197,12 +199,12 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void isAccountAsync(final XmlRpcListener listener, String username) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "check_account_activated");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "check_account_activated");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if ("OK".equals(result)) {
|
||||
listener.onAccountFetched(true);
|
||||
return;
|
||||
|
@ -211,7 +213,7 @@ public class XmlRpcHelper {
|
|||
listener.onError(result);
|
||||
}
|
||||
listener.onAccountFetched(false);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -222,12 +224,12 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void changeAccountEmailAsync(final XmlRpcListener listener, String username, String password, String newEmail) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "change_email");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "change_email");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
|
@ -235,7 +237,7 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
listener.onAccountEmailChanged(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -248,12 +250,12 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void changeAccountPasswordAsync(final XmlRpcListener listener, String username, String oldPassword, String newPassword) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "change_password");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "change_password");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
|
@ -261,7 +263,7 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
listener.onAccountPasswordChanged(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -274,12 +276,12 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void changeAccountHashPasswordAsync(final XmlRpcListener listener, String username, String oldPassword, String newPassword) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "change_hash");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "change_hash");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
|
@ -287,7 +289,7 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
listener.onAccountPasswordChanged(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -300,12 +302,12 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void sendRecoverPasswordLinkByEmailAsync(final XmlRpcListener listener, String usernameOrEmail) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "send_reset_account_password_email");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "send_reset_account_password_email");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
|
@ -313,7 +315,7 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
listener.onRecoverPasswordLinkSent(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -324,12 +326,12 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void sendActivateAccountLinkByEmailAsync(final XmlRpcListener listener, String usernameOrEmail) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "resend_activation_email");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "resend_activation_email");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
|
@ -337,7 +339,7 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
listener.onActivateAccountLinkSent(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -348,12 +350,12 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void sendUsernameByEmailAsync(final XmlRpcListener listener, String email) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "recover_username_from_email");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "recover_username_from_email");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
|
@ -361,7 +363,7 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
listener.onUsernameSent(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -372,12 +374,12 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void verifySignatureAsync(final XmlRpcListener listener, String payload, String signature) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "check_payload_signature");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "check_payload_signature");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
Log.w(result);
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
|
@ -386,7 +388,7 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
listener.onSignatureVerified("OK".equals(result));
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
@ -398,12 +400,12 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
public void getRemoteProvisioningFilenameAsync(final XmlRpcListener listener,String username, String domain, String password) {
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcRequest.ArgType.String, "get_remote_provisioning_filename");
|
||||
XmlRpcRequest xmlRpcRequest = xmlRpcSession.createRequest(XmlRpcArgType.String, "get_remote_provisioning_filename");
|
||||
xmlRpcRequest.setListener(new XmlRpcRequestListener() {
|
||||
@Override
|
||||
public void onResponse(XmlRpcRequest request) {
|
||||
String result = request.getStringResponse();
|
||||
if (request.getStatus() == XmlRpcRequest.Status.Ok) {
|
||||
if (request.getStatus() == XmlRpcStatus.Ok) {
|
||||
if (result.startsWith("ERROR_")) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
|
@ -411,7 +413,7 @@ public class XmlRpcHelper {
|
|||
}
|
||||
|
||||
listener.onRemoteProvisioningFilenameSent(result);
|
||||
} else if (request.getStatus() == XmlRpcRequest.Status.Failed) {
|
||||
} else if (request.getStatus() == XmlRpcStatus.Failed) {
|
||||
Log.e(result);
|
||||
listener.onError(result);
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 8a322804468293ac7e7f3ae88b5b1c5a069f0226
|
||||
Subproject commit bff2f9a26f46607d7c24128ff045817ec1ce3a29
|
Loading…
Reference in a new issue