When receiving a push, do work on main thread
This commit is contained in:
parent
7b8029c35f
commit
5378f46b56
1 changed files with 13 additions and 4 deletions
|
@ -77,11 +77,15 @@ public class GCMService extends GCMBaseIntentService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onRegistered(Context context, String regId) {
|
protected void onRegistered(Context context, final String regId) {
|
||||||
initLogger(context);
|
initLogger(context);
|
||||||
Log.d("[Push Notification] Registered: " + regId);
|
Log.d("[Push Notification] Registered: " + regId);
|
||||||
|
UIThreadDispatcher.dispatch(new Runnable(){
|
||||||
LinphonePreferences.instance().setPushNotificationRegistrationID(regId);
|
@Override
|
||||||
|
public void run() {
|
||||||
|
LinphonePreferences.instance().setPushNotificationRegistrationID(regId);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -89,7 +93,12 @@ public class GCMService extends GCMBaseIntentService {
|
||||||
initLogger(context);
|
initLogger(context);
|
||||||
Log.w("[Push Notification] Unregistered: " + regId);
|
Log.w("[Push Notification] Unregistered: " + regId);
|
||||||
|
|
||||||
LinphonePreferences.instance().setPushNotificationRegistrationID(null);
|
UIThreadDispatcher.dispatch(new Runnable(){
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
LinphonePreferences.instance().setPushNotificationRegistrationID(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String[] getSenderIds(Context context) {
|
protected String[] getSenderIds(Context context) {
|
||||||
|
|
Loading…
Reference in a new issue