Commit Graph

20 Commits

Author SHA1 Message Date
Dan Egnor
66424a44c5 Fix OperationScheduler moratorium calculation for clock rollback case.
Make the unit test exercise some clock-rollback scenarios, using
a properly injected artificial clock.

Bug: 2579585
Change-Id: I6f81c32318ba27429bd30ff53b48449218e4ac64
2010-04-08 17:30:37 -07:00
Brett Chabot
49b35b5f9c Add test annotations to frameworks common tests.
Change-Id: Iaf5af2cbd49015ac8f1bf23a4d20f055ac9a000e
2010-04-02 08:53:22 -07:00
Ying Wang
d26e9cebe7 Fix Proguard flags. 2010-03-02 09:36:33 -08:00
Dianne Hackborn
5dda951bcf Re-arrange android-common so framework no longer links with it.
This is the framework part, moving classes around so the framework
no longer needs to link to android-common.  Makes some APIs public,
others that didn't need to be public are private in the framework,
some small things are copied.
2010-02-25 11:39:33 -08:00
Dan Egnor
3283401e81 Add some useful methods to OperationScheduler to inquire into
the history, in case you want to second-guess its scheduling.
2010-02-17 17:07:01 -08:00
Shimeng (Simon) Wang
caa1551875 Merge "Enhance URL regular expression to match more Unicode chars." 2010-02-16 10:49:37 -08:00
Doug Zongker
53fc61801e remove Base64 from android-common
This is now available in the framework as android.util.base64.*;

Change-Id: I54901d32b2b5b291cfa0b4c2479b805038ba12ac
2010-02-14 15:31:27 -08:00
Doug Zongker
27a31e573f add Base64InputStream
Change-Id: I777b54bd6d01c86105b473a6701a06d350cee8d1
2010-02-12 10:53:46 -08:00
Shimeng (Simon) Wang
3207e29d10 Enhance URL regular expression to match more Unicode chars.
Enhance URL regular expression to match legal one byte Unicode characters in
Internationalized Resource Identifiers as detailed in RFC 3987.  Specifically
two byte Unicode characters are not included.  Not all things in RFC 3987 is
implemented, this is just an enhancement for recognizing more common used one
byte Unicode characters.

This change helps Browser address bar identify more valid URL without scheme
typed in, such as 현금영수증.kr

make-iana-tld-pattern.py is modified to contain only Top Level Domain
regular expression generation.  Other parts of WEB_URL pattern are in
solely in Patters.java for better consistency and maintenance.
2010-02-11 14:07:44 -08:00
Doug Zongker
0ab1771146 add Base64OutputStream to android-common
Base64OutputStream is a FilterOutputStream that can encode or decode
base-64 data (with any of the flags supported by the Base64 class --
crlf, padding vs not, line wrapping vs not, etc.)

We change Base64 to have package-private decodeInternal and
encodeInternal methods that save all their state in objects and can be
called multiple times to stream data.  The existing functions for
in-memory encoding/decoding call the internal method once; the output
stream calls it multiple times.

Change-Id: Iac661d05329bc2e6b2863088efcedc974415ec44
2010-02-10 11:10:53 -08:00
Shimeng (Simon) Wang
e757f9f464 Regenerate the TopLevelDomain from iana.org website.
This is to capture recently added top level domains.
	modified:   common/java/com/android/common/Patterns.java

	modified:   common/tests/src/com/android/common/PatternsTest.java
2010-02-09 15:13:09 -08:00
Doug Zongker
52a0bb3857 Merge "rename encodeString to encodeToString" 2010-02-05 05:44:17 -08:00
Dan Egnor
8e83db5f24 Merge "Add ability to parse HTTP-format moratorium times (since pretty much every user wants this)." 2010-02-04 19:48:52 -08:00
Doug Zongker
f9d3196cc8 rename encodeString to encodeToString
Change-Id: I777530b80a9e8be8c487e140574621cd9d35dc35
2010-02-04 17:07:59 -08:00
Doug Zongker
b7cc1ec723 a new java implementation of base64 for android-common
A new Base64 encoder/decoder class.  Some benchmarks comparing the
decoder it to those from android.os.Base64Utils (a decode-only native
implementation not accessible to apps) and
org.apache.commons.codec.binary.Base64, all with the JIT enabled:

  1k encoded data
  APACHE   avg:   811 us    min:   244 us    max: 13671 us
  COMMON   avg:   263 us    min:    30 us    max:  4730 us
  NATIVE   avg:   102 us    min:    61 us    max:  5493 us

  10k encoded data
  APACHE   avg:  3624 us    min:  2746 us    max: 23895 us
  COMMON   avg:   979 us    min:   518 us    max:  7751 us
  NATIVE   avg:   817 us    min:   762 us    max:  3143 us

  100k encoded data
  APACHE   avg: 33167 us    min: 31829 us    max: 140411 us
  COMMON   avg:  6047 us    min:  5493 us    max: 45227 us
  NATIVE   avg: 10109 us    min: 10009 us    max: 12451 us

Change-Id: Ic622e3a967a62d57d30bd25b80cbe4e0dd60e764
2010-02-04 15:54:00 -08:00
Dan Egnor
d11052311f Add ability to parse HTTP-format moratorium times
(since pretty much every user wants this).
2010-02-03 18:28:08 -08:00
Makoto Onuki
1b925b0998 Addign more tests for DomainNameValidator.
Added tests that use actual certificates.

See bug:2369689 for background.
2010-01-19 15:03:10 -08:00
Makoto Onuki
831f258fd9 Moved DomainNameChecker to android common.
- Moved DomainNameChecker from android.net.http to android common, and renamed to DomainNameValidator.
- Added a simplified version of DNParser, which DomainNameValidator uses instead of X509Name in order to extract Subject Name from a certificate.
- Added unit tests for DomainNameChecker and DNParser.

There's a suspicious comment in DomainNameChecker saying something like "X509Certificate fails to parse a certificate when a subject alt name begins with '*'".  I think we should fix it if it's really the case -- otherwise certificates with the wildcard wouldn't work.  I'll see if it's true after submitting this patch.
2010-01-12 10:27:13 -08:00
Dan Egnor
a649612e68 Add OperationScheduler (and test) to the common static library;
includes new string parsing function (and test).
2009-11-21 10:09:46 -08:00
Dan Egnor
a6f4698289 Create android-common static library which gets included in frameworks.jar,
but can also be used by unbundled apps.  Move android.text.util.Regex there as
a starting example, renamed to a more sensible (?) com.android.common.Patterns.
Set up a corresponding test package, and move RegexTest (to PatternsTest).
Update clients.
2009-11-18 12:05:04 -08:00