Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/src/org/commcare/CommCareApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ public void startUserSession(byte[] symmetricKey, UserKeyRecord record, boolean
// CommCareSessionService, close it and open a new one
SessionRegistrationHelper.unregisterSessionExpiration();
if (this.sessionServiceIsBound) {
Logger.log(LogTypes.TYPE_MAINTENANCE, "Closing user session to start a new one");
releaseUserResourcesAndServices();
}
bindUserSessionService(symmetricKey, record, restoreSession);
Expand All @@ -379,7 +378,6 @@ public void startUserSession(byte[] symmetricKey, UserKeyRecord record, boolean
*/
public void closeUserSession() {
synchronized (serviceLock) {
Logger.log(LogTypes.TYPE_MAINTENANCE, "Closing user session");
// Cancel any running tasks before closing down the user database.
ManagedAsyncTask.cancelTasks();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import org.commcare.CommCareApplication;
import org.commcare.google.services.analytics.AnalyticsParamValue;
import org.commcare.google.services.analytics.FirebaseAnalyticsUtil;
import org.commcare.util.LogTypes;
import org.javarosa.core.services.Logger;

import java.util.Date;

Expand Down Expand Up @@ -59,10 +57,8 @@ public static void registerStartSession() {
editor.putLong(KEY_LAST_SESSION_START_TIME, currentTime())
.putString(KEY_LAST_LOGGED_IN_USER, currentUserId)
.commit();
Logger.log(LogTypes.TYPE_MAINTENANCE, "Registered session start for user " + currentUserId);
} else {
Logger.log(LogTypes.TYPE_ERROR_ASSERTION,
"Attempting to report starting a session with no logged in user available");
Log.i(TAG, "Attempting to report starting a session with no logged in user available");
}
}

Expand Down
1 change: 0 additions & 1 deletion app/src/org/commcare/tasks/DataPullTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ private ResultAndError<PullTaskResult> handleRateLimitedError() {

private void wipeLoginIfItOccurred() {
if (wasKeyLoggedIn) {
Logger.log(LogTypes.TYPE_MAINTENANCE, "Wiping user login");
CommCareApplication.instance().releaseUserResourcesAndServices();
}
}
Expand Down
9 changes: 2 additions & 7 deletions app/src/org/commcare/tasks/ManageKeyRecordTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.commcare.tasks;

import android.content.Context;
import android.util.Log;

import org.commcare.CommCareApp;
import org.commcare.CommCareApplication;
Expand Down Expand Up @@ -123,8 +122,6 @@ protected void deliverResult(R receiver, HttpCalloutOutcomes result) {
//If we got here, we didn't "log in" fully. IE: We have a key record and a
//functional sandbox, but this user has never been synced, so we aren't
//really "logged in".
Logger.log(LogTypes.TYPE_ERROR_ASSERTION,
"logged in user null after successfully completing key record request");
CommCareApplication.instance().releaseUserResourcesAndServices();
keysReadyForSync(receiver);
return;
Expand All @@ -137,8 +134,7 @@ protected void deliverResult(R receiver, HttpCalloutOutcomes result) {
result = HttpCalloutOutcomes.NetworkFailureBadPassword;
}
}
Logger.log(LogTypes.TYPE_MAINTENANCE,
"Closing user session due to key record task failing with " + result);

//For any other result make sure we're logged out.
CommCareApplication.instance().releaseUserResourcesAndServices();

Expand Down Expand Up @@ -510,12 +506,11 @@ private void setupLoggedInUser() {
try {
User u = CommCareApplication.instance().getSession().getLoggedInUser();
if (u != null) {
Logger.log(LogTypes.TYPE_MAINTENANCE, "Setting up logged in user " + u);
u.setCachedPwd(password);
loggedIn = u;
}
} catch (SessionUnavailableException sue) {
Logger.log(LogTypes.TYPE_USER, "Could not get active session after login");

}
}

Expand Down