public DataBundle toDataBundle() { DataBundle dataBundle = new DataBundle(); return toDataBundle(dataBundle); }
@Subscribe(threadMode = ThreadMode.MAIN) public void requestNightscoutSync(NightscoutRequestSyncEvent event) { Log.d(Constants.TAG, "MessagesListener requested nightscout sync"); send(Constants.ACTION_NIGHTSCOUT_SYNC, new DataBundle()); }
@Override public void onTimerFinished(View v) { Log.d(Constants.TAG, "WearActivity onTimerFinished v.isPressed: " + v.isPressed()); ((DelayedConfirmationView) v).setListener(null); final Handler mHandler = new Handler(); mHandler.postDelayed(new Runnable() { public void run() { hideConfirm(); } }, 1000); switch (itemChosen) { case 4: HermesEventBus.getDefault().post(new EnableLowPower(new DataBundle())); break; case 5: HermesEventBus.getDefault().post(new RevokeAdminOwner(new DataBundle())); break; case 6: case 7: case 8: case 9: case 10: runCommand(toggle[itemChosen]); break; } itemChosen = 0; }
HermesEventBus.getDefault().post(new EnableLowPower(new DataBundle())); break; HermesEventBus.getDefault().post(new RevokeAdminOwner(new DataBundle())); break;
public MessagesListener(Context context) { this.context = context; settingsManager = new SettingsManager(context); notificationManager = new NotificationService(context); settings = new WidgetSettings(Constants.TAG, context); batteryData = new BatteryData(); watchStatusData = new WatchStatusData(); dataBundle = new DataBundle(); //Register power disconnect receiver IntentFilter powerDisconnectedFilter = new IntentFilter(Intent.ACTION_POWER_DISCONNECTED); powerDisconnectedFilter.addAction(Intent.ACTION_POWER_DISCONNECTED); context.registerReceiver(new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { //Update date of last charge if power was disconnected and battery is full if (batteryPct > 0.98) { dateLastCharge = currentTimeMillis(); settings.set(Constants.PREF_DATE_LAST_CHARGE, dateLastCharge); Log.d(Constants.TAG, "MessagesListener dateLastCharge saved: " + dateLastCharge); } } }, powerDisconnectedFilter); }
DataBundle dataBundle = new DataBundle(); notificationData.toDataBundle(dataBundle); transporterNotifications.send(Transport.INCOMING_NOTIFICATION, dataBundle, new Transporter.DataSendResultCallback() {
@Subscribe(threadMode = ThreadMode.MAIN) public void reply(ReplyNotificationEvent event) { Log.d(Constants.TAG, "MainService reply to notification, key: " + event.getKey() + ", message: " + event.getMessage()); DataBundle dataBundle = new DataBundle(); dataBundle.putString("key", event.getKey()); dataBundle.putString("message", event.getMessage()); send(Transport.REPLY, dataBundle); }
@Subscribe(threadMode = ThreadMode.MAIN) public void silence(SilenceApplicationEvent event) { Log.d(Constants.TAG, "MainService silence application, package: " + event.getPackageName() + ", minutes: " + event.getMinutes()); DataBundle dataBundle = new DataBundle(); dataBundle.putString("package", event.getPackageName()); dataBundle.putString("minutes", event.getMinutes()); send(Transport.SILENCE, dataBundle); }
private void sendNotificationWithStandardUI(NotificationData nd) { DataBundle dataBundle = new DataBundle(); Intent intent = new Intent(); int nextId = (int) (long) (System.currentTimeMillis() % 10000L);
DataBundle dataBundle = new DataBundle(); notificationData.toDataBundle(dataBundle); transporterNotifications.send(Transport.INCOMING_NOTIFICATION, dataBundle, new Transporter.DataSendResultCallback() {
private void sendNotificationWithStandardUI(byte filterResult, StatusBarNotification statusBarNotification) { DataBundle dataBundle = new DataBundle(); int id = NotificationJobService.NOTIFICATION_POSTED_STANDARD_UI; int jobId = + abs((int) (long) (statusBarNotification.getId() % 10000L)); dataBundle.putParcelable("data", StatusBarNotificationData.from(this, statusBarNotification, false)); NotificationStore.addStandardNotification(statusBarNotification.getKey(), dataBundle); scheduleJob(id, jobId, statusBarNotification.getKey()); /* * Disabled while testing JobScheduler * //Connect transporter Transporter notificationTransporter = TransporterClassic.get(this, "com.huami.action.notification"); notificationTransporter.connectTransportService(); notificationTransporter.send("add", dataBundle, new Transporter.DataSendResultCallback() { @Override public void onResultBack(DataTransportResult dataTransportResult) { log.d(dataTransportResult.toString()); } }); //Disconnect transporter to avoid leaking notificationTransporter.disconnectTransportService(); log.i("NotificationService StandardUI: " + dataBundle.toString()); */ log.i("NotificationService StandardUI jobScheduled: " + jobId); }
DataBundle dataBundle = new DataBundle(); if (transportable != null) { transportable.toDataBundle(dataBundle);
DataBundle dataBundle = new DataBundle(); dataBundle.putParcelable("data", StatusBarNotificationData.from(this, statusBarNotification, false)); int nextId = abs((int) (long) (statusBarNotification.getId() % 10000L)) + i; Log.d(Constants.TAG, "NotificationService onNotificationRemoved grouped id: " + nextId); dataBundle = new DataBundle(); StatusBarNotification sbn = new StatusBarNotification(statusBarNotification.getPackageName(), "", nextId, statusBarNotification.getTag(), 0, 0, 0,