1 /*
2  * Copyright (C) 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.view.cts.util;
18 
19 public class FrameCallbackData {
20     static {
21         System.loadLibrary("ctssurfacecontrol_jni");
22     }
23 
24     public static class FrameTimeline {
FrameTimeline(long vsyncId, long expectedPresentTime, long deadline)25         FrameTimeline(long vsyncId, long expectedPresentTime, long deadline) {
26             mVsyncId = vsyncId;
27             mExpectedPresentTime = expectedPresentTime;
28             mDeadline = deadline;
29         }
30 
getVsyncId()31         public long getVsyncId() {
32             return mVsyncId;
33         }
34 
getExpectedPresentTime()35         public long getExpectedPresentTime() {
36             return mExpectedPresentTime;
37         }
38 
getDeadline()39         public long getDeadline() {
40             return mDeadline;
41         }
42 
43         private long mVsyncId;
44         private long mExpectedPresentTime;
45         private long mDeadline;
46     }
47 
FrameCallbackData( FrameTimeline[] frameTimelines, int preferredFrameTimelineIndex)48     FrameCallbackData(
49             FrameTimeline[] frameTimelines, int preferredFrameTimelineIndex) {
50         mFrameTimelines = frameTimelines;
51         mPreferredFrameTimelineIndex = preferredFrameTimelineIndex;
52     }
53 
getFrameTimelines()54     public FrameTimeline[] getFrameTimelines() {
55         return mFrameTimelines;
56     }
57 
getPreferredFrameTimelineIndex()58     public int getPreferredFrameTimelineIndex() {
59         return mPreferredFrameTimelineIndex;
60     }
61 
62     private FrameTimeline[] mFrameTimelines;
63     private int mPreferredFrameTimelineIndex;
64 
nGetFrameTimelines()65     public static native FrameCallbackData nGetFrameTimelines();
66 }
67