# FrameDataApi24

Artifact: [androidx.metrics:metrics-performance](https://developer.android.com/jetpack/androidx/releases/metrics) [View Source](https://cs.android.com/search?q=file:androidx/metrics/performance/FrameDataApi24.kt+class:androidx.metrics.performance.FrameDataApi24) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)

*** ** * ** ***


```
public class FrameDataApi24 extends FrameData
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.metrics.performance.FrameData](https://developer.android.com/reference/androidx/metrics/performance/FrameData) ||
|   | ↳ | [androidx.metrics.performance.FrameDataApi24](https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi24) |

Known direct subclasses [FrameDataApi31](https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi31)

|---|---|
| `https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi31` | This class stores duration data for a single frame. |

*** ** * ** ***

This class stores duration data for a single frame.

This subclass of `https://developer.android.com/reference/androidx/metrics/performance/FrameData` adds an additional value for `https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi24#(kotlin.Long,kotlin.Long,kotlin.Long,kotlin.Boolean,kotlin.collections.List)`

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/metrics/performance/JankStats#jankHeuristicMultiplier()` |   |
| `https://developer.android.com/reference/androidx/metrics/performance/PerformanceMetricsState#putState(kotlin.String,kotlin.String)` |   |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi24#FrameDataApi24(kotlin.Long,kotlin.Long,kotlin.Long,kotlin.Boolean,kotlin.collections.List)( long frameStartNanos, long frameDurationUiNanos, long frameDurationCpuNanos, boolean isJank, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/metrics/performance/StateInfo> states )` |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/metrics/performance/FrameData` | `https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi24#copy()()` Utility method which makes a copy of the items in this object (including copying the items in `states` into a new List). |
| `boolean` | `https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi24#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final long` | `https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi24#getFrameDurationCpuNanos()()` The time spent in the non-GPU portions of this frame (in nanoseconds). |
| `int` | `https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi24#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi24#toString()()` |

| ### Inherited methods |
|---|
| From [androidx.metrics.performance.FrameData](https://developer.android.com/reference/androidx/metrics/performance/FrameData) |---|---| | `final long` | `https://developer.android.com/reference/androidx/metrics/performance/FrameData#getFrameDurationUiNanos()()` The time spent in the UI portion of this frame (in nanoseconds). | | `final long` | `https://developer.android.com/reference/androidx/metrics/performance/FrameData#getFrameStartNanos()()` These backing fields are used to enable mutation of an existing FrameData object, to avoid allocating a new object on every frame for sending out to listeners. | | `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/metrics/performance/StateInfo>` | `https://developer.android.com/reference/androidx/metrics/performance/FrameData#getStates()()` The UI/app state during this frame. | | `final boolean` | `https://developer.android.com/reference/androidx/metrics/performance/FrameData#isJank()()` Whether this frame was determined to be janky, meaning that its duration exceeds the duration determined by the system to indicate jank (@see `https://developer.android.com/reference/androidx/metrics/performance/JankStats#jankHeuristicMultiplier()`). | |

## Public constructors

### FrameDataApi24

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)

```
public FrameDataApi24(
    long frameStartNanos,
    long frameDurationUiNanos,
    long frameDurationCpuNanos,
    boolean isJank,
    @NonNull List<@NonNull StateInfo> states
)
```

## Public methods

### copy

```
public @NonNull FrameData copy()
```

Utility method which makes a copy of the items in this object (including copying the items in `states` into a new List). This is used internally to create a copy to pass along to listeners to avoid having a reference to the internally-mutable FrameData object.

### equals

```
public boolean equals(Object other)
```

### getFrameDurationCpuNanos

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/metrics#1.0.0)

```
public final long getFrameDurationCpuNanos()
```

The time spent in the non-GPU portions of this frame (in nanoseconds). This includes the time spent on the UI thread `https://developer.android.com/reference/androidx/metrics/performance/FrameDataApi24#(kotlin.Long,kotlin.Long,kotlin.Long,kotlin.Boolean,kotlin.collections.List)` plus time spent on the RenderThread.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```