Fix for push information not being set if network down at configuration time
This commit is contained in:
parent
4473782f86
commit
7074db040a
5 changed files with 11 additions and 2 deletions
|
@ -792,6 +792,12 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
mLastNetworkType=curtype;
|
||||
}
|
||||
}
|
||||
|
||||
if (mLc.isNetworkReachable()) {
|
||||
// When network isn't available, push informations might not be set. This should fix the issue.
|
||||
LinphonePreferences prefs = LinphonePreferences.instance();
|
||||
prefs.setPushNotificationEnabled(prefs.isPushNotificationEnabled());
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
|
|
|
@ -1017,7 +1017,7 @@ public class LinphonePreferences {
|
|||
lpc.edit();
|
||||
lpc.setContactUriParameters(contactInfos);
|
||||
lpc.done();
|
||||
Log.d("Push notif infos added to proxy config");
|
||||
Log.d("Push notif infos added to proxy config " + lpc.getAddress().asStringUriOnly());
|
||||
}
|
||||
lc.refreshRegisters();
|
||||
}
|
||||
|
@ -1027,7 +1027,7 @@ public class LinphonePreferences {
|
|||
lpc.edit();
|
||||
lpc.setContactUriParameters(null);
|
||||
lpc.done();
|
||||
Log.d("Push notif infos removed from proxy config");
|
||||
Log.d("Push notif infos removed from proxy config " + lpc.getAddress().asStringUriOnly());
|
||||
}
|
||||
lc.refreshRegisters();
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@ public class ApiElevenPlus {
|
|||
| Notification.DEFAULT_SOUND
|
||||
| Notification.DEFAULT_VIBRATE)
|
||||
.setWhen(System.currentTimeMillis())
|
||||
.setNumber(msgCount)
|
||||
.setLargeIcon(contactIcon).getNotification();
|
||||
|
||||
return notif;
|
||||
|
|
|
@ -56,6 +56,7 @@ public class ApiSixteenPlus {
|
|||
| Notification.DEFAULT_VIBRATE)
|
||||
.setWhen(System.currentTimeMillis())
|
||||
.setLargeIcon(contactIcon)
|
||||
.setNumber(msgCount)
|
||||
.build();
|
||||
|
||||
return notif;
|
||||
|
|
|
@ -54,6 +54,7 @@ public class ApiTwentyOnePlus {
|
|||
.setCategory(Notification.CATEGORY_MESSAGE)
|
||||
.setVisibility(Notification.VISIBILITY_PRIVATE)
|
||||
.setPriority(Notification.PRIORITY_HIGH)
|
||||
.setNumber(msgCount)
|
||||
.build();
|
||||
|
||||
return notif;
|
||||
|
|
Loading…
Reference in a new issue