-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bc3c4c
commit 7828651
Showing
9 changed files
with
92 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
splunk-otel-android/src/main/java/com/splunk/rum/ExplicitVisibleScreenNameTracker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.splunk.rum; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import java.util.concurrent.atomic.AtomicReference; | ||
|
||
import io.opentelemetry.android.instrumentation.activity.VisibleScreenTracker; | ||
|
||
public class ExplicitVisibleScreenNameTracker extends VisibleScreenTracker { | ||
private final AtomicReference<String> lastScreenName = new AtomicReference<>(); | ||
private final AtomicReference<String> previouslyLastScreenName = new AtomicReference<>(); | ||
|
||
public void setExplicitScreenName(String screenName) { | ||
this.previouslyLastScreenName.set(this.lastScreenName.get()); | ||
this.lastScreenName.set(screenName); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public String getPreviouslyVisibleScreen() { | ||
String screenName = previouslyLastScreenName.get(); | ||
if (screenName != null) { | ||
return screenName; | ||
} | ||
|
||
return super.getPreviouslyVisibleScreen(); | ||
} | ||
|
||
@Override | ||
public String getCurrentlyVisibleScreen() { | ||
String screenName = lastScreenName.get(); | ||
if (screenName != null) { | ||
return screenName; | ||
} | ||
|
||
return super.getCurrentlyVisibleScreen(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters