com.facebook.internal
Class SessionTracker

java.lang.Object
  extended by com.facebook.internal.SessionTracker

public class SessionTracker
extends Object

com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of any of the classes in this package is unsupported, and they may be modified or removed without warning at any time.


Constructor Summary
SessionTracker(Context context, Session.StatusCallback callback)
          Constructs a SessionTracker to track the active Session object.
SessionTracker(Context context, Session.StatusCallback callback, Session session, boolean startTracking)
          Constructs a SessionTracker to track the Session object passed in.
 
Method Summary
 Session getOpenSession()
          Returns the current Session that's being tracked if it's open, otherwise returns null.
 Session getSession()
          Returns the current Session that's being tracked.
 boolean isTracking()
          Returns whether it's currently tracking the Session.
 boolean isTrackingActiveSession()
          Returns whether it's currently tracking the active Session.
 void setSession(Session newSession)
          Set the Session object to track.
 void startTracking()
          Start tracking the Session (either active or the one given).
 void stopTracking()
          Stop tracking the Session and remove any callbacks attached to those sessions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionTracker

public SessionTracker(Context context,
                      Session.StatusCallback callback)
Constructs a SessionTracker to track the active Session object.

Parameters:
context - the context object.
callback - the callback to use whenever the active Session's state changes

SessionTracker

public SessionTracker(Context context,
                      Session.StatusCallback callback,
                      Session session,
                      boolean startTracking)
Constructs a SessionTracker to track the Session object passed in. If the Session is null, then it will track the active Session instead.

Parameters:
context - the context object.
callback - the callback to use whenever the Session's state changes
session - the Session object to track
startTracking - whether to start tracking the Session right away
Method Detail

getSession

public Session getSession()
Returns the current Session that's being tracked.

Returns:
the current Session associated with this tracker

getOpenSession

public Session getOpenSession()
Returns the current Session that's being tracked if it's open, otherwise returns null.

Returns:
the current Session if it's open, otherwise returns null

setSession

public void setSession(Session newSession)
Set the Session object to track.

Parameters:
newSession - the new Session object to track

startTracking

public void startTracking()
Start tracking the Session (either active or the one given).


stopTracking

public void stopTracking()
Stop tracking the Session and remove any callbacks attached to those sessions.


isTracking

public boolean isTracking()
Returns whether it's currently tracking the Session.

Returns:
true if currently tracking the Session

isTrackingActiveSession

public boolean isTrackingActiveSession()
Returns whether it's currently tracking the active Session.

Returns:
true if the currently tracked session is the active Session.