Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Jan 30, 2024
1 parent 9ae3a3f commit 2594734
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import com.snowplowanalytics.snowplow.tracker.PlatformContextRetriever
* @param deviceInfoMonitor Device monitor for fetching platform information
* @param properties List of properties of the platform context to track
* @param retriever Overrides for retrieving property values
* @param context Android context
*/
class PlatformContext(
private val platformDictUpdateFrequency: Long = 1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import java.util.concurrent.atomic.AtomicBoolean
* @param emitter Emitter to which events will be sent
* @param namespace Identifier for the Tracker instance
* @param appId Application ID
* @param platformContextProperties List of properties of the platform context to track
* @param platformContextRetriever Overrides for retrieving property values
* @param context The Android application context
* @param builder A closure to set Tracker configuration
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -16,63 +16,103 @@ package com.snowplowanalytics.snowplow.tracker
* Overrides for the values for properties of the platform context.
*/
data class PlatformContextRetriever(
/// Operating system type (e.g., ios, tvos, watchos, osx, android)
/**
* Operating system type (e.g., ios, tvos, watchos, osx, android).
*/
var osType: (() -> String)? = null,

/// The current version of the operating system
/*
* The current version of the operating system.
*/
var osVersion: (() -> String)? = null,

/// The manufacturer of the product/hardware
/**
* The manufacturer of the product/hardware.
*/
var deviceVendor: (() -> String)? = null,

/// The end-user-visible name for the end product
/**
* The end-user-visible name for the end product.
*/
var deviceModel: (() -> String)? = null,

/// The carrier of the SIM inserted in the device
/**
* The carrier of the SIM inserted in the device.
*/
var carrier: (() -> String?)? = null,

/// Type of network the device is connected to
/**
* Type of network the device is connected to.
*/
var networkType: (() -> String?)? = null,

/// Radio access technology that the device is using
/**
* Radio access technology that the device is using.
*/
var networkTechnology: (() -> String?)? = null,

/// Advertising identifier on Android
/**
* Advertising identifier on Android.
*/
var androidIdfa: (() -> String?)? = null,

/// Bytes of storage remaining
/**
* Bytes of storage remaining.
*/
var availableStorage: (() -> Long?)? = null,

/// Total size of storage in bytes
/**
* Total size of storage in bytes.
*/
var totalStorage: (() -> Long?)? = null,

/// Total physical system memory in bytes
/**
* Total physical system memory in bytes.
*/
var physicalMemory: (() -> Long?)? = null,

/// Available memory on the system in bytes (Android only)
/**
* Available memory on the system in bytes (Android only).
*/
var systemAvailableMemory: (() -> Long?)? = null,

/// Remaining battery level as an integer percentage of total battery capacity
/**
* Remaining battery level as an integer percentage of total battery capacity.
*/
var batteryLevel: (() -> Int?)? = null,

/// Battery state for the device
/**
* Battery state for the device
*/
var batteryState: (() -> String?)? = null,

/// A Boolean indicating whether the device orientation is portrait (either upright or upside down)
/**
* A Boolean indicating whether the device orientation is portrait (either upright or upside down).
*/
var isPortrait: (() -> Boolean?)? = null,

/// Screen resolution in pixels. Arrives in the form of WIDTHxHEIGHT (e.g., 1200x900). Doesn't change when device orientation changes
/**
* Screen resolution in pixels. Arrives in the form of WIDTHxHEIGHT (e.g., 1200x900). Doesn't change when device orientation changes.
*/
var resolution: (() -> String?)? = null,

/// Scale factor used to convert logical coordinates to device coordinates of the screen (uses UIScreen.scale on iOS)
/**
* Scale factor used to convert logical coordinates to device coordinates of the screen (uses UIScreen.scale on iOS).
*/
var scale: (() -> Float?)? = null,

/// System language currently used on the device (ISO 639)
/**
* System language currently used on the device (ISO 639).
*/
var language: (() -> String)? = null,

/// Android vendor ID scoped to the set of apps published under the same Google Play developer account (see https://developer.android.com/training/articles/app-set-id)
/**
* Android vendor ID scoped to the set of apps published under the same Google Play developer account (see https://developer.android.com/training/articles/app-set-id).
*/
var appSetId: (() -> String)? = null,

/// Scope of the `appSetId`. Can be scoped to the app or to a developer account on an app store (all apps from the same developer on the same device will have the same ID)
/**
* Scope of the `appSetId`. Can be scoped to the app or to a developer account on an app store (all apps from the same developer on the same device will have the same ID).
*/
var appSetIdScope: (() -> String)? = null
)

0 comments on commit 2594734

Please sign in to comment.