• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 // 2021.2.10 Framework adapted to ACE.
5 //           Copyright (c) 2021 Huawei Device Co., Ltd. All rights reserved.
6 
7 #include "flutter/fml/logging.h"
8 #include "flutter/shell/common/ace_display_manager_jni.h"
9 
10 namespace flutter {
11 
12 static fml::jni::ScopedJavaGlobalRef<jclass>* g_vsync_waiter_class = nullptr;
13 
14 // static
Register(JNIEnv * env)15 bool AceDisplayManagerJni::Register(JNIEnv* env)
16 {
17     jclass clazz = env->FindClass("ohos/ace/AceDisplayManager");
18     if (clazz == nullptr) {
19         return false;
20     }
21 
22     g_vsync_waiter_class = new fml::jni::ScopedJavaGlobalRef<jclass>(env, clazz);
23     FML_CHECK(!g_vsync_waiter_class->is_null());
24     return true;
25 }
26 
GetClass()27 fml::jni::ScopedJavaGlobalRef<jclass>* AceDisplayManagerJni::GetClass()
28 {
29     return g_vsync_waiter_class;
30 }
31 
32 } // namespace flutter
33