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

Unified Diff: services/device/screen_orientation/android/java/src/org/chromium/device/screen_orientation/ScreenOrientationListener.java

Issue 2745443002: [Device Service] Port ScreenOrientationListener into Device Service. (Closed)
Patch Set: Add DEPS Created 3 years, 9 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
Index: services/device/screen_orientation/android/java/src/org/chromium/device/screen_orientation/ScreenOrientationListener.java
diff --git a/services/device/screen_orientation/android/java/src/org/chromium/device/screen_orientation/ScreenOrientationListener.java b/services/device/screen_orientation/android/java/src/org/chromium/device/screen_orientation/ScreenOrientationListener.java
new file mode 100644
index 0000000000000000000000000000000000000000..6d878a98ff905b02bd01085f7d5efe6ef7857ac2
--- /dev/null
+++ b/services/device/screen_orientation/android/java/src/org/chromium/device/screen_orientation/ScreenOrientationListener.java
@@ -0,0 +1,36 @@
+// Copyright 2017 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.screen_orientation;
+
+import org.chromium.base.ThreadUtils;
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.annotations.JNINamespace;
+import org.chromium.ui.display.DisplayAndroid;
+
+/**
+ * Android implementation details for device::ScreenOrientationListenerAndroid.
+ */
+@JNINamespace("device")
+class ScreenOrientationListener {
+ @CalledByNative
+ static void startAccurateListening() {
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ DisplayAndroid.startAccurateListening();
+ }
+ });
+ }
+
+ @CalledByNative
+ static void stopAccurateListening() {
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ DisplayAndroid.stopAccurateListening();
+ }
+ });
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698