2017-11-12 08:33:24 +01:00
|
|
|
package fr.gouv.etalab.mastodon.services;
|
|
|
|
/* Copyright 2017 Thomas Schneider
|
|
|
|
*
|
|
|
|
* This file is a part of Mastalab
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
|
|
|
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Mastalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
|
|
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
|
|
* Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with Mastalab; if not,
|
|
|
|
* see <http://www.gnu.org/licenses>. */
|
|
|
|
import android.app.Service;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.SharedPreferences;
|
|
|
|
import android.database.sqlite.SQLiteDatabase;
|
|
|
|
import android.graphics.Bitmap;
|
|
|
|
import android.graphics.BitmapFactory;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.IBinder;
|
|
|
|
import android.os.SystemClock;
|
|
|
|
import android.support.annotation.Nullable;
|
|
|
|
import android.support.v4.content.LocalBroadcastManager;
|
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
|
|
|
|
import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache;
|
|
|
|
import com.nostra13.universalimageloader.core.DisplayImageOptions;
|
|
|
|
import com.nostra13.universalimageloader.core.ImageLoader;
|
|
|
|
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
|
|
|
|
import com.nostra13.universalimageloader.core.assist.FailReason;
|
|
|
|
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
|
|
|
|
import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener;
|
|
|
|
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import java.io.BufferedInputStream;
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.io.InputStreamReader;
|
2017-11-29 17:29:41 +01:00
|
|
|
import java.net.HttpURLConnection;
|
2017-11-12 08:33:24 +01:00
|
|
|
import java.net.URL;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.net.ssl.HttpsURLConnection;
|
|
|
|
|
|
|
|
import fr.gouv.etalab.mastodon.R;
|
|
|
|
import fr.gouv.etalab.mastodon.activities.BaseMainActivity;
|
|
|
|
import fr.gouv.etalab.mastodon.activities.MainActivity;
|
|
|
|
import fr.gouv.etalab.mastodon.client.API;
|
|
|
|
import fr.gouv.etalab.mastodon.client.Entities.Account;
|
|
|
|
import fr.gouv.etalab.mastodon.client.Entities.Notification;
|
|
|
|
import fr.gouv.etalab.mastodon.client.Entities.Status;
|
|
|
|
import fr.gouv.etalab.mastodon.client.PatchBaseImageDownloader;
|
|
|
|
import fr.gouv.etalab.mastodon.client.TLSSocketFactory;
|
|
|
|
import fr.gouv.etalab.mastodon.helper.Helper;
|
|
|
|
import fr.gouv.etalab.mastodon.sqlite.AccountDAO;
|
|
|
|
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
|
|
|
|
|
|
|
|
import static fr.gouv.etalab.mastodon.helper.Helper.INTENT_ACTION;
|
|
|
|
import static fr.gouv.etalab.mastodon.helper.Helper.NOTIFICATION_INTENT;
|
|
|
|
import static fr.gouv.etalab.mastodon.helper.Helper.PREF_KEY_ID;
|
|
|
|
import static fr.gouv.etalab.mastodon.helper.Helper.notify_user;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by Thomas on 28/08/2017.
|
|
|
|
* Manage service for streaming api and new notifications
|
|
|
|
*/
|
|
|
|
|
|
|
|
public class LiveNotificationService extends Service {
|
|
|
|
|
|
|
|
|
2017-11-14 15:11:31 +01:00
|
|
|
|
2017-11-12 08:33:24 +01:00
|
|
|
protected Account account;
|
|
|
|
|
|
|
|
private boolean restartCalled;
|
|
|
|
|
|
|
|
public void onCreate() {
|
|
|
|
super.onCreate();
|
|
|
|
restartCalled = false;
|
|
|
|
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
|
|
|
boolean liveNotifications = sharedpreferences.getBoolean(Helper.SET_LIVE_NOTIFICATIONS, true);
|
|
|
|
boolean notify = sharedpreferences.getBoolean(Helper.SET_NOTIFY, true);
|
|
|
|
if( liveNotifications && notify){
|
|
|
|
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
|
|
|
List<Account> accountStreams = new AccountDAO(getApplicationContext(), db).getAllAccount();
|
2017-11-14 19:05:33 +01:00
|
|
|
if(accountStreams != null)
|
2017-11-12 08:33:24 +01:00
|
|
|
for(final Account accountStream: accountStreams){
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
try {
|
|
|
|
streamOnUser(accountStream);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
thread.start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
2017-11-14 15:27:26 +01:00
|
|
|
if(intent != null) {
|
|
|
|
Bundle extras = intent.getExtras();
|
|
|
|
if (extras != null) {
|
|
|
|
boolean restart = (boolean) extras.get("restart");
|
|
|
|
if (restart) {
|
|
|
|
SystemClock.sleep(1000);
|
|
|
|
sendBroadcast(new Intent("RestartStreamingService"));
|
|
|
|
stopSelf();
|
|
|
|
}
|
2017-11-12 08:33:24 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return START_STICKY;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public IBinder onBind(Intent intent) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void streamOnUser(Account accountStream){
|
|
|
|
InputStream inputStream = null;
|
|
|
|
HttpsURLConnection httpsURLConnection = null;
|
|
|
|
BufferedReader reader = null;
|
|
|
|
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
2017-11-14 15:11:31 +01:00
|
|
|
Helper.EventStreaming lastEvent = null;
|
2017-11-12 08:33:24 +01:00
|
|
|
if( accountStream != null){
|
|
|
|
try {
|
|
|
|
URL url = new URL("https://" + accountStream.getInstance() + "/api/v1/streaming/user");
|
|
|
|
httpsURLConnection = (HttpsURLConnection) url.openConnection();
|
|
|
|
httpsURLConnection.setRequestProperty("Content-Type", "application/json");
|
|
|
|
httpsURLConnection.setRequestProperty("Authorization", "Bearer " + accountStream.getToken());
|
|
|
|
httpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
|
|
|
|
httpsURLConnection.setRequestProperty("Keep-Alive", "header");
|
|
|
|
httpsURLConnection.setRequestProperty("Connection", "close");
|
|
|
|
httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory());
|
|
|
|
httpsURLConnection.setRequestMethod("GET");
|
|
|
|
httpsURLConnection.setConnectTimeout(70000);
|
|
|
|
httpsURLConnection.setReadTimeout(70000);
|
|
|
|
|
2017-11-29 17:29:41 +01:00
|
|
|
if( httpsURLConnection.getResponseCode() == HttpURLConnection.HTTP_OK){
|
|
|
|
inputStream = new BufferedInputStream(httpsURLConnection.getInputStream());
|
|
|
|
reader = new BufferedReader(new InputStreamReader(inputStream));
|
|
|
|
String event;
|
|
|
|
Helper.EventStreaming eventStreaming;
|
|
|
|
while((event = reader.readLine()) != null) {
|
|
|
|
if( !sharedpreferences.getBoolean(Helper.SHOULD_CONTINUE_STREAMING, true) ) {
|
|
|
|
stopSelf();
|
|
|
|
return;
|
2017-11-12 08:33:24 +01:00
|
|
|
}
|
2017-11-29 17:29:41 +01:00
|
|
|
|
|
|
|
if ((lastEvent == Helper.EventStreaming.NONE || lastEvent == null) && !event.startsWith("data: ")) {
|
|
|
|
switch (event.trim()) {
|
|
|
|
case "event: update":
|
|
|
|
lastEvent = Helper.EventStreaming.UPDATE;
|
|
|
|
break;
|
|
|
|
case "event: notification":
|
|
|
|
lastEvent = Helper.EventStreaming.NOTIFICATION;
|
|
|
|
break;
|
|
|
|
case "event: delete":
|
|
|
|
lastEvent = Helper.EventStreaming.DELETE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
lastEvent = Helper.EventStreaming.NONE;
|
|
|
|
}
|
2017-11-12 08:33:24 +01:00
|
|
|
} else {
|
2017-11-29 17:29:41 +01:00
|
|
|
if (!event.startsWith("data: ")) {
|
|
|
|
lastEvent = Helper.EventStreaming.NONE;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
event = event.substring(6);
|
|
|
|
if (lastEvent == Helper.EventStreaming.UPDATE) {
|
|
|
|
eventStreaming = Helper.EventStreaming.UPDATE;
|
|
|
|
} else if (lastEvent == Helper.EventStreaming.NOTIFICATION) {
|
|
|
|
eventStreaming = Helper.EventStreaming.NOTIFICATION;
|
|
|
|
} else if (lastEvent == Helper.EventStreaming.DELETE) {
|
|
|
|
eventStreaming = Helper.EventStreaming.DELETE;
|
|
|
|
event = "{id:" + event + "}";
|
|
|
|
} else {
|
|
|
|
eventStreaming = Helper.EventStreaming.UPDATE;
|
|
|
|
}
|
|
|
|
lastEvent = Helper.EventStreaming.NONE;
|
|
|
|
try {
|
|
|
|
JSONObject eventJson = new JSONObject(event);
|
|
|
|
onRetrieveStreaming(eventStreaming, accountStream, eventJson);
|
|
|
|
} catch (JSONException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
2017-11-12 08:33:24 +01:00
|
|
|
}
|
|
|
|
}
|
2017-11-29 17:29:41 +01:00
|
|
|
}else {
|
|
|
|
httpsURLConnection.disconnect();
|
|
|
|
if( !restartCalled ) {
|
|
|
|
restartCalled = true;
|
|
|
|
SystemClock.sleep(60000);
|
2017-11-29 18:26:32 +01:00
|
|
|
sendBroadcast(new Intent("RestartLiveNotificationService"));
|
2017-11-29 17:29:41 +01:00
|
|
|
stopSelf();
|
|
|
|
}
|
2017-11-12 08:33:24 +01:00
|
|
|
}
|
2017-11-29 17:29:41 +01:00
|
|
|
|
2017-11-12 08:33:24 +01:00
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}finally {
|
|
|
|
if(reader != null){
|
|
|
|
try{
|
|
|
|
reader.close();
|
|
|
|
}catch (IOException ignored){}
|
|
|
|
}
|
|
|
|
if (inputStream != null) {
|
|
|
|
try {
|
|
|
|
inputStream.close();
|
|
|
|
} catch (IOException ignored) {}
|
|
|
|
}
|
|
|
|
if( httpsURLConnection != null)
|
|
|
|
httpsURLConnection.disconnect();
|
|
|
|
if( !restartCalled ) {
|
|
|
|
restartCalled = true;
|
2017-11-29 18:26:32 +01:00
|
|
|
SystemClock.sleep(5000);
|
|
|
|
sendBroadcast(new Intent("RestartLiveNotificationService"));
|
2017-11-12 08:33:24 +01:00
|
|
|
stopSelf();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-14 15:11:31 +01:00
|
|
|
public void onRetrieveStreaming(Helper.EventStreaming event, final Account account, JSONObject response) {
|
2017-11-12 08:33:24 +01:00
|
|
|
if( response == null )
|
|
|
|
return;
|
|
|
|
//No previous notifications in cache, so no notification will be sent
|
|
|
|
Status status ;
|
|
|
|
final Notification notification;
|
|
|
|
String dataId = null;
|
|
|
|
|
|
|
|
Bundle b = new Bundle();
|
2017-11-14 15:11:31 +01:00
|
|
|
if( event == Helper.EventStreaming.NOTIFICATION){
|
2017-11-12 08:33:24 +01:00
|
|
|
notification = API.parseNotificationResponse(getApplicationContext(), response);
|
|
|
|
b.putParcelable("data", notification);
|
|
|
|
boolean activityPaused;
|
|
|
|
try {
|
|
|
|
activityPaused = BaseMainActivity.activityState();
|
|
|
|
}catch (Exception e){
|
|
|
|
activityPaused = true;
|
|
|
|
}
|
|
|
|
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
|
|
|
boolean liveNotifications = sharedpreferences.getBoolean(Helper.SET_LIVE_NOTIFICATIONS, true);
|
|
|
|
boolean canNotify = Helper.canNotify(getApplicationContext());
|
|
|
|
boolean notify = sharedpreferences.getBoolean(Helper.SET_NOTIFY, true);
|
|
|
|
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
|
|
|
|
|
|
|
if((userId == null || !userId.equals(account.getId()) || activityPaused) && liveNotifications && canNotify && notify) {
|
|
|
|
boolean notif_follow = sharedpreferences.getBoolean(Helper.SET_NOTIF_FOLLOW, true);
|
|
|
|
boolean notif_add = sharedpreferences.getBoolean(Helper.SET_NOTIF_ADD, true);
|
|
|
|
boolean notif_mention = sharedpreferences.getBoolean(Helper.SET_NOTIF_MENTION, true);
|
|
|
|
boolean notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE, true);
|
|
|
|
boolean somethingToPush = (notif_follow || notif_add || notif_mention || notif_share);
|
|
|
|
String title = null;
|
|
|
|
if( somethingToPush && notification != null){
|
|
|
|
switch (notification.getType()){
|
|
|
|
case "mention":
|
|
|
|
if(notif_mention){
|
|
|
|
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 )
|
2017-11-12 09:34:57 +01:00
|
|
|
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_mention));
|
2017-11-12 08:33:24 +01:00
|
|
|
else
|
2017-11-12 09:34:57 +01:00
|
|
|
title = String.format("@%s %s", notification.getAccount().getAcct(),getApplicationContext().getString(R.string.notif_mention));
|
2017-11-12 08:33:24 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "reblog":
|
|
|
|
if(notif_share){
|
|
|
|
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 )
|
2017-11-12 09:34:57 +01:00
|
|
|
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_reblog));
|
2017-11-12 08:33:24 +01:00
|
|
|
else
|
2017-11-12 09:34:57 +01:00
|
|
|
title = String.format("@%s %s", notification.getAccount().getAcct(),getApplicationContext().getString(R.string.notif_reblog));
|
2017-11-12 08:33:24 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "favourite":
|
|
|
|
if(notif_add){
|
|
|
|
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 )
|
2017-11-12 09:34:57 +01:00
|
|
|
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_favourite));
|
2017-11-12 08:33:24 +01:00
|
|
|
else
|
2017-11-12 09:34:57 +01:00
|
|
|
title = String.format("@%s %s", notification.getAccount().getAcct(),getApplicationContext().getString(R.string.notif_favourite));
|
2017-11-12 08:33:24 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "follow":
|
|
|
|
if(notif_follow){
|
|
|
|
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 )
|
2017-11-12 09:34:57 +01:00
|
|
|
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_follow));
|
2017-11-12 08:33:24 +01:00
|
|
|
else
|
2017-11-12 09:34:57 +01:00
|
|
|
title = String.format("@%s %s", notification.getAccount().getAcct(),getApplicationContext().getString(R.string.notif_follow));
|
2017-11-12 08:33:24 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
//Some others notification
|
|
|
|
final Intent intent = new Intent(getApplicationContext(), MainActivity.class);
|
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK );
|
|
|
|
intent.putExtra(INTENT_ACTION, NOTIFICATION_INTENT);
|
|
|
|
intent.putExtra(PREF_KEY_ID, account.getId());
|
|
|
|
long notif_id = Long.parseLong(account.getId());
|
|
|
|
final int notificationId = ((notif_id + 1) > 2147483647) ? (int) (2147483647 - notif_id - 1) : (int) (notif_id + 1);
|
|
|
|
if( notification.getAccount().getAvatar() != null ) {
|
|
|
|
ImageLoader imageLoaderNoty = ImageLoader.getInstance();
|
|
|
|
File cacheDir = new File(getApplicationContext().getCacheDir(), getApplicationContext().getString(R.string.app_name));
|
|
|
|
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
|
|
|
|
.imageDownloader(new PatchBaseImageDownloader(getApplicationContext()))
|
|
|
|
.threadPoolSize(5)
|
|
|
|
.threadPriority(Thread.MIN_PRIORITY + 3)
|
|
|
|
.denyCacheImageMultipleSizesInMemory()
|
|
|
|
.diskCache(new UnlimitedDiskCache(cacheDir))
|
|
|
|
.build();
|
|
|
|
imageLoaderNoty.init(config);
|
|
|
|
DisplayImageOptions options = new DisplayImageOptions.Builder().displayer(new SimpleBitmapDisplayer()).cacheInMemory(false)
|
|
|
|
.cacheOnDisk(true).resetViewBeforeLoading(true).build();
|
|
|
|
|
|
|
|
final String finalTitle = title;
|
|
|
|
if( title != null) {
|
|
|
|
imageLoaderNoty.loadImage(notification.getAccount().getAvatar(), options, new SimpleImageLoadingListener() {
|
|
|
|
@Override
|
|
|
|
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
|
|
|
|
super.onLoadingComplete(imageUri, view, loadedImage);
|
|
|
|
notify_user(getApplicationContext(), intent, notificationId, loadedImage, finalTitle, "@"+account.getAcct()+"@"+account.getInstance());
|
|
|
|
String lastNotif = sharedpreferences.getString(Helper.LAST_NOTIFICATION_MAX_ID + account.getId(), null);
|
|
|
|
if (lastNotif == null || Long.parseLong(notification.getId()) > Long.parseLong(lastNotif)) {
|
|
|
|
SharedPreferences.Editor editor = sharedpreferences.edit();
|
|
|
|
editor.putString(Helper.LAST_NOTIFICATION_MAX_ID + account.getId(), notification.getId());
|
|
|
|
editor.apply();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onLoadingFailed(java.lang.String imageUri, android.view.View view, FailReason failReason) {
|
|
|
|
notify_user(getApplicationContext(), intent, notificationId, BitmapFactory.decodeResource(getApplicationContext().getResources(),
|
|
|
|
R.drawable.mastodonlogo), finalTitle, "@"+account.getAcct()+"@"+account.getInstance());
|
|
|
|
String lastNotif = sharedpreferences.getString(Helper.LAST_NOTIFICATION_MAX_ID + account.getId(), null);
|
|
|
|
if (lastNotif == null || Long.parseLong(notification.getId()) > Long.parseLong(lastNotif)) {
|
|
|
|
SharedPreferences.Editor editor = sharedpreferences.edit();
|
|
|
|
editor.putString(Helper.LAST_NOTIFICATION_MAX_ID + account.getId(), notification.getId());
|
|
|
|
editor.apply();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-11-14 15:11:31 +01:00
|
|
|
}else if ( event == Helper.EventStreaming.UPDATE){
|
2017-11-12 08:33:24 +01:00
|
|
|
status = API.parseStatuses(getApplicationContext(), response);
|
|
|
|
status.setReplies(new ArrayList<Status>());
|
|
|
|
status.setNew(true);
|
|
|
|
b.putParcelable("data", status);
|
2017-11-14 15:11:31 +01:00
|
|
|
}else if( event == Helper.EventStreaming.DELETE){
|
2017-11-12 08:33:24 +01:00
|
|
|
try {
|
|
|
|
dataId = response.getString("id");
|
|
|
|
} catch (JSONException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( account != null)
|
|
|
|
b.putString("userIdService",account.getId());
|
|
|
|
Intent intentBC = new Intent(Helper.RECEIVE_DATA);
|
|
|
|
intentBC.putExtra("eventStreaming", event);
|
|
|
|
intentBC.putExtras(b);
|
|
|
|
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intentBC);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|