summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-08-03 13:57:49 +0100
committerSteve Block <steveblock@google.com>2012-04-12 11:08:13 +0100
commit5ba2efeb9faaf7db9da205102b9a7f40b4b89f27 (patch)
tree06c0f760ff61e68df911f5edf8c6289055444fef
parent7e6ee74ac40396746f814d57160e30543e632c9a (diff)
downloadframeworks_base-5ba2efeb9faaf7db9da205102b9a7f40b4b89f27.zip
frameworks_base-5ba2efeb9faaf7db9da205102b9a7f40b4b89f27.tar.gz
frameworks_base-5ba2efeb9faaf7db9da205102b9a7f40b4b89f27.tar.bz2
Minor clean-up in DeviceOrientation and DeviceMotion
No functional change. See corresponding external/webkit change https://android-git.corp.google.com/g/#change,125700 Change-Id: I2693328cb058820587ac43dd3121818959efd2d0
-rw-r--r--core/java/android/webkit/DeviceMotionAndOrientationManager.java11
-rwxr-xr-xcore/java/android/webkit/DeviceMotionService.java2
-rwxr-xr-xcore/java/android/webkit/DeviceOrientationService.java2
-rw-r--r--core/java/android/webkit/WebViewClassic.java4
-rw-r--r--core/java/android/webkit/WebViewCore.java10
-rw-r--r--tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java2
-rw-r--r--tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java2
7 files changed, 18 insertions, 15 deletions
diff --git a/core/java/android/webkit/DeviceMotionAndOrientationManager.java b/core/java/android/webkit/DeviceMotionAndOrientationManager.java
index 79b78d8..ea1e9ff 100644
--- a/core/java/android/webkit/DeviceMotionAndOrientationManager.java
+++ b/core/java/android/webkit/DeviceMotionAndOrientationManager.java
@@ -22,9 +22,8 @@ package android.webkit;
*
* This could be part of WebViewCore, but have moved it to its own class to
* avoid bloat there.
- * @hide
*/
-public final class DeviceMotionAndOrientationManager {
+final class DeviceMotionAndOrientationManager {
private WebViewCore mWebViewCore;
public DeviceMotionAndOrientationManager(WebViewCore webViewCore) {
@@ -32,12 +31,12 @@ public final class DeviceMotionAndOrientationManager {
}
/**
- * Sets whether the Page for this WebViewCore should use a mock DeviceOrientation
+ * Sets that the Page for this WebViewCore should use a mock DeviceOrientation
* client.
*/
- public void useMock() {
+ public void setUseMock() {
assert WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName());
- nativeUseMock(mWebViewCore);
+ nativeSetUseMock(mWebViewCore);
}
/**
@@ -66,7 +65,7 @@ public final class DeviceMotionAndOrientationManager {
}
// Native functions
- private static native void nativeUseMock(WebViewCore webViewCore);
+ private static native void nativeSetUseMock(WebViewCore webViewCore);
private static native void nativeSetMockOrientation(WebViewCore webViewCore,
boolean canProvideAlpha, double alpha, boolean canProvideBeta, double beta,
boolean canProvideGamma, double gamma);
diff --git a/core/java/android/webkit/DeviceMotionService.java b/core/java/android/webkit/DeviceMotionService.java
index b4d5759..9121429 100755
--- a/core/java/android/webkit/DeviceMotionService.java
+++ b/core/java/android/webkit/DeviceMotionService.java
@@ -153,6 +153,7 @@ final class DeviceMotionService implements SensorEventListener {
* SensorEventListener implementation.
* Callbacks happen on the thread on which we registered - the WebCore thread.
*/
+ @Override
public void onSensorChanged(SensorEvent event) {
assert(event.values.length == 3);
assert WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName());
@@ -170,6 +171,7 @@ final class DeviceMotionService implements SensorEventListener {
}
}
+ @Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
assert WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName());
}
diff --git a/core/java/android/webkit/DeviceOrientationService.java b/core/java/android/webkit/DeviceOrientationService.java
index 47c8ab7..2e8656c 100755
--- a/core/java/android/webkit/DeviceOrientationService.java
+++ b/core/java/android/webkit/DeviceOrientationService.java
@@ -184,6 +184,7 @@ final class DeviceOrientationService implements SensorEventListener {
* SensorEventListener implementation.
* Callbacks happen on the thread on which we registered - the WebCore thread.
*/
+ @Override
public void onSensorChanged(SensorEvent event) {
assert(event.values.length == 3);
assert WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName());
@@ -217,6 +218,7 @@ final class DeviceOrientationService implements SensorEventListener {
}
}
+ @Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
assert WebViewCore.THREAD_NAME.equals(Thread.currentThread().getName());
}
diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java
index 88e1eb7..a7e9fb0 100644
--- a/core/java/android/webkit/WebViewClassic.java
+++ b/core/java/android/webkit/WebViewClassic.java
@@ -5011,8 +5011,8 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
*
* debug only
*/
- public void useMockDeviceOrientation() {
- mWebViewCore.sendMessage(EventHub.USE_MOCK_DEVICE_ORIENTATION);
+ public void setUseMockDeviceOrientation() {
+ mWebViewCore.sendMessage(EventHub.SET_USE_MOCK_DEVICE_ORIENTATION);
}
/**
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index ec2cd5c..580ffae 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -1152,7 +1152,7 @@ public final class WebViewCore {
// accessibility support
static final int MODIFY_SELECTION = 190;
- static final int USE_MOCK_DEVICE_ORIENTATION = 191;
+ static final int SET_USE_MOCK_DEVICE_ORIENTATION = 191;
static final int AUTOFILL_FORM = 192;
@@ -1715,8 +1715,8 @@ public final class WebViewCore {
.sendToTarget();
break;
- case USE_MOCK_DEVICE_ORIENTATION:
- useMockDeviceOrientation();
+ case SET_USE_MOCK_DEVICE_ORIENTATION:
+ setUseMockDeviceOrientation();
break;
case AUTOFILL_FORM:
@@ -3055,8 +3055,8 @@ public final class WebViewCore {
// TODO: Figure out what to do with this (b/6111818)
}
- private void useMockDeviceOrientation() {
- mDeviceMotionAndOrientationManager.useMock();
+ private void setUseMockDeviceOrientation() {
+ mDeviceMotionAndOrientationManager.setUseMock();
}
public void setMockDeviceOrientation(boolean canProvideAlpha, double alpha,
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
index d151d9e..77c0a3f 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
@@ -168,7 +168,7 @@ public class TestShellActivity extends Activity implements LayoutTestController
}
// This is asynchronous, but it gets processed by WebCore before it starts loading pages.
- mWebViewClassic.useMockDeviceOrientation();
+ mWebViewClassic.setUseMockDeviceOrientation();
}
@Override
diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java
index fc22472..f958ade 100644
--- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java
+++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java
@@ -394,7 +394,7 @@ public class LayoutTestsExecutor extends Activity {
webViewSettings.setPageCacheCapacity(0);
// This is asynchronous, but it gets processed by WebCore before it starts loading pages.
- WebViewClassic.fromWebView(mCurrentWebView).useMockDeviceOrientation();
+ WebViewClassic.fromWebView(mCurrentWebView).setUseMockDeviceOrientation();
// Must do this after setting the AppCache path.
WebStorage.getInstance().deleteAllData();