Stay organized with collections
Save and categorize content based on your preferences.
ServiceHealthStats
class ServiceHealthStats
Keys for HealthStats
returned from HealthStats.getStats(int)
with the PackageHealthStats.STATS_SERVICES
key.
Summary
Constants |
static Int |
Key for a measurement of the total number of times this service was started due to calls to startService() or android.
|
static Int |
Key for a measurement of the number of times this service was started due to calls to startService() , including re-launches after crashes.
|
Constants
MEASUREMENT_LAUNCH_COUNT
static val MEASUREMENT_LAUNCH_COUNT: Int
Key for a measurement of the total number of times this service was started due to calls to startService()
or android.content.Context#bindService including re-launches after crashes.
Value: 50002
MEASUREMENT_START_SERVICE_COUNT
static val MEASUREMENT_START_SERVICE_COUNT: Int
Key for a measurement of the number of times this service was started due to calls to startService()
, including re-launches after crashes.
Value: 50001
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ServiceHealthStats\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nServiceHealthStats\n==================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/os/health/ServiceHealthStats \"View this page in Java\") \n\n```\nclass ServiceHealthStats\n```\n\n|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.os.health.ServiceHealthStats](#) |\n\nKeys for [HealthStats](/reference/kotlin/android/os/health/HealthStats) returned from [HealthStats.getStats(int)](/reference/kotlin/android/os/health/HealthStats#getStats(kotlin.Int)) with the [PackageHealthStats.STATS_SERVICES](/reference/kotlin/android/os/health/PackageHealthStats#STATS_SERVICES:kotlin.Int) key.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEASUREMENT_LAUNCH_COUNT](#MEASUREMENT_LAUNCH_COUNT:kotlin.Int) Key for a measurement of the total number of times this service was started due to calls to [startService()](../../content/Context.html#startService(android.content.Intent)) or android. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEASUREMENT_START_SERVICE_COUNT](#MEASUREMENT_START_SERVICE_COUNT:kotlin.Int) Key for a measurement of the number of times this service was started due to calls to [startService()](../../content/Context.html#startService(android.content.Intent)), including re-launches after crashes. |\n\nConstants\n---------\n\n### MEASUREMENT_LAUNCH_COUNT\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MEASUREMENT_LAUNCH_COUNT: Int\n```\n\nKey for a measurement of the total number of times this service was started due to calls to [startService()](../../content/Context.html#startService(android.content.Intent)) or android.content.Context#bindService including re-launches after crashes. \n\n Value: 50002\n\n### MEASUREMENT_START_SERVICE_COUNT\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MEASUREMENT_START_SERVICE_COUNT: Int\n```\n\nKey for a measurement of the number of times this service was started due to calls to [startService()](../../content/Context.html#startService(android.content.Intent)), including re-launches after crashes. \n\n Value: 50001"]]