// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.olio.phone_state; import android.content.ContentResolver; import android.os.Parcel; import com.olio.communication.messages.MessagePayload; import com.olio.communication.notifications.DatabaseInsertable; import com.olio.util.ALog; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; // Referenced classes of package com.olio.phone_state: // SimpleWeatherData, Weather public class WeatherComplicationData extends MessagePayload implements DatabaseInsertable, Serializable { public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() { public MessagePayload createFromParcel(Parcel parcel) { return MessagePayload.unpackParcel(parcel); } public volatile Object createFromParcel(Parcel parcel) { return createFromParcel(parcel); } public MessagePayload[] newArray(int i) { return new WeatherComplicationData[i]; } public volatile Object[] newArray(int i) { return newArray(i); } }; public static final String INTERNAL_PACKAGE_NAME = "OlioWeatherComplicationData"; public static final String WEATHER_CARD_NOTIFICATION_ID = "com.oliodevices.bluetooth_host.app.api.WeatherApi:CARD_NOTIFICATION_ID"; public static final String WEATHER_CITY_ID_FORMAT = "com.olio.phone_state.WeatherComplicationData(%s)"; public static final String WEATHER_ID = "com.olio.phone_state.WeatherComplicationData"; private static final long serialVersionUID = 31L; String cityName; HashMap mWeatherStateForecast; public WeatherComplicationData() { } public static String createWeatherCityNotificationId(String s) { if (s == null || s.isEmpty()) { return "com.olio.phone_state.WeatherComplicationData"; } else { return String.format("com.olio.phone_state.WeatherComplicationData(%s)", new Object[] { s }); } } public static void insert(ContentResolver contentresolver, WeatherComplicationData weathercomplicationdata) { ALog.d("Weather=INSERT City='%s', Id='%s'", new Object[] { weathercomplicationdata.cityName, weathercomplicationdata.getNotificationId() }); com.olio.communication.notifications.NotificationContract.Notifications.insert(contentresolver, weathercomplicationdata); } public static WeatherComplicationData weatherDataForCity(ContentResolver contentresolver, String s) { return (WeatherComplicationData)com.olio.communication.notifications.NotificationContract.Notifications.originalNotificationForId(contentresolver, createWeatherCityNotificationId(s)); } public static SimpleWeatherData weatherInTimeSegment(ContentResolver contentresolver, String s, long l, long l1) { contentresolver = weatherDataForCity(contentresolver, s); if (contentresolver == null) { return new SimpleWeatherData(); } s = contentresolver.getWeatherStateForecast(); Object obj = new ArrayList(s.keySet()); Collections.sort(((java.util.List) (obj))); float f = 0.0F; int i = 0; contentresolver = ""; obj = ((ArrayList) (obj)).iterator(); do { label0: { long l2; if (((Iterator) (obj)).hasNext()) { l2 = ((Long)((Iterator) (obj)).next()).longValue(); if (l2 < l) { continue; } if (l2 <= l1) { break label0; } } s = new SimpleWeatherData(); Weather weather; if (i != 0) { i = Math.round(f / (float)i); } else { i = 0; } s.setTemperature(i); s.setWeatherIcon(contentresolver); return s; } weather = (Weather)s.get(Long.valueOf(l2)); f += weather.getTemperature(); i++; contentresolver = SimpleWeatherData.worst(weather.getWeatherIcon(), contentresolver); } while (true); } public boolean equals(Object obj) { if (obj != null) { if (obj == this) { return true; } if (obj.getClass() == getClass()) { WeatherComplicationData weathercomplicationdata = (WeatherComplicationData)obj; return (new EqualsBuilder()).appendSuper(super.equals(obj)).append(cityName, weathercomplicationdata.getCityName()).append(mWeatherStateForecast, weathercomplicationdata.getWeatherStateForecast()).isEquals(); } } return false; } public String getCityName() { return cityName; } public Date getDateCreated() { return new Date(); } public com.olio.communication.notifications.new_notifications.StreamItem.DisplayType getDisplayType() { return null; } public com.olio.communication.notifications.NotificationFilters.Category getNotificationCategory() { return null; } public String getNotificationId() { return createWeatherCityNotificationId(cityName); } public String getPackage() { return "OlioWeatherComplicationData"; } public int getPriority() { return 0; } public com.olio.communication.notifications.new_notifications.StreamItem.VibrationType getVibrationType() { return null; } public HashMap getWeatherStateForecast() { return mWeatherStateForecast; } public int hashCode() { return (new HashCodeBuilder(47, 77)).append(cityName).append(mWeatherStateForecast).toHashCode(); } public void setCityName(String s) { cityName = s; } public void setWeatherStateForecast(HashMap hashmap) { mWeatherStateForecast = hashmap; } }