From 034673dea506117ac1be0a836319eb6031c28469 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 20 Apr 2011 09:04:17 +0200 Subject: [PATCH] Dump linphone version to the log on each startup. --- src/org/linphone/LinphoneService.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index 934281748..974b61327 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -34,6 +34,8 @@ import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager.NameNotFoundException; import android.media.MediaPlayer; import android.media.RingtoneManager; import android.net.Uri; @@ -106,6 +108,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis // Dump some debugging information to the logs Hacks.dumpDeviceInformation(); + dumpInstalledLinphoneInformation(); mNotificationMgr = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); mNotif = new Notification(R.drawable.status_level, "", System.currentTimeMillis()); @@ -124,6 +127,19 @@ public final class LinphoneService extends Service implements LinphoneServiceLis + private void dumpInstalledLinphoneInformation() { + PackageInfo info = null; + try { + info = getPackageManager().getPackageInfo(getPackageName(),0); + } catch (NameNotFoundException nnfe) {} + + if (info != null) { + Log.i(LinphoneManager.TAG, "Linphone version is " + info.versionCode); + } else { + Log.i(LinphoneManager.TAG, "Linphone version is unkown"); + } + } + private void sendNotification(int level, int textId) { mNotif.iconLevel = level; mNotif.when=System.currentTimeMillis();