@Test public void testSessionIdsAreCapitalized() { InternalSession session = new InternalSession(); session.start(new MockContext()); String sessionId = session.mSessionID; Assert.assertNotEquals(Constants.NO_SESSION_ID, sessionId); Assert.assertEquals(sessionId.toUpperCase(Locale.US), sessionId); }
public InternalSession start(Context context) { mLastEventTime = mSessionStartTime = System.currentTimeMillis(); mSessionID = UUID.randomUUID().toString().toUpperCase(Locale.US); mSessionAttributes = new JSONObject(); mTimeInBackground = 0; addMpid(ConfigManager.getMpid(context)); InternalListenerManager.getListener().onSessionUpdated(this); return this; }
InternalSession { public InternalSession start(Context context) { mLastEventTime = mSessionStartTime = System.currentTimeMillis(); mSessionID = UUID.randomUUID().toString().toUpperCase(Locale.US); mSessionAttributes = new JSONObject(); mTimeInBackground = 0; addMpid(ConfigManager.getMpid(context)); InternalListenerManager.getListener().onSessionUpdated(this); return this; } }
InternalSession { public InternalSession start(Context context) { mLastEventTime = mSessionStartTime = System.currentTimeMillis(); mSessionID = UUID.randomUUID().toString().toUpperCase(Locale.US); mSessionAttributes = new JSONObject(); mTimeInBackground = 0; addMpid(ConfigManager.getMpid(context)); InternalListenerManager.getListener().onSessionUpdated(this); return this; } InternalSession();  InternalSession(InternalSession session); }
InternalSession { public InternalSession start(Context context) { mLastEventTime = mSessionStartTime = System.currentTimeMillis(); mSessionID = UUID.randomUUID().toString().toUpperCase(Locale.US); mSessionAttributes = new JSONObject(); mTimeInBackground = 0; addMpid(ConfigManager.getMpid(context)); InternalListenerManager.getListener().onSessionUpdated(this); return this; } InternalSession();  InternalSession(InternalSession session); boolean isActive(); InternalSession start(Context context); boolean isTimedOut(int sessionTimeout); long getLength(); long getBackgroundTime(); long getForegroundTime(); void updateBackgroundTime(AtomicLong lastStoppedTime, long currentTime); void addMpid(long newMpid); Set<Long> getMpids(); }
InternalSession { public InternalSession start(Context context) { mLastEventTime = mSessionStartTime = System.currentTimeMillis(); mSessionID = UUID.randomUUID().toString().toUpperCase(Locale.US); mSessionAttributes = new JSONObject(); mTimeInBackground = 0; addMpid(ConfigManager.getMpid(context)); InternalListenerManager.getListener().onSessionUpdated(this); return this; } InternalSession();  InternalSession(InternalSession session); boolean isActive(); InternalSession start(Context context); boolean isTimedOut(int sessionTimeout); long getLength(); long getBackgroundTime(); long getForegroundTime(); void updateBackgroundTime(AtomicLong lastStoppedTime, long currentTime); void addMpid(long newMpid); Set<Long> getMpids(); public String mSessionID; public long mSessionStartTime; public long mLastEventTime; public JSONObject mSessionAttributes; }