-
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.
Signed-off-by: Tomas Chladek <[email protected]>
- Loading branch information
1 parent
c16aa10
commit c7320db
Showing
11 changed files
with
200 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import plugins.ConfigAndroidLibrary | ||
import plugins.ConfigPublish | ||
import utils.artifactIdProperty | ||
import utils.artifactPrefix | ||
import utils.integrationPrefix | ||
import utils.versionProperty | ||
|
||
plugins { | ||
id("com.android.library") | ||
id("kotlin-android") | ||
} | ||
|
||
apply<ConfigAndroidLibrary>() | ||
apply<ConfigPublish>() | ||
|
||
ext { | ||
set(artifactIdProperty, "$artifactPrefix$integrationPrefix${project.name}") | ||
set(versionProperty, Configurations.sdkVersionName) | ||
} | ||
|
||
android { | ||
namespace = "com.cisco.android.rum.integration.interactions" | ||
} | ||
|
||
dependencies { | ||
implementation(project(":common:utils")) | ||
implementation(project(":integration:agent:internal")) | ||
|
||
implementation(Dependencies.Android.SessionReplay.logger) | ||
implementation(Dependencies.Android.SessionReplay.frameCapturer) | ||
implementation(Dependencies.Android.SessionReplay.interactions) | ||
} |
Empty file.
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,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<issues format="6" by="lint 7.3.1" type="baseline" client="gradle" dependencies="false" name="AGP (7.3.1)" variant="all" version="7.3.1"> | ||
|
||
</issues> |
Empty file.
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,10 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<application> | ||
<provider | ||
android:name=".InteractionsInstaller" | ||
android:authorities="${applicationId}.interactions-integration-installer" | ||
android:enabled="true" | ||
android:exported="false" /> | ||
</application> | ||
</manifest> |
88 changes: 88 additions & 0 deletions
88
.../src/main/java/com/cisco/android/rum/integration/interactions/InteractionsConfigurator.kt
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,88 @@ | ||
/* | ||
* Copyright 2024 Splunk Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.cisco.android.rum.integration.interactions | ||
|
||
import android.app.Application | ||
import android.content.Context | ||
import com.cisco.android.common.logger.Logger | ||
import com.cisco.android.instrumentation.recording.capturer.FrameCapturer | ||
import com.cisco.android.instrumentation.recording.interactions.Interactions | ||
import com.cisco.android.instrumentation.recording.interactions.OnInteractionListener | ||
import com.cisco.android.instrumentation.recording.interactions.model.Interaction | ||
import com.cisco.android.instrumentation.recording.interactions.model.LegacyData | ||
import com.cisco.android.instrumentation.recording.wireframe.model.Wireframe | ||
import com.cisco.android.instrumentation.recording.wireframe.stats.WireframeStats | ||
import com.cisco.android.rum.integration.agent.internal.AgentIntegration | ||
import com.cisco.android.rum.integration.agent.internal.config.ModuleConfigurationManager | ||
import com.cisco.android.rum.integration.agent.internal.config.RemoteModuleConfiguration | ||
|
||
internal object InteractionsConfigurator { | ||
|
||
private const val TAG = "InteractionsConfigurator" | ||
private const val MODULE_NAME = "interactions" | ||
|
||
init { | ||
AgentIntegration.registerModule(MODULE_NAME) | ||
} | ||
|
||
fun attach(context: Context) { | ||
AgentIntegration.obtainInstance(context).listeners += installationListener | ||
|
||
val application = context.applicationContext as Application | ||
|
||
Interactions.attach(application) | ||
FrameCapturer.attach(application) | ||
|
||
FrameCapturer.listeners += object : FrameCapturer.Listener { | ||
override fun onNewWireframe(frame: Wireframe.Frame, stats: WireframeStats) { | ||
Interactions.updateWireframe(frame) | ||
} | ||
} | ||
|
||
Interactions.listeners += interactionsListener | ||
} | ||
|
||
private val interactionsListener = object : OnInteractionListener { | ||
override fun onInteraction(interaction: Interaction, legacyData: LegacyData?) { | ||
Logger.d(TAG, "onInteraction(interaction: $interaction, legacyData: $legacyData)") | ||
|
||
// TODO process interaction | ||
} | ||
} | ||
|
||
private val configManagerListener = object : ModuleConfigurationManager.Listener { | ||
override fun onRemoteModuleConfigurationsChanged(manager: ModuleConfigurationManager, remoteConfigurations: List<RemoteModuleConfiguration>) { | ||
Logger.d(TAG, "onRemoteModuleConfigurationsChanged(remoteConfigurations: $remoteConfigurations)") | ||
setModuleConfiguration(remoteConfigurations) | ||
} | ||
} | ||
|
||
private fun setModuleConfiguration(remoteConfigurations: List<RemoteModuleConfiguration>) { | ||
Logger.d(TAG, "setModuleConfiguration(remoteConfigurations: $remoteConfigurations)") | ||
} | ||
|
||
private val installationListener = object : AgentIntegration.Listener { | ||
override fun onInstall(context: Context) { | ||
Logger.d(TAG, "onInstall()") | ||
|
||
val integration = AgentIntegration.obtainInstance(context) | ||
integration.moduleConfigurationManager.listeners += configManagerListener | ||
|
||
setModuleConfiguration(integration.moduleConfigurationManager.remoteConfigurations) | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...ons/src/main/java/com/cisco/android/rum/integration/interactions/InteractionsInstaller.kt
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,40 @@ | ||
/* | ||
* Copyright 2024 Splunk Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.cisco.android.rum.integration.interactions | ||
|
||
import android.content.ContentProvider | ||
import android.content.ContentValues | ||
import android.database.Cursor | ||
import android.net.Uri | ||
|
||
internal class InteractionsInstaller : ContentProvider() { | ||
|
||
override fun onCreate(): Boolean { | ||
InteractionsConfigurator.attach(context!!) | ||
return true | ||
} | ||
|
||
override fun query(uri: Uri, projection: Array<out String>?, selection: String?, selectionArgs: Array<out String>?, sortOrder: String?): Cursor? = null | ||
|
||
override fun getType(uri: Uri): String? = null | ||
|
||
override fun insert(uri: Uri, values: ContentValues?): Uri? = null | ||
|
||
override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Int = 0 | ||
|
||
override fun update(uri: Uri, values: ContentValues?, selection: String?, selectionArgs: Array<out String>?): Int = 0 | ||
} |
21 changes: 21 additions & 0 deletions
21
...in/java/com/cisco/android/rum/integration/interactions/InteractionsModuleConfiguration.kt
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,21 @@ | ||
/* | ||
* Copyright 2024 Splunk Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.cisco.android.rum.integration.interactions | ||
|
||
import com.cisco.android.rum.integration.agent.module.ModuleConfiguration | ||
|
||
class InteractionsModuleConfiguration : ModuleConfiguration |
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