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 #define LOG_TAG "GameManagerService"
18 
19 #include <android/log.h>
20 #include <gui/SurfaceComposerClient.h>
21 #include <log/log.h>
22 #include <nativehelper/JNIHelp.h>
23 
24 #include "jni.h"
25 
26 namespace android {
27 
android_server_app_GameManagerService_nativeSetOverrideFrameRate(JNIEnv * env,jclass clazz,jint uid,jfloat frameRate)28 static void android_server_app_GameManagerService_nativeSetOverrideFrameRate(JNIEnv* env,
29                                                                              jclass clazz, jint uid,
30                                                                              jfloat frameRate) {
31     SurfaceComposerClient::setOverrideFrameRate(uid, frameRate);
32 }
33 
34 static const JNINativeMethod gMethods[] = {
35         {"nativeSetOverrideFrameRate", "(IF)V",
36          (void*)android_server_app_GameManagerService_nativeSetOverrideFrameRate},
37 };
38 
register_android_server_app_GameManagerService(JNIEnv * env)39 int register_android_server_app_GameManagerService(JNIEnv* env) {
40     return jniRegisterNativeMethods(env, "com/android/server/app/GameManagerService", gMethods,
41                                     NELEM(gMethods));
42 }
43 
44 }; // namespace android