Update network state on push notification received
This commit is contained in:
parent
8d6d776a01
commit
81368aa5e9
2 changed files with 3 additions and 1 deletions
|
@ -46,6 +46,8 @@ public class GCMIntentService extends GCMBaseIntentService {
|
|||
@Override
|
||||
protected void onMessage(Context context, Intent intent) {
|
||||
Log.d("Push notification received");
|
||||
LinphoneManager.getLc().setNetworkReachable(false);
|
||||
LinphoneManager.getLc().setNetworkReachable(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -67,7 +67,7 @@ public class LinphoneLauncherActivity extends Activity {
|
|||
if (regId.equals("")) {
|
||||
GCMRegistrar.register(this, getString(R.string.push_sender_id));
|
||||
} else {
|
||||
Log.e("Already registered = " + regId);
|
||||
Log.e("Push Notification : already registered with id = " + regId);
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putString(this.getString(R.string.push_reg_id_key), regId);
|
||||
|
|
Loading…
Reference in a new issue