|
6 | 6 | import android.annotation.SuppressLint; |
7 | 7 | import android.app.ActivityManager; |
8 | 8 | import android.content.Context; |
9 | | -import android.content.pm.PackageInfo; |
10 | 9 | import android.os.Build; |
11 | 10 | import android.os.Debug; |
12 | 11 | import android.os.Process; |
@@ -61,7 +60,6 @@ final class AndroidTransactionProfiler implements ITransactionProfiler { |
61 | 60 | private final @NotNull SentryAndroidOptions options; |
62 | 61 | private final @NotNull IHub hub; |
63 | 62 | private final @NotNull BuildInfoProvider buildInfoProvider; |
64 | | - private final @Nullable PackageInfo packageInfo; |
65 | 63 | private long transactionStartNanos = 0; |
66 | 64 | private long profileStartCpuMillis = 0; |
67 | 65 | private boolean isInitialized = false; |
@@ -103,7 +101,6 @@ public AndroidTransactionProfiler( |
103 | 101 | Objects.requireNonNull(frameMetricsCollector, "SentryFrameMetricsCollector is required"); |
104 | 102 | this.buildInfoProvider = |
105 | 103 | Objects.requireNonNull(buildInfoProvider, "The BuildInfoProvider is required."); |
106 | | - this.packageInfo = ContextUtils.getPackageInfo(context, options.getLogger(), buildInfoProvider); |
107 | 104 | } |
108 | 105 |
|
109 | 106 | private void init() { |
@@ -322,14 +319,8 @@ private void onLastTransactionFinished(final ITransaction transaction, final boo |
322 | 319 | return; |
323 | 320 | } |
324 | 321 |
|
325 | | - String versionName = ""; |
326 | | - String versionCode = ""; |
327 | 322 | String totalMem = "0"; |
328 | 323 | ActivityManager.MemoryInfo memInfo = getMemInfo(); |
329 | | - if (packageInfo != null) { |
330 | | - versionName = ContextUtils.getVersionName(packageInfo); |
331 | | - versionCode = ContextUtils.getVersionCode(packageInfo, buildInfoProvider); |
332 | | - } |
333 | 324 | if (memInfo != null) { |
334 | 325 | totalMem = Long.toString(memInfo.totalMem); |
335 | 326 | } |
@@ -379,8 +370,7 @@ private void onLastTransactionFinished(final ITransaction transaction, final boo |
379 | 370 | buildInfoProvider.isEmulator(), |
380 | 371 | totalMem, |
381 | 372 | options.getProguardUuid(), |
382 | | - versionName, |
383 | | - versionCode, |
| 373 | + options.getRelease(), |
384 | 374 | options.getEnvironment(), |
385 | 375 | isTimeout |
386 | 376 | ? ProfilingTraceData.TRUNCATION_REASON_TIMEOUT |
|
0 commit comments