Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5381)

Unified Diff: device/time_zone_monitor/android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java

Issue 2690963002: [DeviceService] Move //device/time_zone_monitor to //services/device (Closed)
Patch Set: Enable device service to register JNI Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/time_zone_monitor/OWNERS ('k') | device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/time_zone_monitor/android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java
diff --git a/device/time_zone_monitor/android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java b/device/time_zone_monitor/android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java
deleted file mode 100644
index 21c21237df111fcd85545c8f8e913a4946f2d873..0000000000000000000000000000000000000000
--- a/device/time_zone_monitor/android/java/src/org/chromium/device/time_zone_monitor/TimeZoneMonitor.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2014 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.
-
-package org.chromium.device.time_zone_monitor;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-
-import org.chromium.base.Log;
-import org.chromium.base.annotations.CalledByNative;
-import org.chromium.base.annotations.JNINamespace;
-
-/**
- * Android implementation details for device::TimeZoneMonitorAndroid.
- */
-@JNINamespace("device")
-class TimeZoneMonitor {
- private static final String TAG = "cr_TimeZoneMonitor";
-
- private final Context mAppContext;
- private final IntentFilter mFilter = new IntentFilter(Intent.ACTION_TIMEZONE_CHANGED);
- private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (!intent.getAction().equals(Intent.ACTION_TIMEZONE_CHANGED)) {
- Log.e(TAG, "unexpected intent");
- return;
- }
-
- nativeTimeZoneChangedFromJava(mNativePtr);
- }
- };
-
- private long mNativePtr;
-
- /**
- * Start listening for intents.
- * @param nativePtr The native device::TimeZoneMonitorAndroid to notify of time zone changes.
- */
- private TimeZoneMonitor(Context context, long nativePtr) {
- mAppContext = context.getApplicationContext();
- mNativePtr = nativePtr;
- mAppContext.registerReceiver(mBroadcastReceiver, mFilter);
- }
-
- @CalledByNative
- static TimeZoneMonitor getInstance(Context context, long nativePtr) {
- return new TimeZoneMonitor(context, nativePtr);
- }
-
- /**
- * Stop listening for intents.
- */
- @CalledByNative
- void stop() {
- mAppContext.unregisterReceiver(mBroadcastReceiver);
- mNativePtr = 0;
- }
-
- /**
- * Native JNI call to device::TimeZoneMonitorAndroid::TimeZoneChanged.
- * See device/time_zone_monitor/time_zone_monitor_android.cc.
- */
- private native void nativeTimeZoneChangedFromJava(long nativeTimeZoneMonitorAndroid);
-}
« no previous file with comments | « device/time_zone_monitor/OWNERS ('k') | device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698