Fix some AOSP NPEs
automerge: 473ce1f
* commit '473ce1fa354c81fd7d5bbd84b6a85d629a039e72':
Fix some AOSP NPEs
This commit is contained in:
commit
c71afebb39
@ -249,11 +249,11 @@ public class AccountReconciler {
|
|||||||
final String protocol = EmailServiceUtils.getProtocolFromAccountType(
|
final String protocol = EmailServiceUtils.getProtocolFromAccountType(
|
||||||
context, accountType);
|
context, accountType);
|
||||||
final EmailServiceInfo info = EmailServiceUtils.getServiceInfo(context, protocol);
|
final EmailServiceInfo info = EmailServiceUtils.getServiceInfo(context, protocol);
|
||||||
if (!info.syncCalendar) {
|
if (info == null || !info.syncCalendar) {
|
||||||
ContentResolver.setIsSyncable(accountManagerAccount,
|
ContentResolver.setIsSyncable(accountManagerAccount,
|
||||||
CalendarContract.AUTHORITY, 0);
|
CalendarContract.AUTHORITY, 0);
|
||||||
}
|
}
|
||||||
if (!info.syncContacts) {
|
if (info == null || !info.syncContacts) {
|
||||||
ContentResolver.setIsSyncable(accountManagerAccount,
|
ContentResolver.setIsSyncable(accountManagerAccount,
|
||||||
ContactsContract.AUTHORITY, 0);
|
ContactsContract.AUTHORITY, 0);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ public class AuthenticatorService extends Service {
|
|||||||
account, options.getString(OPTIONS_PASSWORD), null);
|
account, options.getString(OPTIONS_PASSWORD), null);
|
||||||
|
|
||||||
// Set up contacts syncing, if appropriate
|
// Set up contacts syncing, if appropriate
|
||||||
if (info.syncContacts) {
|
if (info != null && info.syncContacts) {
|
||||||
boolean syncContacts = options.getBoolean(OPTIONS_CONTACTS_SYNC_ENABLED, false);
|
boolean syncContacts = options.getBoolean(OPTIONS_CONTACTS_SYNC_ENABLED, false);
|
||||||
ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1);
|
ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1);
|
||||||
ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY,
|
ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY,
|
||||||
@ -81,7 +81,7 @@ public class AuthenticatorService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set up calendar syncing, if appropriate
|
// Set up calendar syncing, if appropriate
|
||||||
if (info.syncCalendar) {
|
if (info != null && info.syncCalendar) {
|
||||||
boolean syncCalendar = options.getBoolean(OPTIONS_CALENDAR_SYNC_ENABLED, false);
|
boolean syncCalendar = options.getBoolean(OPTIONS_CALENDAR_SYNC_ENABLED, false);
|
||||||
ContentResolver.setIsSyncable(account, CalendarContract.AUTHORITY, 1);
|
ContentResolver.setIsSyncable(account, CalendarContract.AUTHORITY, 1);
|
||||||
ContentResolver.setSyncAutomatically(account, CalendarContract.AUTHORITY,
|
ContentResolver.setSyncAutomatically(account, CalendarContract.AUTHORITY,
|
||||||
|
Loading…
Reference in New Issue
Block a user