Update network state on push notification received

This commit is contained in:
Sylvain Berfini 2012-09-10 12:38:19 +02:00
parent 8d6d776a01
commit 81368aa5e9
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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);