Skip to content
Merged

Merge #449

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions App/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 421
versionName "4.2.1"
versionCode 422
versionName "4.2.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public class ContactService extends ApiService {
private final String restPath = "contacts";
private final String TAG = "ContactService";

private Map<String, Contact> phoneContacts;
private static Map<String, Contact> phoneContacts;

public ContactService(Context context) {
super(context);
generatePhoneContactsMapFromList(new DefaultContactDataSource().getContacts(context));
if (phoneContacts == null) generatePhoneContactsMapFromList(new DefaultContactDataSource().getContacts(context));
}

private void generatePhoneContactsMapFromList(List<Contact> phoneContactsList) {
Expand Down Expand Up @@ -328,11 +328,6 @@ public List<Contact> getPhoneContacts() {
return new ArrayList(phoneContacts.values());
}

// for dependency injenction
public void setPhoneContacts(List<Contact> phoneContacts) {
generatePhoneContactsMapFromList(phoneContacts);
}

private Contact getSynchronizedWithPhone(Contact contact) {
Contact synchronizedContact = new Contact();
Contact phoneContact = phoneContacts.get(contact.getEmail());
Expand Down