Commit d0ef976d authored by maxbogue@chromium.org's avatar maxbogue@chromium.org

Disable session invalidations on Android with a flag.

This will allow us to roll the change out gradually using
Finch.

BUG=385213

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283476 0039d316-1c4b-4281-b951-d872f2087c98
parent 863b3b16
......@@ -10,6 +10,9 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.ipc.invalidation.external.client.types.ObjectId;
import com.google.protos.ipc.invalidation.Types;
import org.chromium.base.FieldTrialList;
import org.chromium.base.library_loader.LibraryLoader;
import java.util.Collection;
import java.util.EnumSet;
import java.util.HashSet;
......@@ -90,6 +93,15 @@ public enum ModelType {
this(modelType, false);
}
private boolean isNonInvalidationType() {
if (this == SESSION && LibraryLoader.isInitialized()) {
return FieldTrialList
.findFullName("AndroidSessionNotifications")
.equals("Disabled");
}
return mNonInvalidationType;
}
/**
* Returns the {@link ObjectId} representation of this {@link ModelType}.
*
......@@ -155,7 +167,7 @@ public enum ModelType {
public static Set<ObjectId> modelTypesToObjectIds(Set<ModelType> modelTypes) {
Set<ObjectId> objectIds = new HashSet<ObjectId>(modelTypes.size());
for (ModelType modelType : modelTypes) {
if (!modelType.mNonInvalidationType) {
if (!modelType.isNonInvalidationType()) {
objectIds.add(modelType.toObjectId());
}
}
......
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