The session duration is fixed. If a user is active within the session duration, then with each click / action the session duration should start over.
I think the problem lies here:
final boolean newSession = System.currentTimeMillis() - mSessionStartTime > mSessionTimeout;
mSessionStartTime is only set when manually calling:
"startNewSession()": "mSessionStartTime = 0".
And at the place you can see in the screenshot: If the 30min timeout is reached, then a new session is started with “injectInitialParams()” and the “mSessionStartTime” is set to the current timestamp.