androidandroid-lvl

How to increase LVL cache-valid time?


I've implemented LVL server managed policy in my app. I know that lvl server response is cached in a device for some period of time so users are able to use a app without interent connection (lvl uses cached license then). I would like to know exactly how long that period is and how I can increase it. Basically, lvl I've implemented checks license everytime the app starts and I would like to increase cache-valid time to 60 days.


Solution

  • I haven't found the actual value of the lvl cache-time set by google servers, but I found how to change it. In the ServerManagedPolicy.java file change:

    setValidityTimestamp(extras.get("VT"));
    

    to whatever you like (here to 30 days):

    setValidityTimestamp(String.valueOf(System.currentTimeMillis() + (MILLIS_PER_MINUTE * 60 *24*30)));