diff options
18 files changed, 84 insertions, 84 deletions
diff --git a/sync/android/java/src/org/chromium/sync/internal_api/pub/SyncDecryptionPassphraseType.java b/sync/android/java/src/org/chromium/sync/internal_api/pub/SyncDecryptionPassphraseType.java index cfdcfdf..3010c1a 100644 --- a/sync/android/java/src/org/chromium/sync/internal_api/pub/SyncDecryptionPassphraseType.java +++ b/sync/android/java/src/org/chromium/sync/internal_api/pub/SyncDecryptionPassphraseType.java @@ -24,16 +24,16 @@ public enum SyncDecryptionPassphraseType implements Parcelable { public static Parcelable.Creator CREATOR = new Parcelable.Creator<SyncDecryptionPassphraseType>() { - @Override - public SyncDecryptionPassphraseType createFromParcel(Parcel parcel) { - return fromInternalValue(parcel.readInt()); - } + @Override + public SyncDecryptionPassphraseType createFromParcel(Parcel parcel) { + return fromInternalValue(parcel.readInt()); + } - @Override - public SyncDecryptionPassphraseType[] newArray(int size) { - return new SyncDecryptionPassphraseType[size]; - } - }; + @Override + public SyncDecryptionPassphraseType[] newArray(int size) { + return new SyncDecryptionPassphraseType[size]; + } + }; public static SyncDecryptionPassphraseType fromInternalValue(int value) { for (SyncDecryptionPassphraseType type : values()) { diff --git a/sync/android/java/src/org/chromium/sync/internal_api/pub/base/ModelType.java b/sync/android/java/src/org/chromium/sync/internal_api/pub/base/ModelType.java index 6388588..ad6b33c 100644 --- a/sync/android/java/src/org/chromium/sync/internal_api/pub/base/ModelType.java +++ b/sync/android/java/src/org/chromium/sync/internal_api/pub/base/ModelType.java @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 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. diff --git a/sync/android/java/src/org/chromium/sync/notifier/InvalidationClientNameGenerator.java b/sync/android/java/src/org/chromium/sync/notifier/InvalidationClientNameGenerator.java index dcc95e4..9ec3911 100644 --- a/sync/android/java/src/org/chromium/sync/notifier/InvalidationClientNameGenerator.java +++ b/sync/android/java/src/org/chromium/sync/notifier/InvalidationClientNameGenerator.java @@ -6,5 +6,5 @@ package org.chromium.sync.notifier; /** Interface for classes that create an Invalidation client's name. */ public interface InvalidationClientNameGenerator { - public byte[] generateInvalidatorClientName(); + public byte[] generateInvalidatorClientName(); } diff --git a/sync/android/java/src/org/chromium/sync/notifier/InvalidationClientNameProvider.java b/sync/android/java/src/org/chromium/sync/notifier/InvalidationClientNameProvider.java index 08e0062..73915b9 100644 --- a/sync/android/java/src/org/chromium/sync/notifier/InvalidationClientNameProvider.java +++ b/sync/android/java/src/org/chromium/sync/notifier/InvalidationClientNameProvider.java @@ -23,10 +23,10 @@ public class InvalidationClientNameProvider { public static InvalidationClientNameProvider get() { synchronized (LOCK) { - if (sInstance == null) { - sInstance = new InvalidationClientNameProvider(); - } - return sInstance; + if (sInstance == null) { + sInstance = new InvalidationClientNameProvider(); + } + return sInstance; } } diff --git a/sync/android/java/src/org/chromium/sync/notifier/InvalidationPreferences.java b/sync/android/java/src/org/chromium/sync/notifier/InvalidationPreferences.java index 612a470..feeef03 100644 --- a/sync/android/java/src/org/chromium/sync/notifier/InvalidationPreferences.java +++ b/sync/android/java/src/org/chromium/sync/notifier/InvalidationPreferences.java @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 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. @@ -117,29 +117,29 @@ public class InvalidationPreferences { /** Returns the saved non-sync object ids, or {@code null} if none exist. */ @Nullable public Set<ObjectId> getSavedObjectIds() { - SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext); - Set<String> objectIdStrings = preferences.getStringSet(PrefKeys.TANGO_OBJECT_IDS, null); - if (objectIdStrings == null) { - return null; - } - Set<ObjectId> objectIds = new HashSet<ObjectId>(objectIdStrings.size()); - for (String objectIdString : objectIdStrings) { - ObjectId objectId = getObjectId(objectIdString); - if (objectId != null) { - objectIds.add(objectId); - } - } - return objectIds; + SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext); + Set<String> objectIdStrings = preferences.getStringSet(PrefKeys.TANGO_OBJECT_IDS, null); + if (objectIdStrings == null) { + return null; + } + Set<ObjectId> objectIds = new HashSet<ObjectId>(objectIdStrings.size()); + for (String objectIdString : objectIdStrings) { + ObjectId objectId = getObjectId(objectIdString); + if (objectId != null) { + objectIds.add(objectId); + } + } + return objectIds; } /** Sets the saved non-sync object ids */ public void setObjectIds(EditContext editContext, Collection<ObjectId> objectIds) { - Preconditions.checkNotNull(objectIds); - Set<String> objectIdStrings = new HashSet<String>(objectIds.size()); - for (ObjectId objectId : objectIds) { - objectIdStrings.add(getObjectIdString(objectId)); - } - editContext.editor.putStringSet(PrefKeys.TANGO_OBJECT_IDS, objectIdStrings); + Preconditions.checkNotNull(objectIds); + Set<String> objectIdStrings = new HashSet<String>(objectIds.size()); + for (ObjectId objectId : objectIds) { + objectIdStrings.add(getObjectIdString(objectId)); + } + editContext.editor.putStringSet(PrefKeys.TANGO_OBJECT_IDS, objectIdStrings); } /** Returns the saved account, or {@code null} if none exists. */ diff --git a/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java b/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java index 87dc88a..a9d62a3 100644 --- a/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java +++ b/sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 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. @@ -132,12 +132,12 @@ public class InvalidationService extends AndroidListener { if (isTransient) { // Retry immediately on transient failures. The base AndroidListener will handle // exponential backoff if there are repeated failures. - List<ObjectId> objectIdAsList = CollectionUtil.newArrayList(objectId); - if (readRegistrationsFromPrefs().contains(objectId)) { - register(clientId, objectIdAsList); - } else { - unregister(clientId, objectIdAsList); - } + List<ObjectId> objectIdAsList = CollectionUtil.newArrayList(objectId); + if (readRegistrationsFromPrefs().contains(objectId)) { + register(clientId, objectIdAsList); + } else { + unregister(clientId, objectIdAsList); + } } } @@ -148,15 +148,15 @@ public class InvalidationService extends AndroidListener { List<ObjectId> objectIdAsList = CollectionUtil.newArrayList(objectId); boolean registrationisDesired = readRegistrationsFromPrefs().contains(objectId); if (regState == RegistrationState.REGISTERED) { - if (!registrationisDesired) { - Log.i(TAG, "Unregistering for object we're no longer interested in"); - unregister(clientId, objectIdAsList); - } + if (!registrationisDesired) { + Log.i(TAG, "Unregistering for object we're no longer interested in"); + unregister(clientId, objectIdAsList); + } } else { - if (registrationisDesired) { - Log.i(TAG, "Registering for an object"); - register(clientId, objectIdAsList); - } + if (registrationisDesired) { + Log.i(TAG, "Registering for an object"); + register(clientId, objectIdAsList); + } } } diff --git a/sync/android/java/src/org/chromium/sync/notifier/SyncContentResolverDelegate.java b/sync/android/java/src/org/chromium/sync/notifier/SyncContentResolverDelegate.java index d0e3edc..016a930 100644 --- a/sync/android/java/src/org/chromium/sync/notifier/SyncContentResolverDelegate.java +++ b/sync/android/java/src/org/chromium/sync/notifier/SyncContentResolverDelegate.java @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright 2010 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. diff --git a/sync/android/java/src/org/chromium/sync/notifier/SyncStatusHelper.java b/sync/android/java/src/org/chromium/sync/notifier/SyncStatusHelper.java index 14f05ed..77b6b30 100644 --- a/sync/android/java/src/org/chromium/sync/notifier/SyncStatusHelper.java +++ b/sync/android/java/src/org/chromium/sync/notifier/SyncStatusHelper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright 2010 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. @@ -438,7 +438,7 @@ public class SyncStatusHelper { private void notifyObservers() { if (!getAndClearDidUpdateStatus()) return; - for (SyncSettingsChangedObserver observer: mObservers) { + for (SyncSettingsChangedObserver observer : mObservers) { observer.syncSettingsChanged(); } } diff --git a/sync/android/java/src/org/chromium/sync/notifier/SystemSyncContentResolverDelegate.java b/sync/android/java/src/org/chromium/sync/notifier/SystemSyncContentResolverDelegate.java index ce00c8c..1df37115 100644 --- a/sync/android/java/src/org/chromium/sync/notifier/SystemSyncContentResolverDelegate.java +++ b/sync/android/java/src/org/chromium/sync/notifier/SystemSyncContentResolverDelegate.java @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright 2010 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. diff --git a/sync/android/java/src/org/chromium/sync/signin/AccountManagerDelegate.java b/sync/android/java/src/org/chromium/sync/signin/AccountManagerDelegate.java index e855e19..cd3942f 100644 --- a/sync/android/java/src/org/chromium/sync/signin/AccountManagerDelegate.java +++ b/sync/android/java/src/org/chromium/sync/signin/AccountManagerDelegate.java @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. diff --git a/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java b/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java index 99dc0bb..e8d89d9 100644 --- a/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java +++ b/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright 2011 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. @@ -42,7 +42,7 @@ public class AccountManagerHelper { public static final String GOOGLE_ACCOUNT_TYPE = "com.google"; - private static final Object lock = new Object(); + private static final Object sLock = new Object(); private static final int MAX_TRIES = 3; @@ -82,7 +82,7 @@ public class AccountManagerHelper { * @return a singleton instance of the AccountManagerHelper */ public static AccountManagerHelper get(Context context) { - synchronized (lock) { + synchronized (sLock) { if (sAccountManagerHelper == null) { sAccountManagerHelper = new AccountManagerHelper(context, new SystemAccountManagerDelegate(context)); @@ -94,7 +94,7 @@ public class AccountManagerHelper { @VisibleForTesting public static void overrideAccountManagerHelperForTests(Context context, AccountManagerDelegate accountManager) { - synchronized (lock) { + synchronized (sLock) { sAccountManagerHelper = new AccountManagerHelper(context, accountManager); } } @@ -162,10 +162,10 @@ public class AccountManagerHelper { */ @Deprecated public String getAuthTokenFromBackground(Account account, String authTokenType) { - AccountManagerFuture<Bundle> future = mAccountManager.getAuthToken(account, - authTokenType, false, null, null); - AtomicBoolean errorEncountered = new AtomicBoolean(false); - return getAuthTokenInner(future, errorEncountered); + AccountManagerFuture<Bundle> future = mAccountManager.getAuthToken(account, + authTokenType, false, null, null); + AtomicBoolean errorEncountered = new AtomicBoolean(false); + return getAuthTokenInner(future, errorEncountered); } /** diff --git a/sync/android/java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java b/sync/android/java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java index a6fea9d..63856d6 100644 --- a/sync/android/java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java +++ b/sync/android/java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. diff --git a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java index b58bda6..67deaf6 100644 --- a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java +++ b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 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. @@ -92,7 +92,7 @@ public class InvalidationPreferencesTest extends InstrumentationTestCase { ObjectId.newInstance(1, "obj1".getBytes()), ObjectId.newInstance(2, "obj2".getBytes())); Account account = new Account("test@example.com", "bogus"); - byte[] internalClientState = new byte[]{100,101,102}; + byte[] internalClientState = new byte[]{100, 101, 102}; invPreferences.setSyncTypes(editContext, syncTypes); invPreferences.setObjectIds(editContext, objectIds); invPreferences.setAccount(editContext, account); diff --git a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationServiceTest.java b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationServiceTest.java index 5c36bfd..6a84da6 100644 --- a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationServiceTest.java +++ b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationServiceTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 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. @@ -337,7 +337,7 @@ public class InvalidationServiceTest extends ServiceTestCase<TestableInvalidatio * Verify appropriate return values. */ assertNull(getService().readState()); - byte[] writtenState = new byte[]{7,4,0}; + byte[] writtenState = new byte[]{7, 4, 0}; getService().writeState(writtenState); assertTrue(Arrays.equals(writtenState, getService().readState())); } @@ -812,29 +812,29 @@ public class InvalidationServiceTest extends ServiceTestCase<TestableInvalidatio /** Creates an intent to start the InvalidationService. */ private Intent createStartIntent() { - Intent intent = new Intent(); - return intent; + Intent intent = new Intent(); + return intent; } /** Creates an intent to stop the InvalidationService. */ private Intent createStopIntent() { - Intent intent = new Intent(); - intent.putExtra(InvalidationIntentProtocol.EXTRA_STOP, true); - return intent; + Intent intent = new Intent(); + intent.putExtra(InvalidationIntentProtocol.EXTRA_STOP, true); + return intent; } /** Creates an intent to register some types with the InvalidationService. */ private Intent createRegisterIntent(Account account, boolean allTypes, Set<ModelType> types) { - Intent intent = InvalidationIntentProtocol.createRegisterIntent(account, allTypes, types); - return intent; + Intent intent = InvalidationIntentProtocol.createRegisterIntent(account, allTypes, types); + return intent; } /** Creates an intent to register some types with the InvalidationService. */ private Intent createRegisterIntent( - Account account, int[] objectSources, String[] objectNames) { - Intent intent = InvalidationIntentProtocol.createRegisterIntent( - account, objectSources, objectNames); - return intent; + Account account, int[] objectSources, String[] objectNames) { + Intent intent = InvalidationIntentProtocol.createRegisterIntent( + account, objectSources, objectNames); + return intent; } /** Returns whether {@code intent} is an {@link AndroidListener} start intent. */ diff --git a/sync/android/javatests/src/org/chromium/sync/notifier/TestableInvalidationService.java b/sync/android/javatests/src/org/chromium/sync/notifier/TestableInvalidationService.java index 68bdace..dd4a932 100644 --- a/sync/android/javatests/src/org/chromium/sync/notifier/TestableInvalidationService.java +++ b/sync/android/javatests/src/org/chromium/sync/notifier/TestableInvalidationService.java @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 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. diff --git a/sync/android/javatests/src/org/chromium/sync/notifier/signin/SyncStatusHelperTest.java b/sync/android/javatests/src/org/chromium/sync/notifier/signin/SyncStatusHelperTest.java index 44007cb..e57dc35 100644 --- a/sync/android/javatests/src/org/chromium/sync/notifier/signin/SyncStatusHelperTest.java +++ b/sync/android/javatests/src/org/chromium/sync/notifier/signin/SyncStatusHelperTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. diff --git a/sync/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java b/sync/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java index cb330b8..3560a36 100644 --- a/sync/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java +++ b/sync/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java @@ -111,7 +111,7 @@ public class MockAccountManager implements AccountManagerDelegate { @Override public Account[] getAccountsByType(@Nullable String type) { - if(!AccountManagerHelper.GOOGLE_ACCOUNT_TYPE.equals(type)) { + if (!AccountManagerHelper.GOOGLE_ACCOUNT_TYPE.equals(type)) { throw new IllegalArgumentException("Invalid account type: " + type); } if (mAccounts == null) { @@ -285,7 +285,7 @@ public class MockAccountManager implements AccountManagerDelegate { @Override public void invalidateAuthToken(String accountType, String authToken) { - if(!AccountManagerHelper.GOOGLE_ACCOUNT_TYPE.equals(accountType)) { + if (!AccountManagerHelper.GOOGLE_ACCOUNT_TYPE.equals(accountType)) { throw new IllegalArgumentException("Invalid account type: " + accountType); } if (authToken == null) { diff --git a/sync/test/android/javatests/src/org/chromium/sync/test/util/MockSyncContentResolverDelegate.java b/sync/test/android/javatests/src/org/chromium/sync/test/util/MockSyncContentResolverDelegate.java index 002b377..ab8fc08 100644 --- a/sync/test/android/javatests/src/org/chromium/sync/test/util/MockSyncContentResolverDelegate.java +++ b/sync/test/android/javatests/src/org/chromium/sync/test/util/MockSyncContentResolverDelegate.java @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 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. |