Loading api/current.xml +13 −32 Original line number Diff line number Diff line Loading @@ -90859,35 +90859,8 @@ <parameter name="userAgent" type="java.lang.String"> </parameter> </method> <field name="DEFAULT_SYNC_MIN_GZIP_BYTES" type="long" transient="false" volatile="false" static="true" final="false" deprecated="not deprecated" visibility="public" > </field> </class> <class name="HttpDateTime" extends="java.lang.Object" abstract="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <constructor name="HttpDateTime" type="android.net.http.HttpDateTime" static="false" final="false" deprecated="not deprecated" visibility="public" > </constructor> <method name="parse" return="java.lang.Long" <method name="parseDate" return="long" abstract="false" native="false" synchronized="false" Loading @@ -90896,11 +90869,19 @@ deprecated="not deprecated" visibility="public" > <parameter name="timeString" type="java.lang.String"> <parameter name="dateString" type="java.lang.String"> </parameter> <exception name="IllegalArgumentException" type="java.lang.IllegalArgumentException"> </exception> </method> <field name="DEFAULT_SYNC_MIN_GZIP_BYTES" type="long" transient="false" volatile="false" static="true" final="false" deprecated="not deprecated" visibility="public" > </field> </class> <class name="SslCertificate" extends="java.lang.Object" common/java/com/android/common/OperationScheduler.java +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.common; import android.content.SharedPreferences; import android.net.http.HttpDateTime; import android.net.http.AndroidHttpClient; import android.text.format.Time; import java.util.Map; Loading Loading @@ -243,7 +243,7 @@ public class OperationScheduler { return true; } catch (NumberFormatException nfe) { try { setMoratoriumTimeMillis(HttpDateTime.parse(retryAfter)); setMoratoriumTimeMillis(AndroidHttpClient.parseDate(retryAfter)); return true; } catch (IllegalArgumentException iae) { return false; Loading core/java/android/net/http/AndroidHttpClient.java +19 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.net.http; import com.android.internal.http.HttpDateTime; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpEntityEnclosingRequest; Loading Loading @@ -444,4 +445,22 @@ public final class AndroidHttpClient implements HttpClient { return builder.toString(); } /** * Returns the date of the given HTTP date string. This method can identify * and parse the date formats emitted by common HTTP servers, such as * <a href="http://www.ietf.org/rfc/rfc0822.txt">RFC 822</a>, * <a href="http://www.ietf.org/rfc/rfc0850.txt">RFC 850</a>, * <a href="http://www.ietf.org/rfc/rfc1036.txt">RFC 1036</a>, * <a href="http://www.ietf.org/rfc/rfc1123.txt">RFC 1123</a> and * <a href="http://www.opengroup.org/onlinepubs/007908799/xsh/asctime.html">ANSI * C's asctime()</a>. * * @return the number of milliseconds since Jan. 1, 1970, midnight GMT. * @throws IllegalArgumentException if {@code dateString} is not a date or * of an unsupported format. */ public static long parseDate(String dateString) { return HttpDateTime.parse(dateString); } } core/java/android/webkit/CacheManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -17,8 +17,8 @@ package android.webkit; import android.content.Context; import android.net.http.AndroidHttpClient; import android.net.http.Headers; import android.net.http.HttpDateTime; import android.os.FileUtils; import android.util.Log; import java.io.File; Loading Loading @@ -716,7 +716,7 @@ public final class CacheManager { ret.expiresString = headers.getExpires(); if (ret.expiresString != null) { try { ret.expires = HttpDateTime.parse(ret.expiresString); ret.expires = AndroidHttpClient.parseDate(ret.expiresString); } catch (IllegalArgumentException ex) { // Take care of the special "-1" and "0" cases if ("-1".equals(ret.expiresString) Loading Loading @@ -831,7 +831,7 @@ public final class CacheManager { // 24 * 60 * 60 * 1000 long lastmod = System.currentTimeMillis() + 86400000; try { lastmod = HttpDateTime.parse(ret.lastModified); lastmod = AndroidHttpClient.parseDate(ret.lastModified); } catch (IllegalArgumentException ex) { Log.e(LOGTAG, "illegal lastModified: " + ret.lastModified); } Loading core/java/android/webkit/CookieManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package android.webkit; import android.net.ParseException; import android.net.WebAddress; import android.net.http.HttpDateTime; import android.net.http.AndroidHttpClient; import android.util.Log; Loading Loading @@ -939,7 +939,7 @@ public final class CookieManager { } if (name.equals(EXPIRES)) { try { cookie.expires = HttpDateTime.parse(value); cookie.expires = AndroidHttpClient.parseDate(value); } catch (IllegalArgumentException ex) { Log.e(LOGTAG, "illegal format for expires: " + value); Loading Loading
api/current.xml +13 −32 Original line number Diff line number Diff line Loading @@ -90859,35 +90859,8 @@ <parameter name="userAgent" type="java.lang.String"> </parameter> </method> <field name="DEFAULT_SYNC_MIN_GZIP_BYTES" type="long" transient="false" volatile="false" static="true" final="false" deprecated="not deprecated" visibility="public" > </field> </class> <class name="HttpDateTime" extends="java.lang.Object" abstract="false" static="false" final="true" deprecated="not deprecated" visibility="public" > <constructor name="HttpDateTime" type="android.net.http.HttpDateTime" static="false" final="false" deprecated="not deprecated" visibility="public" > </constructor> <method name="parse" return="java.lang.Long" <method name="parseDate" return="long" abstract="false" native="false" synchronized="false" Loading @@ -90896,11 +90869,19 @@ deprecated="not deprecated" visibility="public" > <parameter name="timeString" type="java.lang.String"> <parameter name="dateString" type="java.lang.String"> </parameter> <exception name="IllegalArgumentException" type="java.lang.IllegalArgumentException"> </exception> </method> <field name="DEFAULT_SYNC_MIN_GZIP_BYTES" type="long" transient="false" volatile="false" static="true" final="false" deprecated="not deprecated" visibility="public" > </field> </class> <class name="SslCertificate" extends="java.lang.Object"
common/java/com/android/common/OperationScheduler.java +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.common; import android.content.SharedPreferences; import android.net.http.HttpDateTime; import android.net.http.AndroidHttpClient; import android.text.format.Time; import java.util.Map; Loading Loading @@ -243,7 +243,7 @@ public class OperationScheduler { return true; } catch (NumberFormatException nfe) { try { setMoratoriumTimeMillis(HttpDateTime.parse(retryAfter)); setMoratoriumTimeMillis(AndroidHttpClient.parseDate(retryAfter)); return true; } catch (IllegalArgumentException iae) { return false; Loading
core/java/android/net/http/AndroidHttpClient.java +19 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.net.http; import com.android.internal.http.HttpDateTime; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpEntityEnclosingRequest; Loading Loading @@ -444,4 +445,22 @@ public final class AndroidHttpClient implements HttpClient { return builder.toString(); } /** * Returns the date of the given HTTP date string. This method can identify * and parse the date formats emitted by common HTTP servers, such as * <a href="http://www.ietf.org/rfc/rfc0822.txt">RFC 822</a>, * <a href="http://www.ietf.org/rfc/rfc0850.txt">RFC 850</a>, * <a href="http://www.ietf.org/rfc/rfc1036.txt">RFC 1036</a>, * <a href="http://www.ietf.org/rfc/rfc1123.txt">RFC 1123</a> and * <a href="http://www.opengroup.org/onlinepubs/007908799/xsh/asctime.html">ANSI * C's asctime()</a>. * * @return the number of milliseconds since Jan. 1, 1970, midnight GMT. * @throws IllegalArgumentException if {@code dateString} is not a date or * of an unsupported format. */ public static long parseDate(String dateString) { return HttpDateTime.parse(dateString); } }
core/java/android/webkit/CacheManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -17,8 +17,8 @@ package android.webkit; import android.content.Context; import android.net.http.AndroidHttpClient; import android.net.http.Headers; import android.net.http.HttpDateTime; import android.os.FileUtils; import android.util.Log; import java.io.File; Loading Loading @@ -716,7 +716,7 @@ public final class CacheManager { ret.expiresString = headers.getExpires(); if (ret.expiresString != null) { try { ret.expires = HttpDateTime.parse(ret.expiresString); ret.expires = AndroidHttpClient.parseDate(ret.expiresString); } catch (IllegalArgumentException ex) { // Take care of the special "-1" and "0" cases if ("-1".equals(ret.expiresString) Loading Loading @@ -831,7 +831,7 @@ public final class CacheManager { // 24 * 60 * 60 * 1000 long lastmod = System.currentTimeMillis() + 86400000; try { lastmod = HttpDateTime.parse(ret.lastModified); lastmod = AndroidHttpClient.parseDate(ret.lastModified); } catch (IllegalArgumentException ex) { Log.e(LOGTAG, "illegal lastModified: " + ret.lastModified); } Loading
core/java/android/webkit/CookieManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package android.webkit; import android.net.ParseException; import android.net.WebAddress; import android.net.http.HttpDateTime; import android.net.http.AndroidHttpClient; import android.util.Log; Loading Loading @@ -939,7 +939,7 @@ public final class CookieManager { } if (name.equals(EXPIRES)) { try { cookie.expires = HttpDateTime.parse(value); cookie.expires = AndroidHttpClient.parseDate(value); } catch (IllegalArgumentException ex) { Log.e(LOGTAG, "illegal format for expires: " + value); Loading