@Override public void writeToParcel(Parcel dest, int flags) { dest.writeFloat(this.x); dest.writeFloat(this.getY()); if (getData() != null) { if (getData() instanceof Parcelable) { dest.writeInt(1); dest.writeParcelable((Parcelable) this.getData(), flags); } else { throw new ParcelFormatException("Cannot parcel an Entry with non-parcelable data"); } } else { dest.writeInt(0); } }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeFloat(this.mVal); dest.writeInt(this.mXIndex); if (mData != null) { if (mData instanceof Parcelable) { dest.writeInt(1); dest.writeParcelable((Parcelable) this.mData, flags); } else { throw new ParcelFormatException("Cannot parcel an Entry with non-parcelable data"); } } else { dest.writeInt(0); } }
@Override public void writeToParcel(Parcel parcel, int i) { try { parcel.writeString(this.uid); parcel.writeString(this.name); parcel.writeString(this.image); parcel.writeString(this.email); parcel.writeLong(this.lastSeen); parcel.writeString(this.fcm); } catch (ParcelFormatException e) { e.printStackTrace(); } }
@Override public void writeToParcel(Parcel parcel, int i) { try { parcel.writeString(this.uid); parcel.writeString(this.name); parcel.writeString(this.image); parcel.writeString(this.message); parcel.writeString(this.time); } catch (ParcelFormatException e) { e.printStackTrace(); } }
public static void parseWearActions(Context context, Notification notification, PebbleNotification pebbleNotification, List<NotificationAction> storage) { try { if (storage.size() >= NotificationAction.MAX_NUMBER_OF_ACTIONS) return; Bundle extras = NotificationTextParser.getExtras(notification); if (extras.containsKey("android.wearable.EXTENSIONS")) { Bundle wearExtras = extras.getBundle("android.wearable.EXTENSIONS"); if (wearExtras.containsKey("actions")) { ArrayList<?> actionList = (ArrayList<?>) wearExtras.get("actions"); for (Object obj : actionList) { if (storage.size() >= NotificationAction.MAX_NUMBER_OF_ACTIONS) break; NotificationAction action = null; if (obj instanceof Bundle) action = WearVoiceAction.parseFromBundle((Bundle) obj); else if (obj instanceof Notification.Action) action = WearVoiceAction.parseFromAction((Notification.Action) obj); if (action != null) storage.add(action); } } if (storage.size() >= NotificationAction.MAX_NUMBER_OF_ACTIONS) return; if (wearExtras.containsKey("pages")) { Parcelable[] pages = wearExtras.getParcelableArray("pages"); int counter = 1; for (Parcelable page : pages) { if (storage.size() >= NotificationAction.MAX_NUMBER_OF_ACTIONS) return; PebbleNotification pageNotification = NotificationHandler.getPebbleNotificationFromAndroidNotification(context, new NotificationKey(pebbleNotification.getKey().getPackage(), null, null), (Notification) page, false); if (pageNotification == null) continue; pageNotification.setForceSwitch(true); pageNotification.setText(TextUtil.trimStringFromBack(pageNotification.getText(), NotificationSendingModule.getMaximumTextLength(pebbleNotification.getSettingStorage(context)))); storage.add(new NotifyAction(context.getString(R.string.wearPageAction, counter), pageNotification)); counter++; } } } } catch (ParcelFormatException e) //Some phones (or apps?) seems to throw this when unparceling data. { Timber.w("Got ParcelFormatException at parseWearActions!"); } }