blob: 0e94f5b8e7432451547c3a6add27fd980a0289a5 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package io.v.android.apps.syncslides.discovery;
import android.content.Context;
import java.util.HashSet;
import java.util.Set;
import io.v.android.apps.syncslides.db.VPerson;
import io.v.android.apps.syncslides.model.DeckFactory;
import io.v.android.apps.syncslides.model.Participant;
public class ParticipantScannerFake implements ParticipantScanner {
private static final String TAG = "ParticipantScannerFake";
protected final DeckFactory mDeckFactory;
private int mCounter = 0;
public ParticipantScannerFake(Context context) {
this.mDeckFactory = DeckFactory.Singleton.get(context);
}
public Set<Participant> scan() {
mCounter = (mCounter + 1) % 10;
HashSet<Participant> participants = new HashSet<>();
if (mCounter >= 2 && mCounter <= 8) {
participants.add(
ParticipantPeer.makeWithKnownDeck(
new VPerson(
"dev.v.io/u/liz.lemon@gmail.com/android/io.v" +
".android.apps.syncslides",
"Liz Lemon"),
mDeckFactory.make(
"Kale - Just eat it.",
"deckByAlice")));
}
// Jack has less to say than Liz.
if (mCounter >= 4 && mCounter <= 6) {
participants.add(
ParticipantPeer.makeWithKnownDeck(
new VPerson(
"dev.v.io/u/jack.donaghy@gmail.com/android/io.v" +
".android.apps.syncslides",
"Jack Donaghy"),
mDeckFactory.make(
"Java - Object deluge.",
"deckByBob")));
}
return participants;
}
}