am 066c3202: am 89a36e1d: am ea73ce47: am c71afebb: Fix some AOSP NPEs automerge: 473ce1f

* commit '066c3202dc4c96e069c8d50dfe61b2cb89c8e5d4':
  Fix some AOSP NPEs
This commit is contained in:
Tony Mantler 2014-11-02 17:50:21 +00:00 committed by Android Git Automerger
commit b1a155d7c0
2 changed files with 4 additions and 4 deletions

View File

@ -249,11 +249,11 @@ public class AccountReconciler {
final String protocol = EmailServiceUtils.getProtocolFromAccountType(
context, accountType);
final EmailServiceInfo info = EmailServiceUtils.getServiceInfo(context, protocol);
if (!info.syncCalendar) {
if (info == null || !info.syncCalendar) {
ContentResolver.setIsSyncable(accountManagerAccount,
CalendarContract.AUTHORITY, 0);
}
if (!info.syncContacts) {
if (info == null || !info.syncContacts) {
ContentResolver.setIsSyncable(accountManagerAccount,
ContactsContract.AUTHORITY, 0);
}

View File

@ -73,7 +73,7 @@ public class AuthenticatorService extends Service {
account, options.getString(OPTIONS_PASSWORD), null);
// Set up contacts syncing, if appropriate
if (info.syncContacts) {
if (info != null && info.syncContacts) {
boolean syncContacts = options.getBoolean(OPTIONS_CONTACTS_SYNC_ENABLED, false);
ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1);
ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY,
@ -81,7 +81,7 @@ public class AuthenticatorService extends Service {
}
// Set up calendar syncing, if appropriate
if (info.syncCalendar) {
if (info != null && info.syncCalendar) {
boolean syncCalendar = options.getBoolean(OPTIONS_CALENDAR_SYNC_ENABLED, false);
ContentResolver.setIsSyncable(account, CalendarContract.AUTHORITY, 1);
ContentResolver.setSyncAutomatically(account, CalendarContract.AUTHORITY,