Skip to content

Commit 13d9d2b

Browse files
authored
Merge branch 'main' into dependabot/github_actions/reactivecircus/android-emulator-runner-2.33.0
2 parents 9f7aa44 + 58da2a3 commit 13d9d2b

File tree

6 files changed

+45
-11
lines changed

6 files changed

+45
-11
lines changed

.sauce/sentry-uitest-android-benchmark.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ suites:
3333
useTestOrchestrator: true
3434
devices:
3535
- id: Samsung_Galaxy_S10_Plus_11_real_us # Samsung Galaxy S10+ - api 30 (11) - high end
36-
- id: Samsung_Galaxy_A71_5G_real_us # Samsung Galaxy A71 5G - api 30 (11) - mid end
36+
- id: Google_Pixel_4a_real_us # Google Pixel 4a - api 30 (11) - mid end
3737
- id: Google_Pixel_3a_real # Google Pixel 3a - api 30 (11) - low end
3838

3939
- name: "Android 10 (api 29)"
@@ -42,7 +42,7 @@ suites:
4242
useTestOrchestrator: true
4343
devices:
4444
- id: Google_Pixel_3a_XL_real # Google Pixel 3a XL - api 29 (10)
45-
- id: Motorola_Moto_G_Power_real_us # Motorola Moto G Power - api 29 (10)
45+
- id: OnePlus_6T_real # OnePlus 6T - api 29 (10)
4646

4747
# At the time of writing (July, 4, 2022), the market share per android version is:
4848
# 12.0 = 17.54%, 11.0 = 31.65%, 10.0 = 21.92%

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Accept manifest integer values when requiring floating values ([#3823](https://github.com/getsentry/sentry-java/pull/3823))
8+
39
## 7.16.0
410

511
### Features
@@ -20,6 +26,10 @@
2026
- Load lazy fields on init in the background ([#3803](https://github.com/getsentry/sentry-java/pull/3803))
2127
- Replace setOf with HashSet.add ([#3801](https://github.com/getsentry/sentry-java/pull/3801))
2228

29+
### Breaking changes
30+
31+
- The method `addIntegrationToSdkVersion(Ljava/lang/Class;)V` has been removed from the core (`io.sentry:sentry`) package. Please make sure all of the packages (e.g. `io.sentry:sentry-android-core`, `io.sentry:sentry-android-fragment`, `io.sentry:sentry-okhttp` and others) are all aligned and using the same version to prevent the `NoSuchMethodError` exception.
32+
2333
## 7.16.0-alpha.1
2434

2535
### Features

buildSrc/src/main/java/Config.kt

+5-6
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,17 @@ object Config {
177177
}
178178

179179
object TestLibs {
180-
private val androidxTestVersion = "1.5.0"
181180
private val espressoVersion = "3.5.0"
182181

183182
val androidJUnitRunner = "androidx.test.runner.AndroidJUnitRunner"
184183
val kotlinTestJunit = "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
185-
val androidxCore = "androidx.test:core:$androidxTestVersion"
186-
val androidxRunner = "androidx.test:runner:$androidxTestVersion"
187-
val androidxTestCoreKtx = "androidx.test:core-ktx:$androidxTestVersion"
188-
val androidxTestRules = "androidx.test:rules:$androidxTestVersion"
184+
val androidxCore = "androidx.test:core:1.6.1"
185+
val androidxRunner = "androidx.test:runner:1.6.2"
186+
val androidxTestCoreKtx = "androidx.test:core-ktx:1.6.1"
187+
val androidxTestRules = "androidx.test:rules:1.6.1"
189188
val espressoCore = "androidx.test.espresso:espresso-core:$espressoVersion"
190189
val espressoIdlingResource = "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
191-
val androidxTestOrchestrator = "androidx.test:orchestrator:1.4.2"
190+
val androidxTestOrchestrator = "androidx.test:orchestrator:1.5.0"
192191
val androidxJunit = "androidx.test.ext:junit:1.1.5"
193192
val androidxCoreKtx = "androidx.core:core-ktx:1.7.0"
194193
val robolectric = "org.robolectric:robolectric:4.10.3"

sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ private static boolean readBool(
492492
private static @NotNull Double readDouble(
493493
final @NotNull Bundle metadata, final @NotNull ILogger logger, final @NotNull String key) {
494494
// manifest meta-data only reads float
495-
final Double value = ((Float) metadata.getFloat(key, -1)).doubleValue();
495+
final Double value = ((Number) metadata.getFloat(key, metadata.getInt(key, -1))).doubleValue();
496496
logger.log(SentryLevel.DEBUG, key + " read: " + value);
497497
return value;
498498
}

sentry-android-core/src/test/java/io/sentry/android/core/ManifestMetadataReaderTest.kt

+25
Original file line numberDiff line numberDiff line change
@@ -1515,4 +1515,29 @@ class ManifestMetadataReaderTest {
15151515
assertTrue(fixture.options.experimental.sessionReplay.maskViewClasses.contains(SentryReplayOptions.IMAGE_VIEW_CLASS_NAME))
15161516
assertTrue(fixture.options.experimental.sessionReplay.maskViewClasses.contains(SentryReplayOptions.TEXT_VIEW_CLASS_NAME))
15171517
}
1518+
1519+
@Test
1520+
fun `applyMetadata reads integers even when expecting floats`() {
1521+
// Arrange
1522+
val expectedSampleRate: Int = 1
1523+
1524+
val bundle = bundleOf(
1525+
ManifestMetadataReader.SAMPLE_RATE to expectedSampleRate,
1526+
ManifestMetadataReader.TRACES_SAMPLE_RATE to expectedSampleRate,
1527+
ManifestMetadataReader.PROFILES_SAMPLE_RATE to expectedSampleRate,
1528+
ManifestMetadataReader.REPLAYS_SESSION_SAMPLE_RATE to expectedSampleRate,
1529+
ManifestMetadataReader.REPLAYS_ERROR_SAMPLE_RATE to expectedSampleRate
1530+
)
1531+
val context = fixture.getContext(metaData = bundle)
1532+
1533+
// Act
1534+
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)
1535+
1536+
// Assert
1537+
assertEquals(expectedSampleRate.toDouble(), fixture.options.sampleRate)
1538+
assertEquals(expectedSampleRate.toDouble(), fixture.options.tracesSampleRate)
1539+
assertEquals(expectedSampleRate.toDouble(), fixture.options.profilesSampleRate)
1540+
assertEquals(expectedSampleRate.toDouble(), fixture.options.experimental.sessionReplay.sessionSampleRate)
1541+
assertEquals(expectedSampleRate.toDouble(), fixture.options.experimental.sessionReplay.onErrorSampleRate)
1542+
}
15181543
}

sentry-samples/sentry-samples-android/src/main/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<!-- <meta-data android:name="io.sentry.traces.sample-rate" android:value="0.8" /> -->
115115

116116
<!-- how to enable profiling when starting transactions -->
117-
<meta-data android:name="io.sentry.traces.profiling.sample-rate" android:value="1.0" />
117+
<meta-data android:name="io.sentry.traces.profiling.sample-rate" android:value="1" />
118118

119119
<!-- how to enable app start profiling -->
120120
<meta-data android:name="io.sentry.traces.profiling.enable-app-start" android:value="true" />
@@ -165,7 +165,7 @@
165165

166166
<meta-data android:name="io.sentry.enable-metrics" android:value="true" />
167167

168-
<meta-data android:name="io.sentry.session-replay.session-sample-rate" android:value="1.0" />
168+
<meta-data android:name="io.sentry.session-replay.session-sample-rate" android:value="1" />
169169
<meta-data android:name="io.sentry.session-replay.mask-all-text" android:value="true" />
170170
</application>
171171
</manifest>

0 commit comments

Comments
 (0)