| 15 | using namespace xg::bridge; |
| 16 | |
| 17 | BridgeRailingAndroid::BridgeRailingAndroid(jobject nativeRailObject) { |
| 18 | env_ = GetJniEnvSafe(); |
| 19 | nativeRailObject_ = new xg::jni::ScopedJavaGlobalRef<jobject>(env_, nativeRailObject); |
| 20 | |
| 21 | jclass contextCls = env_->GetObjectClass(nativeRailObject_->obj()); |
| 22 | |
| 23 | if (env_->ExceptionCheck()) { return; } |
| 24 | playAnimation_ = env_->GetMethodID(contextCls, "playAnimation", "(Ljava/lang/String;)V"); |
| 25 | F2ASSERT(playAnimation_, "playAnimation_ method is null"); |
| 26 | |
| 27 | if (env_->ExceptionCheck()) { return; } |
| 28 | swap_ = env_->GetMethodID(contextCls, "swap", "()V"); |
| 29 | F2ASSERT(swap_, "swap_ method is null"); |
| 30 | |
| 31 | if (env_->ExceptionCheck()) { return; } |
| 32 | getTimezoneOffset_ = env_->GetMethodID(contextCls, "getTimezoneOffset", |
| 33 | "(Ljava/lang/String;)J"); |
| 34 | F2ASSERT(getTimezoneOffset_, "getTimezoneOffset_ method is null"); |
| 35 | |
| 36 | if (env_->ExceptionCheck()) { return; } |
| 37 | formatTime_ = env_->GetMethodID(contextCls, "formatTime", |
| 38 | "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"); |
| 39 | F2ASSERT(formatTime_, "formatTime_ method is null"); |
| 40 | } |
| 41 | |
| 42 | BridgeRailingAndroid::~BridgeRailingAndroid() { |
| 43 | XG_RELEASE_POINTER(nativeRailObject_); |
nothing calls this directly
no test coverage detected