Clean up RandomBitsSupplier.

The reason the array had later items commented out is that the loop
was wrong: it would always choose the _last_ valid device, not the
_first_ as intended.

There were two choices here:
1. fix the loop and have the same list of three devices that OpenSSL uses.
2. remove the loop and just say "you must have /dev/urandom".

This patch goes with option 2.

Change-Id: Ia99be6ba929c7b6c35bed77c19d47de80719973c
Fix AbstractCollection.toArray.

ConcurrentHashMap.values().toArray() could throw if the map was being modified.
WeakHashMap had a workaround, but AbstractCollection is supposed to just do the
right thing.

Bug: http://code.google.com/p/android/issues/detail?id=36519
Bug: https://issues.apache.org/jira/browse/HARMONY-6681
Change-Id: I749fe615edbea6f8285bfe6804c972e8bdcf2530
Clean up ZipFile a little, fix a few bugs, and improve the documentation.

The main bug fixed is fixing support for .zip files larger than 2GiB (where
the central directory offset's top bit is set).

We were checking character counts rather than byte counts in several places
too, which could lead to corrupt zip files.

I've also added a comment to readCentralDirectory because I keep coming back
to this code, wanting to make it lazy, and never remember (until I've done
half the work) why that's not possible.

I've also clarified a lot of the documentation.

Bug: http://code.google.com/p/android/issues/detail?id=36187
Change-Id: Iaa8eadc501ead7c70528bd9063d5893a325dcea1
More java.util.zip documentation improvements.

Change-Id: I8ebc23b8a7a7affee0fd3756c3861cf5b6c07ee4
Protect broken code against native crashes.

It doesn't make any sense to access Matcher or BreakIterator concurrently from
multiple threads, but we shouldn't crash in native code.

Bug: http://code.google.com/p/android/issues/detail?id=41143
Change-Id: I5d0ed97be50ffb7c6cc281ac6293cf82f17e7b80

Conflicts:
	luni/src/main/java/libcore/icu/NativeBreakIterator.java
Fix some TimerTest flakiness.

There's more flakiness around here, but this is a start. I'm not sure
what we should do with the tests that test how many times a task
has been executed in a given period, so I've left them for now.

Bug: 7766472
Bug: 7745085
Bug: 7740706
Bug: 6896554
Change-Id: I84d8aa036c075024d5cefdad050884762eab50a3
FileChannelImpl: Ignore ftruncate failures on non-regular files

Truncate only works on regular files.  On other files, such as
UNIX character devices, truncate returns EINVAL, which
causes an IOException to be thrown.

With this change, we now have support for creating a MappedByteBuffer
on UNIX character devices such as /dev/zero, if the underlying
device node supports mmap().

Change-Id: I094371d821b187abe3da32edc411ff76a81b047e
Fix X509Certificate.getBasicConstraints implementation for DRLCertFactory

Change-Id: I5d1ba078b0f8f9ec8e2950e0da02481e8162a5e6
Track redundant ops when opening the cache.

See https://github.com/JakeWharton/DiskLruCache/issues/28

Change-Id: I4815aed3b40f0d2599ff12a42853a4947feffbca
NativeCrypto: RSA fields cannot be NULL

If an RSA field is left NULL, it will not be represented in the ASN.1
output of the RSAPrivateKey. This leads to problems trying to recreate
the key since it does not emit the NULL fields and the fields are not
numbered.

Bug: 7920357
Change-Id: I144302925f9b080a2152a6d12f77981b3aad9495
Improve our time zone name collection.

A variety of bugs here. We weren't using dates in the current year,
we were assuming that icu4c has correct time zone transition data (it
usually doesn't), and in the fallback code (which we'd previously
never hit) we weren't honoring the caller's request for standard/daylight
time.

This patch fixes:

         Africa/Tripoli: long='Eastern European Standard Time' short='Eastern European Standard Time'!
      America/Araguaina: long='Brasilia Standard Time' short='Brasilia Standard Time'!
   America/Campo_Grande: long='Amazon Standard Time' short='Amazon Standard Time'!
         America/Cuiaba: long='Amazon Standard Time' short='Amazon Standard Time'!
         America/Havana: long='Cuba Standard Time' short='Cuba Standard Time'!
       America/Santiago: long='Chile Standard Time' short='Chile Standard Time'!
      America/Sao_Paulo: long='Brasilia Standard Time' short='Brasilia Standard Time'!
      Antarctica/Palmer: long='Chile Standard Time' short='Chile Standard Time'!
         Asia/Jerusalem: long='Israel Standard Time' short='Israel Standard Time'!
            Asia/Tehran: long='Iran Standard Time' short='Iran Standard Time'!
          Asia/Tel_Aviv: long='Israel Standard Time' short='Israel Standard Time'!
            Brazil/East: long='Brasilia Standard Time' short='Brasilia Standard Time'!
      Chile/Continental: long='Chile Standard Time' short='Chile Standard Time'!
     Chile/EasterIsland: long='Easter Island Standard Time' short='Easter Island Standard Time'!
                   Cuba: long='Cuba Standard Time' short='Cuba Standard Time'!
                   Iran: long='Iran Standard Time' short='Iran Standard Time'!
                 Israel: long='Israel Standard Time' short='Israel Standard Time'!
                  Libya: long='Eastern European Standard Time' short='Eastern European Standard Time'!
           Pacific/Apia: long='Samoa Standard Time' short='Samoa Standard Time'!
         Pacific/Easter: long='Easter Island Standard Time' short='Easter Island Standard Time'!
           Pacific/Fiji: long='Fiji Standard Time' short='Fiji Standard Time'!

It also fixes Pacific/Fakaofo, which was confused between GMT+14:00 and
GMT+13:00.

We need a special case for Pacific/Apia because icu4c 4.9 doesn't believe
Samoa has ever used daylight time.

I've also added a test to keep us out of mischief in the face of future
upgrades to the Olson tzdata and/or icu4c.

Bug: 7955614
Bug: 8026776
Change-Id: I7ed551a691f29e26dd71456d492493d2a4fce945
Don't call GetMethodID with a pending exception.

Why has no-one been hitting this? Because you'd need your first
getaddrinfo(3) failure to be an EAI_SYSTEM kind of failure, and
you'd need CheckJNI on. So only developers could hit this, and
they'd have to be really unlucky. Like the guy sitting next to me.

Change-Id: I6d2808722eaa50a96ebfa92b996803783601e429
icu4c 4.9 can localize "fil".

Bug: 8023288
Change-Id: I40d26622e135c5ab06c90b1744a87bcf8cb320de
Manually update the libcore native code.

Cherry-picking all the individual tiny cleanups from the internal branch was
too hard.

Change-Id: Ib97643d3502295685390854c9edd97c93c4c2ecf
Don't rely on fallback time zone names starting "GMT".

I can't think of a way to say what I actually want to say here, so let's
just wait for icu4c 50 and hope we can rewrite all this code with the new
TimeZoneNames API. Until then, various locales -- those whose gmtFormat
doesn't start "GMT" -- still have the bugs that the previous change fixes
for the majority of locales.

Also switch from "Samoa Summer Time" to "Samoa Daylight Time" because that's
what CLDR is proposing to go with.

Change-Id: I47e2fc413ccde6af59f51e5ec79e664a1dc8be82