Skip to content

Commit 827d950

Browse files
committed
move the null check under if(added)
1 parent 6ed6982 commit 827d950

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

sentry-android-replay/src/main/java/io/sentry/android/replay/WindowRecorder.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,13 @@ internal class WindowRecorder(
108108
}
109109

110110
override fun onRootViewsChanged(root: View, added: Boolean) {
111-
if (root.phoneWindow == null) {
112-
options.logger.log(WARNING, "Root view does not have a phone window, skipping.")
113-
return
114-
}
115111
rootViewsLock.acquire().use {
116112
if (added) {
113+
if (root.phoneWindow == null) {
114+
options.logger.log(WARNING, "Root view does not have a phone window, skipping.")
115+
return
116+
}
117+
117118
rootViews.add(WeakReference(root))
118119
capturer?.recorder?.bind(root)
119120
determineWindowSize(root)

sentry-samples/sentry-samples-android/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ dependencies {
121121
kotlin(Config.kotlinStdLib, org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)
122122
)
123123

124+
//noinspection UseTomlInstead
125+
implementation("com.smartlook.android:smartlook-analytics:2.3.2")
124126
implementation(projects.sentryAndroid)
125127
implementation(projects.sentryAndroidFragment)
126128
implementation(projects.sentryAndroidTimber)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<!-- <meta-data android:name="io.sentry.anr.enable" android:value="false" />-->
102102

103103
<!-- how to disable the auto-init-->
104-
<!-- <meta-data android:name="io.sentry.auto-init" android:value="false" />-->
104+
<meta-data android:name="io.sentry.auto-init" android:value="false" />
105105

106106
<!-- how to disable the NDK-->
107107
<!-- <meta-data android:name="io.sentry.ndk.enable" android:value="false" />-->
@@ -129,11 +129,11 @@
129129
<!-- <meta-data android:name="io.sentry.traces.profiling.sample-rate" android:value="1.0" />-->
130130

131131
<!-- Enable profiling, adjust in production env -->
132-
<meta-data android:name="io.sentry.traces.profiling.session-sample-rate" android:value="1.0" />
132+
<meta-data android:name="io.sentry.traces.profiling.session-sample-rate" android:value="0.0" />
133133
<!-- Set profiling lifecycle, can be `manual` or `trace` -->
134134
<meta-data android:name="io.sentry.traces.profiling.lifecycle" android:value="manual" />
135135
<!-- Enable profiling on app start -->
136-
<meta-data android:name="io.sentry.traces.profiling.start-on-app-start" android:value="true" />
136+
<meta-data android:name="io.sentry.traces.profiling.start-on-app-start" android:value="false" />
137137

138138
<!-- how to disable the Activity auto instrumentation for tracing-->
139139
<!-- <meta-data android:name="io.sentry.traces.activity.enable" android:value="false" />-->

sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/MyApplication.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.app.Application;
44
import android.os.StrictMode;
55
import io.sentry.Sentry;
6+
import io.sentry.android.core.SentryAndroid;
67

78
/** Apps. main Application. */
89
public class MyApplication extends Application {
@@ -13,8 +14,12 @@ public void onCreate() {
1314
strictMode();
1415
super.onCreate();
1516

17+
// Smartlook.getInstance().getPreferences().setProjectKey("528377853758d75ddf24c84b801366e4dc6bf2d1");
18+
// Smartlook.getInstance().getPreferences().setRenderingMode(RenderingMode.WIREFRAME);
19+
// Smartlook.getInstance().start();
1620
// Example how to initialize the SDK manually which allows access to SentryOptions callbacks.
1721
// Make sure you disable the auto init via manifest meta-data: io.sentry.auto-init=false
22+
SentryAndroid.init(this);
1823
// SentryAndroid.init(
1924
// this,
2025
// options -> {

settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ dependencyResolutionManagement {
1212
google()
1313
mavenCentral()
1414
mavenLocal()
15+
maven {
16+
url = uri("https://sdk.smartlook.com/android/release")
17+
}
1518
}
1619
}
1720

0 commit comments

Comments
 (0)