blob: 05d8e95ff921689e3051d89803e9a673188504e1 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromecast/base/android/system_time_change_notifier_android.h"
#include "jni/SystemTimeChangeNotifierAndroid_jni.h"
using base::android::JavaParamRef;
namespace chromecast {
SystemTimeChangeNotifierAndroid::SystemTimeChangeNotifierAndroid() {
}
SystemTimeChangeNotifierAndroid::~SystemTimeChangeNotifierAndroid() {
}
void SystemTimeChangeNotifierAndroid::Initialize() {
JNIEnv* env = base::android::AttachCurrentThread();
java_notifier_.Reset(Java_SystemTimeChangeNotifierAndroid_create(env));
Java_SystemTimeChangeNotifierAndroid_initializeFromNative(
env, java_notifier_, reinterpret_cast<jlong>(this));
}
void SystemTimeChangeNotifierAndroid::Finalize() {
JNIEnv* env = base::android::AttachCurrentThread();
Java_SystemTimeChangeNotifierAndroid_finalizeFromNative(env, java_notifier_);
}
void SystemTimeChangeNotifierAndroid::OnTimeChanged(
JNIEnv* env,
const JavaParamRef<jobject>& jobj) {
NotifySystemTimeChanged();
}
} // namespace chromecast