Upgrade to new GCM API.

This commit is contained in:
Moxie Marlinspike
2014-07-23 15:40:45 -07:00
parent c632b32ff8
commit 9ef14a0f64
14 changed files with 234 additions and 239 deletions

View File

@@ -18,6 +18,7 @@ package org.thoughtcrime.securesms.util;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.Typeface;
import android.os.Build;
import android.provider.Telephony;
@@ -153,6 +154,14 @@ public class Util {
(context.getPackageName().equals(Telephony.Sms.getDefaultSmsPackage(context)));
}
public static int getCurrentApkReleaseVersion(Context context) {
try {
return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
} catch (PackageManager.NameNotFoundException e) {
throw new AssertionError(e);
}
}
// public static Bitmap loadScaledBitmap(InputStream src, int targetWidth, int targetHeight) {
// return BitmapFactory.decodeStream(src);
//// BitmapFactory.Options options = new BitmapFactory.Options();