Logging out should clear facebook session information

pull/14/head
Sam Bosley 12 years ago
parent aed61f2bc4
commit 0408ef6337

@ -524,8 +524,10 @@ public class ActFmLoginActivity extends SherlockFragmentActivity {
// --- facebook handler // --- facebook handler
@SuppressWarnings("nls")
private void onSessionStateChange(Session session, SessionState state, Exception exception) { private void onSessionStateChange(Session session, SessionState state, Exception exception) {
if (state.isOpened()) { if (state.isOpened()) {
Log.e("fb-login", "State opened");
facebookSuccess(session); facebookSuccess(session);
} else if (state.isClosed()) { } else if (state.isClosed()) {
Log.e("fb-login", "State closed"); Log.e("fb-login", "State closed");

@ -12,6 +12,7 @@ import org.json.JSONObject;
import android.app.Activity; import android.app.Activity;
import android.content.DialogInterface; import android.content.DialogInterface;
import com.facebook.Session;
import com.timsu.astrid.GCMIntentService; import com.timsu.astrid.GCMIntentService;
import com.timsu.astrid.R; import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.Autowired;
@ -60,6 +61,10 @@ public class ActFmSyncV2Provider extends SyncV2Provider {
actFmPreferenceService.clearLastSyncDate(); actFmPreferenceService.clearLastSyncDate();
ActFmPreferenceService.premiumLogout(); ActFmPreferenceService.premiumLogout();
GCMIntentService.unregister(ContextManager.getContext()); GCMIntentService.unregister(ContextManager.getContext());
Session activeSession = Session.getActiveSession();
if (activeSession != null) {
activeSession.closeAndClearTokenInformation();
}
DialogUtilities.okCancelCustomDialog(activity, DialogUtilities.okCancelCustomDialog(activity,
activity.getString(R.string.actfm_logout_clear_tasks_title), activity.getString(R.string.actfm_logout_clear_tasks_title),

Loading…
Cancel
Save