use of com.vodafone360.people.service.agent.NetworkAgent in project 360-Engine-for-Android by 360.
the class RemoteService method onCreate.
/**
* Creation of RemoteService. Loads properties (i.e. supported features,
* server URLs etc) from SettingsManager. Creates IPeopleServiceImpl,
* NetworkAgent. Connects ConnectionManager creating Connection thread(s)
* and DecoderThread 'Kicks' worker thread.
*/
@Override
public void onCreate() {
LogUtils.logV("RemoteService.onCreate()");
SettingsManager.loadProperties(this);
mIPeopleServiceImpl = new PeopleServiceImpl(this, this);
mNetworkAgent = new NetworkAgent(this, this, this);
// Create NativeContactsApi here to access Application Context
NativeContactsApi.createInstance(getApplicationContext());
EngineManager.createEngineManager(this, mIPeopleServiceImpl);
mNetworkAgent.onCreate();
mIPeopleServiceImpl.setNetworkAgent(mNetworkAgent);
/**
* The service has now been fully initialised. *
*/
mIsStarted = true;
kickWorkerThread();
final MainApplication mainApp = (MainApplication) getApplication();
mainApp.setServiceInterface(mIPeopleServiceImpl);
if (VersionUtils.is2XPlatform()) {
mAccountsObjectsHolder = new NativeAccountObjectsHolder(((MainApplication) getApplication()));
}
final UserDataProtection userDataProtection = new UserDataProtection(this, mainApp.getDatabase());
userDataProtection.performStartupChecks();
}
use of com.vodafone360.people.service.agent.NetworkAgent in project 360-Engine-for-Android by 360.
the class UpgradeEngineTest method setUp.
// private NetworkAgent mAgent;
@Override
protected void setUp() throws Exception {
// TODO Auto-generated method stub
super.setUp();
SettingsManager.loadProperties(getContext());
SettingsManager.setProperty(Settings.UPGRADE_CHECK_URL_KEY, UPGRADE_URL_DUMMY);
// mAgent = new NetworkAgent(null, null, null);
mUpgradeEngine = new UpgradeEngine(getContext(), this);
}
use of com.vodafone360.people.service.agent.NetworkAgent in project 360-Engine-for-Android by 360.
the class RemoteServiceTest method testGetNetworkAgent.
/**
* Test getNetworkAgent() from RemoteService.
*/
@MediumTest
public final void testGetNetworkAgent() {
/**
* Setup test preconditions (i.e. remoteService running). *
*/
startService(new Intent(getContext(), RemoteService.class));
RemoteService remoteService = getService();
assertNotNull("RemoteService should not be NULL", remoteService);
/**
* Perform test (i.e. disconnect). *
*/
NetworkAgent networkAgent = remoteService.getNetworkAgent();
/**
* Test NetworkAgent object. *
*/
assertNotNull("NetworkAgent should not be NULL", networkAgent);
assertEquals("NetworkAgent RoamingDeviceSetting should be FALSE", false, networkAgent.getRoamingDeviceSetting());
assertEquals("NetworkAgent RoamingNotificationType should be ROAMING_DIALOG_GLOBAL_OFF", NetworkAgent.ROAMING_DIALOG_GLOBAL_OFF, networkAgent.getRoamingNotificationType());
assertEquals("NetworkAgent AgentState should be CONNECTED", AgentState.CONNECTED, NetworkAgent.getAgentState());
}
Aggregations