copy intent extras in eventreceiver

This commit is contained in:
Daniel Gultsch 2019-02-27 14:16:26 +01:00
parent 417a6e8307
commit a29a5fd491

View file

@ -3,6 +3,7 @@ package eu.siacs.conversations.services;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.util.Log; import android.util.Log;
@ -20,6 +21,10 @@ public class EventReceiver extends BroadcastReceiver {
final Intent intentForService = new Intent(context, XmppConnectionService.class); final Intent intentForService = new Intent(context, XmppConnectionService.class);
if (originalIntent.getAction() != null) { if (originalIntent.getAction() != null) {
intentForService.setAction(originalIntent.getAction()); intentForService.setAction(originalIntent.getAction());
final Bundle extras = originalIntent.getExtras();
if (extras != null) {
intentForService.putExtras(extras);
}
} else { } else {
intentForService.setAction("other"); intentForService.setAction("other");
} }