Fix crash
This commit is contained in:
parent
20a45a72ae
commit
94cd40f141
2 changed files with 30 additions and 22 deletions
|
@ -1125,29 +1125,33 @@ public class LinphoneActivity extends FragmentActivity implements
|
|||
Thread sipContactsHandler = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < sipContactCursor.getCount(); i++) {
|
||||
Contact contact = Compatibility.getContact(getContentResolver(), sipContactCursor, i);
|
||||
if (contact == null)
|
||||
continue;
|
||||
if(sipContactCursor != null) {
|
||||
for (int i = 0; i < sipContactCursor.getCount(); i++) {
|
||||
Contact contact = Compatibility.getContact(getContentResolver(), sipContactCursor, i);
|
||||
if (contact == null)
|
||||
continue;
|
||||
|
||||
contact.refresh(getContentResolver());
|
||||
if (!isContactPresenceDisabled) {
|
||||
searchFriendAndAddToContact(contact);
|
||||
}
|
||||
sipContactList.add(contact);
|
||||
}
|
||||
for (int i = 0; i < contactCursor.getCount(); i++) {
|
||||
Contact contact = Compatibility.getContact(getContentResolver(), contactCursor, i);
|
||||
if (contact == null)
|
||||
continue;
|
||||
|
||||
for (Contact c : sipContactList) {
|
||||
if (c != null && c.getID().equals(contact.getID())) {
|
||||
contact = c;
|
||||
break;
|
||||
contact.refresh(getContentResolver());
|
||||
if (!isContactPresenceDisabled) {
|
||||
searchFriendAndAddToContact(contact);
|
||||
}
|
||||
sipContactList.add(contact);
|
||||
}
|
||||
}
|
||||
if(contactCursor != null) {
|
||||
for (int i = 0; i < contactCursor.getCount(); i++) {
|
||||
Contact contact = Compatibility.getContact(getContentResolver(), contactCursor, i);
|
||||
if (contact == null)
|
||||
continue;
|
||||
|
||||
for (Contact c : sipContactList) {
|
||||
if (c != null && c.getID().equals(contact.getID())) {
|
||||
contact = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
contactList.add(contact);
|
||||
}
|
||||
contactList.add(contact);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -38,7 +38,11 @@ public class ApiEightPlus {
|
|||
try {
|
||||
// Starting the push notification service
|
||||
GCMRegistrar.checkDevice(context);
|
||||
GCMRegistrar.checkManifest(context);
|
||||
try {
|
||||
GCMRegistrar.checkManifest(context);
|
||||
} catch (IllegalStateException e){
|
||||
Log.e("No receiver found",e);
|
||||
}
|
||||
final String regId = GCMRegistrar.getRegistrationId(context);
|
||||
String newPushSenderID = context.getString(R.string.push_sender_id);
|
||||
String currentPushSenderID = LinphonePreferences.instance().getPushNotificationRegistrationID();
|
||||
|
|
Loading…
Reference in a new issue