2013-05-07 16:31:11 -07:00
|
|
|
package org.thoughtcrime.securesms.util;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.pm.PackageManager;
|
2014-05-05 13:48:26 -05:00
|
|
|
|
|
|
|
import java.io.IOException;
|
2013-05-07 16:31:11 -07:00
|
|
|
|
|
|
|
public class VersionTracker {
|
|
|
|
|
|
|
|
|
|
|
|
public static int getLastSeenVersion(Context context) {
|
2014-05-05 13:48:26 -05:00
|
|
|
return TextSecurePreferences.getLastVersionCode(context);
|
2013-05-07 16:31:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void updateLastSeenVersion(Context context) {
|
|
|
|
try {
|
2014-07-23 15:40:45 -07:00
|
|
|
int currentVersionCode = Util.getCurrentApkReleaseVersion(context);
|
2014-05-05 13:48:26 -05:00
|
|
|
TextSecurePreferences.setLastVersionCode(context, currentVersionCode);
|
|
|
|
} catch (IOException ioe) {
|
|
|
|
throw new AssertionError(ioe);
|
2013-05-07 16:31:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|