Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java

Issue 29453585: Issue 5288 - Pass android app name and version (Closed)
Patch Set: Created June 1, 2017, 11:38 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java
index 497e8920976dacb2377aea68b927bb1ee2a5e0a0..3afec963c4a28cd2c762b6522536e2daad8c69f9 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngine.java
@@ -42,6 +42,8 @@ import org.adblockplus.libadblockplus.UpdateCheckDoneCallback;
import org.adblockplus.libadblockplus.WebRequest;
import android.content.Context;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
import android.os.Build.VERSION;
import android.os.Handler;
import android.os.Looper;
@@ -105,7 +107,18 @@ public final class AdblockEngine
public static AppInfo generateAppInfo(final Context context, boolean developmentBuild)
{
- return generateAppInfo(context, developmentBuild, null, null);
+ try
+ {
+ PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
+ String application = context.getPackageName();
+ String applicationVersion = packageInfo.versionName;
+
+ return generateAppInfo(context, developmentBuild, application, applicationVersion);
+ }
+ catch (PackageManager.NameNotFoundException e)
+ {
+ throw new RuntimeException(e);
+ }
}
/**
« no previous file with comments | « libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld