use of org.eyeseetea.malariacare.domain.usecase.LogoutUseCase in project pictureapp by EyeSeeTea.
the class ProgressActivity method initializeDependencies.
private void initializeDependencies() {
AuthenticationManager authenticationManager = new AuthenticationManager(this);
IPullController pullController = new PullController(this);
IAsyncExecutor asyncExecutor = new AsyncExecutor();
IMainExecutor mainExecutor = new UIThreadExecutor();
mLogoutUseCase = new LogoutUseCase(authenticationManager);
mPullUseCase = new PullUseCase(pullController, asyncExecutor, mainExecutor);
}
use of org.eyeseetea.malariacare.domain.usecase.LogoutUseCase in project pictureapp by EyeSeeTea.
the class PushServiceStrategy method logout.
public void logout() {
IAuthenticationManager authenticationManager;
LogoutUseCase logoutUseCase;
authenticationManager = new AuthenticationManager(mPushService);
logoutUseCase = new LogoutUseCase(authenticationManager);
AlarmPushReceiver.cancelPushAlarm(mPushService);
logoutUseCase.execute(new LogoutUseCase.Callback() {
@Override
public void onLogoutSuccess() {
if (!EyeSeeTeaApplication.getInstance().isAppWentToBg()) {
Intent loginIntent = new Intent(mPushService, LoginActivity.class);
loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mPushService.startActivity(loginIntent);
}
}
@Override
public void onLogoutError(String message) {
Log.d(TAG, message);
}
});
}
use of org.eyeseetea.malariacare.domain.usecase.LogoutUseCase in project pictureapp by EyeSeeTea.
the class SettingsActivityStrategy method onCreate.
@Override
public void onCreate() {
mAuthenticationManager = new AuthenticationManager(settingsActivity);
mLogoutUseCase = new LogoutUseCase(mAuthenticationManager);
IntentFilter screenStateFilter = new IntentFilter();
screenStateFilter.addAction(Intent.ACTION_SCREEN_ON);
screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF);
settingsActivity.registerReceiver(mScreenOffReceiver, screenStateFilter);
}
use of org.eyeseetea.malariacare.domain.usecase.LogoutUseCase in project pictureapp by EyeSeeTea.
the class LogoutAndLoginRequiredOnPreferenceClickListener method logout.
private void logout() {
Log.d(TAG, "Logging out...");
AuthenticationManager authenticationManager = new AuthenticationManager(settingsActivity);
LogoutUseCase logoutUseCase = new LogoutUseCase(authenticationManager);
logoutUseCase.execute(new LogoutUseCase.Callback() {
@Override
public void onLogoutSuccess() {
Intent loginIntent = new Intent(settingsActivity, LoginActivity.class);
settingsActivity.finish();
settingsActivity.startActivity(loginIntent);
}
@Override
public void onLogoutError(String message) {
Log.e(TAG, message);
}
});
}
use of org.eyeseetea.malariacare.domain.usecase.LogoutUseCase in project pictureapp by EyeSeeTea.
the class DashboardActivity method executeLogout.
public void executeLogout() {
IAuthenticationManager iAuthenticationManager = new AuthenticationManager(this);
LogoutUseCase logoutUseCase = new LogoutUseCase(iAuthenticationManager);
AlarmPushReceiver.cancelPushAlarm(this);
logoutUseCase.execute(new LogoutUseCase.Callback() {
@Override
public void onLogoutSuccess() {
DashboardActivityStrategy.onLogoutSuccess();
}
@Override
public void onLogoutError(String message) {
Log.e("." + this.getClass().getSimpleName(), message);
}
});
}
Aggregations