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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ScreenOrientationProvider.java

Issue 398013002: Poll for Display rotation on Android 4.0 and 4.1 when needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: call ScreenOrientationListener on UI thread Created 6 years, 4 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: content/public/android/java/src/org/chromium/content/browser/ScreenOrientationProvider.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ScreenOrientationProvider.java b/content/public/android/java/src/org/chromium/content/browser/ScreenOrientationProvider.java
index 53c8c0f8452708e6dfdb5782150122153bc9d442..c90adc17d68ac066d1468b3c48b9b7500b4f3696 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ScreenOrientationProvider.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ScreenOrientationProvider.java
@@ -12,6 +12,7 @@ import android.util.Log;
import org.chromium.base.ApplicationStatus;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
+import org.chromium.base.ThreadUtils;
import org.chromium.content.common.ScreenOrientationValues;
/**
@@ -80,6 +81,26 @@ class ScreenOrientationProvider {
}
}
+ @CalledByNative
+ static void startAccurateListening() {
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ ScreenOrientationListener.getInstance().startAccurateListening();
+ }
+ });
+ }
+
+ @CalledByNative
+ static void stopAccurateListening() {
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ ScreenOrientationListener.getInstance().stopAccurateListening();
+ }
+ });
+ }
+
private ScreenOrientationProvider() {
}
}

Powered by Google App Engine
This is Rietveld 408576698