+ // Progress is on a scale from 0 - 1000.
+ public int getProgress() {
+ long time = System.currentTimeMillis();
+
+ if (mType == TokenType.TOTP)
+ return (int) (time % (mPeriod * 1000) / mPeriod);
+
+ long state = (time - mLastCode) / 60;
+ return (int) (state > 1000 ? 1000 : state);