Commit f1ad9c7b authored by aurimas@chromium.org's avatar aurimas@chromium.org

[Checkstyle] Update static variable and constant names to match style guides.

- Static field names start with s.
- static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.
http://source.android.com/source/code-style.html#follow-field-naming-conventions

BUG=318404
TBR=qinmin

Review URL: https://codereview.chromium.org/455523002

Cr-Commit-Position: refs/heads/master@{#288416}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288416 0039d316-1c4b-4281-b951-d872f2087c98
parent 0ada5a71
...@@ -26,17 +26,17 @@ public class AwResource { ...@@ -26,17 +26,17 @@ public class AwResource {
// Raw resource ID for an HTML page to be displayed in the case of // Raw resource ID for an HTML page to be displayed in the case of
// a specific load error. // a specific load error.
private static int RAW_LOAD_ERROR; private static int sRawLoadError;
// Raw resource ID for an HTML page to be displayed in the case of // Raw resource ID for an HTML page to be displayed in the case of
// a generic load error. (It's called NO_DOMAIN for legacy reasons). // a generic load error. (It's called NO_DOMAIN for legacy reasons).
private static int RAW_NO_DOMAIN; private static int sRawNoDomain;
// String resource ID for the default text encoding to use. // String resource ID for the default text encoding to use.
private static int STRING_DEFAULT_TEXT_ENCODING; private static int sStringDefaultTextEncoding;
// Array resource ID for the configuration of platform specific key-systems. // Array resource ID for the configuration of platform specific key-systems.
private static int STRING_ARRAY_CONFIG_KEY_SYSTEM_UUID_MAPPING; private static int sStringArrayConfigKeySystemUUIDMapping;
// The embedder should inject a Resources object that will be used // The embedder should inject a Resources object that will be used
// to resolve Resource IDs into the actual resources. // to resolve Resource IDs into the actual resources.
...@@ -54,36 +54,36 @@ public class AwResource { ...@@ -54,36 +54,36 @@ public class AwResource {
} }
public static void setErrorPageResources(int loaderror, int nodomain) { public static void setErrorPageResources(int loaderror, int nodomain) {
RAW_LOAD_ERROR = loaderror; sRawLoadError = loaderror;
RAW_NO_DOMAIN = nodomain; sRawNoDomain = nodomain;
} }
public static void setDefaultTextEncoding(int encoding) { public static void setDefaultTextEncoding(int encoding) {
STRING_DEFAULT_TEXT_ENCODING = encoding; sStringDefaultTextEncoding = encoding;
} }
public static void setConfigKeySystemUuidMapping(int config) { public static void setConfigKeySystemUuidMapping(int config) {
STRING_ARRAY_CONFIG_KEY_SYSTEM_UUID_MAPPING = config; sStringArrayConfigKeySystemUUIDMapping = config;
} }
@CalledByNative @CalledByNative
public static String getDefaultTextEncoding() { public static String getDefaultTextEncoding() {
return getResource(STRING_DEFAULT_TEXT_ENCODING, TYPE_STRING); return getResource(sStringDefaultTextEncoding, TYPE_STRING);
} }
@CalledByNative @CalledByNative
public static String getNoDomainPageContent() { public static String getNoDomainPageContent() {
return getResource(RAW_NO_DOMAIN, TYPE_RAW); return getResource(sRawNoDomain, TYPE_RAW);
} }
@CalledByNative @CalledByNative
public static String getLoadErrorPageContent() { public static String getLoadErrorPageContent() {
return getResource(RAW_LOAD_ERROR, TYPE_RAW); return getResource(sRawLoadError, TYPE_RAW);
} }
public static String[] getConfigKeySystemUuidMapping() { public static String[] getConfigKeySystemUuidMapping() {
// No need to cache, since this should be called only once. // No need to cache, since this should be called only once.
return sResources.getStringArray(STRING_ARRAY_CONFIG_KEY_SYSTEM_UUID_MAPPING); return sResources.getStringArray(sStringArrayConfigKeySystemUUIDMapping);
} }
private static String getResource(int resid, int type) { private static String getResource(int resid, int type) {
......
...@@ -17,7 +17,7 @@ import org.chromium.base.ThreadUtils; ...@@ -17,7 +17,7 @@ import org.chromium.base.ThreadUtils;
*/ */
@JNINamespace("android_webview") @JNINamespace("android_webview")
public class AwPermissionRequest { public class AwPermissionRequest {
private static String TAG = "AwPermissionRequest"; private static final String TAG = "AwPermissionRequest";
private Uri mOrigin; private Uri mOrigin;
private long mResources; private long mResources;
......
...@@ -118,7 +118,7 @@ public class AwContentsClientShouldInterceptRequestTest extends AwTestBase { ...@@ -118,7 +118,7 @@ public class AwContentsClientShouldInterceptRequestTest extends AwTestBase {
} }
private static final int TEAPOT_STATUS_CODE = 418; private static final int TEAPOT_STATUS_CODE = 418;
private static final String TEAPOD_RESPONSE_PHRASE = "I'm a teapot"; private static final String TEAPOT_RESPONSE_PHRASE = "I'm a teapot";
private String addPageToTestServer(TestWebServer webServer, String httpPath, String html) { private String addPageToTestServer(TestWebServer webServer, String httpPath, String html) {
List<Pair<String, String>> headers = new ArrayList<Pair<String, String>>(); List<Pair<String, String>> headers = new ArrayList<Pair<String, String>>();
...@@ -492,8 +492,8 @@ public class AwContentsClientShouldInterceptRequestTest extends AwTestBase { ...@@ -492,8 +492,8 @@ public class AwContentsClientShouldInterceptRequestTest extends AwTestBase {
mShouldInterceptRequestHelper.setReturnValue( mShouldInterceptRequestHelper.setReturnValue(
new AwWebResourceResponse("text/html", "UTF-8", new EmptyInputStream(), new AwWebResourceResponse("text/html", "UTF-8", new EmptyInputStream(),
TEAPOT_STATUS_CODE, TEAPOD_RESPONSE_PHRASE, new HashMap<String, String>())); TEAPOT_STATUS_CODE, TEAPOT_RESPONSE_PHRASE, new HashMap<String, String>()));
assertEquals("\"[" + TEAPOT_STATUS_CODE + "][" + TEAPOD_RESPONSE_PHRASE + "]\"", assertEquals("\"[" + TEAPOT_STATUS_CODE + "][" + TEAPOT_RESPONSE_PHRASE + "]\"",
executeJavaScriptAndWaitForResult(mAwContents, mContentsClient, syncGetJs)); executeJavaScriptAndWaitForResult(mAwContents, mContentsClient, syncGetJs));
} }
......
...@@ -24,7 +24,7 @@ import java.util.concurrent.Callable; ...@@ -24,7 +24,7 @@ import java.util.concurrent.Callable;
public class AwZoomTest extends AwTestBase { public class AwZoomTest extends AwTestBase {
private TestAwContentsClient mContentsClient; private TestAwContentsClient mContentsClient;
private AwContents mAwContents; private AwContents mAwContents;
private static float MAXIMUM_SCALE = 2.0f; private static final float MAXIMUM_SCALE = 2.0f;
@Override @Override
public void setUp() throws Exception { public void setUp() throws Exception {
......
...@@ -32,7 +32,7 @@ public class MediaAccessPermissionRequestTest extends AwTestBase { ...@@ -32,7 +32,7 @@ public class MediaAccessPermissionRequestTest extends AwTestBase {
} }
} }
private static final String mData = "<html> <script> " + private static final String DATA = "<html> <script> " +
"var constraints = {audio: true, video: true};" + "var constraints = {audio: true, video: true};" +
"var video = document.querySelector('video');" + "var video = document.querySelector('video');" +
"function successCallback(stream) {" + "function successCallback(stream) {" +
...@@ -59,7 +59,7 @@ public class MediaAccessPermissionRequestTest extends AwTestBase { ...@@ -59,7 +59,7 @@ public class MediaAccessPermissionRequestTest extends AwTestBase {
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
mTestWebServer = new TestWebServer(false); mTestWebServer = new TestWebServer(false);
mWebRTCPage = mTestWebServer.setResponse("/WebRTC", mData, mWebRTCPage = mTestWebServer.setResponse("/WebRTC", DATA,
CommonResources.getTextHtmlHeaders(true)); CommonResources.getTextHtmlHeaders(true));
} }
......
...@@ -30,8 +30,8 @@ public class WebKitHitTestTest extends AwTestBase { ...@@ -30,8 +30,8 @@ public class WebKitHitTestTest extends AwTestBase {
private AwContents mAwContents; private AwContents mAwContents;
private TestWebServer mWebServer; private TestWebServer mWebServer;
private static String HREF = "http://foo/"; private static final String HREF = "http://foo/";
private static String ANCHOR_TEXT = "anchor text"; private static final String ANCHOR_TEXT = "anchor text";
@Override @Override
public void setUp() throws Exception { public void setUp() throws Exception {
......
...@@ -41,7 +41,7 @@ public class PrintingControllerTest extends ChromeShellTestBase { ...@@ -41,7 +41,7 @@ public class PrintingControllerTest extends ChromeShellTestBase {
private static final String URL = UrlUtils.encodeHtmlDataUri( private static final String URL = UrlUtils.encodeHtmlDataUri(
"<html><head></head><body>foo</body></html>"); "<html><head></head><body>foo</body></html>");
private static final String PDF_PREAMBLE = "%PDF-1"; private static final String PDF_PREAMBLE = "%PDF-1";
private static long TEST_TIMEOUT = 20000L; private static final long TEST_TIMEOUT = 20000L;
private static class LayoutResultCallbackWrapperMock implements private static class LayoutResultCallbackWrapperMock implements
PrintDocumentAdapterWrapper.LayoutResultCallbackWrapper { PrintDocumentAdapterWrapper.LayoutResultCallbackWrapper {
......
...@@ -14,13 +14,13 @@ import org.chromium.chrome.browser.infobar.TranslateOptions; ...@@ -14,13 +14,13 @@ import org.chromium.chrome.browser.infobar.TranslateOptions;
* Test for TranslateOptions. * Test for TranslateOptions.
*/ */
public class TranslateOptionsTest extends AndroidTestCase { public class TranslateOptionsTest extends AndroidTestCase {
private static final String[] languages = {"English", "Spanish", "French"}; private static final String[] LANGUAGES = {"English", "Spanish", "French"};
private static final boolean ALWAYS_TRANSLATE = true; private static final boolean ALWAYS_TRANSLATE = true;
@SmallTest @SmallTest
@Feature({"Translate"}) @Feature({"Translate"})
public void testNoChanges() { public void testNoChanges() {
TranslateOptions options = new TranslateOptions(0, 1, languages, ALWAYS_TRANSLATE, false); TranslateOptions options = new TranslateOptions(0, 1, LANGUAGES, ALWAYS_TRANSLATE, false);
assertEquals("English", options.sourceLanguage()); assertEquals("English", options.sourceLanguage());
assertEquals("Spanish", options.targetLanguage()); assertEquals("Spanish", options.targetLanguage());
assertEquals(0, options.sourceLanguageIndex()); assertEquals(0, options.sourceLanguageIndex());
...@@ -34,7 +34,7 @@ public class TranslateOptionsTest extends AndroidTestCase { ...@@ -34,7 +34,7 @@ public class TranslateOptionsTest extends AndroidTestCase {
@SmallTest @SmallTest
@Feature({"Translate"}) @Feature({"Translate"})
public void testBasicLanguageChanges() { public void testBasicLanguageChanges() {
TranslateOptions options = new TranslateOptions(0, 1, languages, !ALWAYS_TRANSLATE, true); TranslateOptions options = new TranslateOptions(0, 1, LANGUAGES, !ALWAYS_TRANSLATE, true);
options.setTargetLanguage(2); options.setTargetLanguage(2);
options.setSourceLanguage(1); options.setSourceLanguage(1);
assertEquals("Spanish", options.sourceLanguage()); assertEquals("Spanish", options.sourceLanguage());
...@@ -53,7 +53,7 @@ public class TranslateOptionsTest extends AndroidTestCase { ...@@ -53,7 +53,7 @@ public class TranslateOptionsTest extends AndroidTestCase {
@SmallTest @SmallTest
@Feature({"Translate"}) @Feature({"Translate"})
public void testInvalidLanguageChanges() { public void testInvalidLanguageChanges() {
TranslateOptions options = new TranslateOptions(0, 1, languages, ALWAYS_TRANSLATE, false); TranslateOptions options = new TranslateOptions(0, 1, LANGUAGES, ALWAYS_TRANSLATE, false);
// Same target language as source // Same target language as source
assertFalse(options.setTargetLanguage(0)); assertFalse(options.setTargetLanguage(0));
...@@ -75,7 +75,7 @@ public class TranslateOptionsTest extends AndroidTestCase { ...@@ -75,7 +75,7 @@ public class TranslateOptionsTest extends AndroidTestCase {
@SmallTest @SmallTest
@Feature({"Translate"}) @Feature({"Translate"})
public void testBasicOptionsChanges() { public void testBasicOptionsChanges() {
TranslateOptions options = new TranslateOptions(0, 1, languages, !ALWAYS_TRANSLATE, false); TranslateOptions options = new TranslateOptions(0, 1, LANGUAGES, !ALWAYS_TRANSLATE, false);
assertFalse(options.optionsChanged()); assertFalse(options.optionsChanged());
options.toggleNeverTranslateDomainState(true); options.toggleNeverTranslateDomainState(true);
assertTrue(options.neverTranslateDomainState()); assertTrue(options.neverTranslateDomainState());
...@@ -99,7 +99,7 @@ public class TranslateOptionsTest extends AndroidTestCase { ...@@ -99,7 +99,7 @@ public class TranslateOptionsTest extends AndroidTestCase {
@SmallTest @SmallTest
@Feature({"Translate"}) @Feature({"Translate"})
public void testInvalidOptionsChanges() { public void testInvalidOptionsChanges() {
TranslateOptions options = new TranslateOptions(0, 1, languages, ALWAYS_TRANSLATE, false); TranslateOptions options = new TranslateOptions(0, 1, LANGUAGES, ALWAYS_TRANSLATE, false);
// Never translate language should not work, but never translate domain should // Never translate language should not work, but never translate domain should
assertFalse(options.toggleNeverTranslateLanguageState(true)); assertFalse(options.toggleNeverTranslateLanguageState(true));
......
...@@ -15,7 +15,7 @@ import java.util.concurrent.TimeUnit; ...@@ -15,7 +15,7 @@ import java.util.concurrent.TimeUnit;
*/ */
public class InfoBarTestAnimationListener implements InfoBarContainer.InfoBarAnimationListener { public class InfoBarTestAnimationListener implements InfoBarContainer.InfoBarAnimationListener {
private static long WAIT_MILLIS = TimeUnit.SECONDS.toMillis(5); private static final long WAIT_MILLIS = TimeUnit.SECONDS.toMillis(5);
private static class ConditionalWait { private static class ConditionalWait {
private volatile Boolean mCondition; private volatile Boolean mCondition;
...@@ -33,7 +33,7 @@ public class InfoBarTestAnimationListener implements InfoBarContainer.InfoBarAni ...@@ -33,7 +33,7 @@ public class InfoBarTestAnimationListener implements InfoBarContainer.InfoBarAni
* @return true if the condition becomes true before the specified {@code millis}. * @return true if the condition becomes true before the specified {@code millis}.
*/ */
public boolean waitAndExpire(long millis) throws InterruptedException { public boolean waitAndExpire(long millis) throws InterruptedException {
synchronized(mLock) { synchronized (mLock) {
while (!mCondition && millis > 0) { while (!mCondition && millis > 0) {
long start = SystemClock.elapsedRealtime(); long start = SystemClock.elapsedRealtime();
mLock.wait(millis); mLock.wait(millis);
...@@ -46,7 +46,7 @@ public class InfoBarTestAnimationListener implements InfoBarContainer.InfoBarAni ...@@ -46,7 +46,7 @@ public class InfoBarTestAnimationListener implements InfoBarContainer.InfoBarAni
} }
public void set(boolean value) { public void set(boolean value) {
synchronized(mLock) { synchronized (mLock) {
mCondition = value; mCondition = value;
if (value) { if (value) {
mLock.notify(); mLock.notify();
......
...@@ -428,11 +428,11 @@ public class JavaBridgeBasicsTest extends JavaBridgeTestBase { ...@@ -428,11 +428,11 @@ public class JavaBridgeBasicsTest extends JavaBridgeTestBase {
class TestObject { class TestObject {
public InnerObject getInnerObject() { public InnerObject getInnerObject() {
InnerObject inner = new InnerObject(); InnerObject inner = new InnerObject();
weakRefForInner = new WeakReference<InnerObject>(inner); mWeakRefForInner = new WeakReference<InnerObject>(inner);
return inner; return inner;
} }
// A weak reference is used to check InnerObject instance reachability. // A weak reference is used to check InnerObject instance reachability.
WeakReference<InnerObject> weakRefForInner; WeakReference<InnerObject> mWeakRefForInner;
} }
TestObject object = new TestObject(); TestObject object = new TestObject();
injectObjectAndReload(object, "testObject"); injectObjectAndReload(object, "testObject");
...@@ -442,12 +442,12 @@ public class JavaBridgeBasicsTest extends JavaBridgeTestBase { ...@@ -442,12 +442,12 @@ public class JavaBridgeBasicsTest extends JavaBridgeTestBase {
"(function() { " + "(function() { " +
"globalInner = testObject.getInnerObject(); return typeof globalInner; " + "globalInner = testObject.getInnerObject(); return typeof globalInner; " +
"})()")); "})()"));
assertTrue(object.weakRefForInner.get() != null); assertTrue(object.mWeakRefForInner.get() != null);
// Check that returned Java object is being held by the Java bridge, thus it's not // Check that returned Java object is being held by the Java bridge, thus it's not
// collected. Note that despite that what JavaDoc says about invoking "gc()", both Dalvik // collected. Note that despite that what JavaDoc says about invoking "gc()", both Dalvik
// and ART actually run the collector. // and ART actually run the collector.
Runtime.getRuntime().gc(); Runtime.getRuntime().gc();
assertTrue(object.weakRefForInner.get() != null); assertTrue(object.mWeakRefForInner.get() != null);
// Now dereference the inner object in JS and run GC to collect the interface object. // Now dereference the inner object in JS and run GC to collect the interface object.
assertEquals("true", executeJavaScriptAndGetStringResult( assertEquals("true", executeJavaScriptAndGetStringResult(
"(function() { " + "(function() { " +
...@@ -456,7 +456,7 @@ public class JavaBridgeBasicsTest extends JavaBridgeTestBase { ...@@ -456,7 +456,7 @@ public class JavaBridgeBasicsTest extends JavaBridgeTestBase {
// Force GC on the Java side again. The bridge had to release the inner object, so it must // Force GC on the Java side again. The bridge had to release the inner object, so it must
// be collected this time. // be collected this time.
Runtime.getRuntime().gc(); Runtime.getRuntime().gc();
assertEquals(null, object.weakRefForInner.get()); assertEquals(null, object.mWeakRefForInner.get());
} }
@SmallTest @SmallTest
......
...@@ -22,9 +22,9 @@ import org.chromium.base.test.util.Feature; ...@@ -22,9 +22,9 @@ import org.chromium.base.test.util.Feature;
*/ */
public class JavaBridgeCoercionTest extends JavaBridgeTestBase { public class JavaBridgeCoercionTest extends JavaBridgeTestBase {
private class TestObject extends Controller { private class TestObject extends Controller {
private Object objectInstance; private Object mObjectInstance;
private CustomType customTypeInstance; private CustomType mCustomTypeInstance;
private CustomType2 customType2Instance; private CustomType2 mCustomType2Instance;
private boolean mBooleanValue; private boolean mBooleanValue;
private byte mByteValue; private byte mByteValue;
...@@ -39,19 +39,19 @@ public class JavaBridgeCoercionTest extends JavaBridgeTestBase { ...@@ -39,19 +39,19 @@ public class JavaBridgeCoercionTest extends JavaBridgeTestBase {
private CustomType mCustomTypeValue; private CustomType mCustomTypeValue;
public TestObject() { public TestObject() {
objectInstance = new Object(); mObjectInstance = new Object();
customTypeInstance = new CustomType(); mCustomTypeInstance = new CustomType();
customType2Instance = new CustomType2(); mCustomType2Instance = new CustomType2();
} }
public Object getObjectInstance() { public Object getObjectInstance() {
return objectInstance; return mObjectInstance;
} }
public CustomType getCustomTypeInstance() { public CustomType getCustomTypeInstance() {
return customTypeInstance; return mCustomTypeInstance;
} }
public CustomType2 getCustomType2Instance() { public CustomType2 getCustomType2Instance() {
return customType2Instance; return mCustomType2Instance;
} }
public synchronized void setBooleanValue(boolean x) { public synchronized void setBooleanValue(boolean x) {
......
...@@ -11,24 +11,24 @@ import android.test.suitebuilder.annotation.SmallTest; ...@@ -11,24 +11,24 @@ import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
public class InputDialogContainerTest extends AndroidTestCase { public class InputDialogContainerTest extends AndroidTestCase {
private static int TEXT_INPUT_TYPE_DATE = 0; private static final int TEXT_INPUT_TYPE_DATE = 0;
private static int TEXT_INPUT_TYPE_DATETIME = 1; private static final int TEXT_INPUT_TYPE_DATETIME = 1;
private static int TEXT_INPUT_TYPE_DATETIMELOCAL = 2; private static final int TEXT_INPUT_TYPE_DATETIMELOCAL = 2;
private static int TEXT_INPUT_TYPE_MONTH = 3; private static final int TEXT_INPUT_TYPE_MONTH = 3;
private static int TEXT_INPUT_TYPE_TIME = 4; private static final int TEXT_INPUT_TYPE_TIME = 4;
private static int TEXT_INPUT_TYPE_WEEK = 5; private static final int TEXT_INPUT_TYPE_WEEK = 5;
// Defined in third_party/WebKit/Source/platform/DateComponents.h // Defined in third_party/WebKit/Source/platform/DateComponents.h
private static double DATE_DIALOG_DEFAULT_MIN = -62135596800000.0; private static final double DATE_DIALOG_DEFAULT_MIN = -62135596800000.0;
private static double DATE_DIALOG_DEFAULT_MAX = 8640000000000000.0; private static final double DATE_DIALOG_DEFAULT_MAX = 8640000000000000.0;
private static double DATETIMELOCAL_DIALOG_DEFAULT_MIN = -62135596800000.0; private static final double DATETIMELOCAL_DIALOG_DEFAULT_MIN = -62135596800000.0;
private static double DATETIMELOCAL_DIALOG_DEFAULT_MAX = 8640000000000000.0; private static final double DATETIMELOCAL_DIALOG_DEFAULT_MAX = 8640000000000000.0;
private static double MONTH_DIALOG_DEFAULT_MIN = -23628.0; private static final double MONTH_DIALOG_DEFAULT_MIN = -23628.0;
private static double MONTH_DIALOG_DEFAULT_MAX = 3285488.0; private static final double MONTH_DIALOG_DEFAULT_MAX = 3285488.0;
private static double TIME_DIALOG_DEFAULT_MIN = 0.0; private static final double TIME_DIALOG_DEFAULT_MIN = 0.0;
private static double TIME_DIALOG_DEFAULT_MAX = 86399999.0; private static final double TIME_DIALOG_DEFAULT_MAX = 86399999.0;
private static double WEEK_DIALOG_DEFAULT_MIN = -62135596800000.0; private static final double WEEK_DIALOG_DEFAULT_MIN = -62135596800000.0;
private static double WEEK_DIALOG_DEFAULT_MAX = 8639999568000000.0; private static final double WEEK_DIALOG_DEFAULT_MAX = 8639999568000000.0;
InputActionDelegateForTests mInputActionDelegate; InputActionDelegateForTests mInputActionDelegate;
InputDialogContainerForTests mInputDialogContainer; InputDialogContainerForTests mInputDialogContainer;
...@@ -332,7 +332,7 @@ public class InputDialogContainerTest extends AndroidTestCase { ...@@ -332,7 +332,7 @@ public class InputDialogContainerTest extends AndroidTestCase {
@Override @Override
public void cancelDateTimeDialog() { public void cancelDateTimeDialog() {
} }
}; }
private static class InputDialogContainerForTests extends InputDialogContainer { private static class InputDialogContainerForTests extends InputDialogContainer {
private int mExpectedDialogType; private int mExpectedDialogType;
...@@ -391,6 +391,7 @@ public class InputDialogContainerTest extends AndroidTestCase { ...@@ -391,6 +391,7 @@ public class InputDialogContainerTest extends AndroidTestCase {
assertEquals(mExpectedStep, step); assertEquals(mExpectedStep, step);
} }
@Override
public void setFieldDateTimeValue(int dialogType, public void setFieldDateTimeValue(int dialogType,
int year, int month, int monthDay, int year, int month, int monthDay,
int hourOfDay, int minute, int second, int millis, int hourOfDay, int minute, int second, int millis,
......
...@@ -28,7 +28,7 @@ class NestedSystemMessageHandler { ...@@ -28,7 +28,7 @@ class NestedSystemMessageHandler {
// See org.chromium.base.SystemMessageHandler for more message ids. // See org.chromium.base.SystemMessageHandler for more message ids.
// The id here should not conflict with the ones in SystemMessageHandler. // The id here should not conflict with the ones in SystemMessageHandler.
private static final int QUIT_MESSAGE = 10; private static final int QUIT_MESSAGE = 10;
private static final Handler mHandler = new Handler(); private static final Handler sHandler = new Handler();
private NestedSystemMessageHandler() { private NestedSystemMessageHandler() {
} }
...@@ -45,7 +45,7 @@ class NestedSystemMessageHandler { ...@@ -45,7 +45,7 @@ class NestedSystemMessageHandler {
queue.addIdleHandler(new MessageQueue.IdleHandler() { queue.addIdleHandler(new MessageQueue.IdleHandler() {
@Override @Override
public boolean queueIdle() { public boolean queueIdle() {
mHandler.sendMessage(mHandler.obtainMessage(QUIT_MESSAGE)); sHandler.sendMessage(sHandler.obtainMessage(QUIT_MESSAGE));
return false; return false;
} }
}); });
......
...@@ -20,7 +20,7 @@ public class MockLocationProvider implements LocationProviderFactory.LocationPro ...@@ -20,7 +20,7 @@ public class MockLocationProvider implements LocationProviderFactory.LocationPro
private boolean mIsRunning; private boolean mIsRunning;
private Handler mHandler; private Handler mHandler;
private HandlerThread mHandlerThread; private HandlerThread mHandlerThread;
private static final Object mLock = new Object(); private final Object mLock = new Object();
private static final int UPDATE_LOCATION_MSG = 100; private static final int UPDATE_LOCATION_MSG = 100;
......
...@@ -40,18 +40,18 @@ public class VideoCaptureAndroid extends VideoCapture { ...@@ -40,18 +40,18 @@ public class VideoCaptureAndroid extends VideoCapture {
public final int mMinHeight; public final int mMinHeight;
} }
private static final IdAndSizes s_CAPTURESIZE_BUGGY_DEVICE_LIST[] = { private static final IdAndSizes CAPTURESIZE_BUGGY_DEVICE_LIST[] = {
new IdAndSizes("Nexus 7", "flo", 640, 480) new IdAndSizes("Nexus 7", "flo", 640, 480)
}; };
private static final String[] s_COLORSPACE_BUGGY_DEVICE_LIST = { private static final String[] COLORSPACE_BUGGY_DEVICE_LIST = {
"SAMSUNG-SGH-I747", "SAMSUNG-SGH-I747",
"ODROID-U2", "ODROID-U2",
}; };
static void applyMinDimensions(CaptureFormat format) { static void applyMinDimensions(CaptureFormat format) {
// NOTE: this can discard requested aspect ratio considerations. // NOTE: this can discard requested aspect ratio considerations.
for (IdAndSizes buggyDevice : s_CAPTURESIZE_BUGGY_DEVICE_LIST) { for (IdAndSizes buggyDevice : CAPTURESIZE_BUGGY_DEVICE_LIST) {
if (buggyDevice.mModel.contentEquals(android.os.Build.MODEL) && if (buggyDevice.mModel.contentEquals(android.os.Build.MODEL) &&
buggyDevice.mDevice.contentEquals(android.os.Build.DEVICE)) { buggyDevice.mDevice.contentEquals(android.os.Build.DEVICE)) {
format.mWidth = (buggyDevice.mMinWidth > format.mWidth) format.mWidth = (buggyDevice.mMinWidth > format.mWidth)
...@@ -67,7 +67,7 @@ public class VideoCaptureAndroid extends VideoCapture { ...@@ -67,7 +67,7 @@ public class VideoCaptureAndroid extends VideoCapture {
return ImageFormat.NV21; return ImageFormat.NV21;
} }
for (String buggyDevice : s_COLORSPACE_BUGGY_DEVICE_LIST) { for (String buggyDevice : COLORSPACE_BUGGY_DEVICE_LIST) {
if (buggyDevice.contentEquals(android.os.Build.MODEL)) { if (buggyDevice.contentEquals(android.os.Build.MODEL)) {
return ImageFormat.NV21; return ImageFormat.NV21;
} }
......
...@@ -48,7 +48,7 @@ class VideoCaptureFactory { ...@@ -48,7 +48,7 @@ class VideoCaptureFactory {
// Special devices have more cameras than usual. Those devices are // Special devices have more cameras than usual. Those devices are
// identified by model & device. Currently only the Tango is supported. // identified by model & device. Currently only the Tango is supported.
// Note that these devices have no Camera.CameraInfo. // Note that these devices have no Camera.CameraInfo.
private static final String[][] s_SPECIAL_DEVICE_LIST = { private static final String[][] SPECIAL_DEVICE_LIST = {
{"Peanut", "peanut"}, {"Peanut", "peanut"},
}; };
private static final String TAG = "ChromiumCameraInfo"; private static final String TAG = "ChromiumCameraInfo";
...@@ -56,7 +56,7 @@ class VideoCaptureFactory { ...@@ -56,7 +56,7 @@ class VideoCaptureFactory {
private static int sNumberOfSystemCameras = -1; private static int sNumberOfSystemCameras = -1;
private static boolean isSpecialDevice() { private static boolean isSpecialDevice() {
for (String[] device : s_SPECIAL_DEVICE_LIST) { for (String[] device : SPECIAL_DEVICE_LIST) {
if (device[0].contentEquals(android.os.Build.MODEL) && if (device[0].contentEquals(android.os.Build.MODEL) &&
device[1].contentEquals(android.os.Build.DEVICE)) { device[1].contentEquals(android.os.Build.DEVICE)) {
return true; return true;
......
...@@ -27,7 +27,7 @@ public class VideoCaptureTango extends VideoCapture { ...@@ -27,7 +27,7 @@ public class VideoCaptureTango extends VideoCapture {
private static final int DEPTH_CAMERA_ID = 0; private static final int DEPTH_CAMERA_ID = 0;
private static final int FISHEYE_CAMERA_ID = 1; private static final int FISHEYE_CAMERA_ID = 1;
private static final int FOURMP_CAMERA_ID = 2; private static final int FOURMP_CAMERA_ID = 2;
private static final VideoCaptureFactory.CamParams s_CAM_PARAMS[] = { private static final VideoCaptureFactory.CamParams CAM_PARAMS[] = {
new VideoCaptureFactory.CamParams(DEPTH_CAMERA_ID, "depth", 320, 240), new VideoCaptureFactory.CamParams(DEPTH_CAMERA_ID, "depth", 320, 240),
new VideoCaptureFactory.CamParams(FISHEYE_CAMERA_ID, "fisheye", 640, 480), new VideoCaptureFactory.CamParams(FISHEYE_CAMERA_ID, "fisheye", 640, 480),
new VideoCaptureFactory.CamParams(FOURMP_CAMERA_ID, "4MP", 1280, 720)}; new VideoCaptureFactory.CamParams(FOURMP_CAMERA_ID, "4MP", 1280, 720)};
...@@ -49,12 +49,12 @@ public class VideoCaptureTango extends VideoCapture { ...@@ -49,12 +49,12 @@ public class VideoCaptureTango extends VideoCapture {
private static final String TAG = "VideoCaptureTango"; private static final String TAG = "VideoCaptureTango";
static int numberOfCameras() { static int numberOfCameras() {
return s_CAM_PARAMS.length; return CAM_PARAMS.length;
} }
static VideoCaptureFactory.CamParams getCamParams(int index) { static VideoCaptureFactory.CamParams getCamParams(int index) {
if (index >= s_CAM_PARAMS.length) return null; if (index >= CAM_PARAMS.length) return null;
return s_CAM_PARAMS[index]; return CAM_PARAMS[index];
} }
static CaptureFormat[] getDeviceSupportedFormats(int id) { static CaptureFormat[] getDeviceSupportedFormats(int id) {
...@@ -84,8 +84,8 @@ public class VideoCaptureTango extends VideoCapture { ...@@ -84,8 +84,8 @@ public class VideoCaptureTango extends VideoCapture {
int height, int height,
int frameRate, int frameRate,
Camera.Parameters cameraParameters) { Camera.Parameters cameraParameters) {
mCaptureFormat = new CaptureFormat(s_CAM_PARAMS[mTangoCameraId].mWidth, mCaptureFormat = new CaptureFormat(CAM_PARAMS[mTangoCameraId].mWidth,
s_CAM_PARAMS[mTangoCameraId].mHeight, CAM_PARAMS[mTangoCameraId].mHeight,
frameRate, frameRate,
ImageFormat.YV12); ImageFormat.YV12);
// Connect Tango SuperFrame mode. Available sf modes are "all", // Connect Tango SuperFrame mode. Available sf modes are "all",
......
...@@ -48,7 +48,7 @@ public class HelpActivity extends Activity { ...@@ -48,7 +48,7 @@ public class HelpActivity extends Activity {
* This global variable is used for passing the screenshot from the originating Activity to the * This global variable is used for passing the screenshot from the originating Activity to the
* HelpActivity. There seems to be no better way of doing this. * HelpActivity. There seems to be no better way of doing this.
*/ */
private static Bitmap mScreenshot; private static Bitmap sScreenshot;
/** Constant used to send the feedback parcel to the system feedback service. */ /** Constant used to send the feedback parcel to the system feedback service. */
private static final int SEND_FEEDBACK_INFO = Binder.FIRST_CALL_TRANSACTION; private static final int SEND_FEEDBACK_INFO = Binder.FIRST_CALL_TRANSACTION;
...@@ -78,8 +78,8 @@ public class HelpActivity extends Activity { ...@@ -78,8 +78,8 @@ public class HelpActivity extends Activity {
public void onServiceConnected(ComponentName name, IBinder service) { public void onServiceConnected(ComponentName name, IBinder service) {
try { try {
Parcel parcel = Parcel.obtain(); Parcel parcel = Parcel.obtain();
if (mScreenshot != null) { if (sScreenshot != null) {
mScreenshot.writeToParcel(parcel, 0); sScreenshot.writeToParcel(parcel, 0);
} }
service.transact(SEND_FEEDBACK_INFO, parcel, null, 0); service.transact(SEND_FEEDBACK_INFO, parcel, null, 0);
parcel.recycle(); parcel.recycle();
...@@ -98,7 +98,7 @@ public class HelpActivity extends Activity { ...@@ -98,7 +98,7 @@ public class HelpActivity extends Activity {
/** Launches the Help activity. */ /** Launches the Help activity. */
public static void launch(Activity activity, String helpUrl) { public static void launch(Activity activity, String helpUrl) {
View rootView = activity.getWindow().getDecorView().getRootView(); View rootView = activity.getWindow().getDecorView().getRootView();
mScreenshot = UiUtils.generateScaledScreenshot(rootView, MAX_FEEDBACK_SCREENSHOT_DIMENSION, sScreenshot = UiUtils.generateScaledScreenshot(rootView, MAX_FEEDBACK_SCREENSHOT_DIMENSION,
Bitmap.Config.ARGB_8888); Bitmap.Config.ARGB_8888);
Intent intent = new Intent(activity, HelpActivity.class); Intent intent = new Intent(activity, HelpActivity.class);
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<property name="severity" value="warning"/> <property name="severity" value="warning"/>
</module> </module>
<module name="ConstantName"> <module name="ConstantName">
<property name="severity" value="warning"/> <property name="severity" value="error"/>
<property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*)|(s[A-Z][a-zA-Z0-9]*)$"/> <property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*)|(s[A-Z][a-zA-Z0-9]*)$"/>
<message key="name.invalidPattern" value="Static final field names must either be all caps (e.g. int HEIGHT_PX) for 'true' constants, or start with s (e.g. AtomicInteger sNextId or Runnable sSuspendTask) for fields with mutable state or that don't 'feel' like constants."/> <message key="name.invalidPattern" value="Static final field names must either be all caps (e.g. int HEIGHT_PX) for 'true' constants, or start with s (e.g. AtomicInteger sNextId or Runnable sSuspendTask) for fields with mutable state or that don't 'feel' like constants."/>
</module> </module>
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
</module> </module>
<!-- Static field names start with s. --> <!-- Static field names start with s. -->
<module name="StaticVariableName"> <module name="StaticVariableName">
<property name="severity" value="error"/>
<property name="format" value="^s[A-Z][a-zA-Z0-9]*$"/> <property name="format" value="^s[A-Z][a-zA-Z0-9]*$"/>
<property name="applyToPublic" value="false"/> <property name="applyToPublic" value="false"/>
<message key="name.invalidPattern" value="Static field names start with s."/> <message key="name.invalidPattern" value="Static field names start with s."/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment