preferred_time_zones.xml is not referenced in any code and has been
deleted here.
TimeUtilsTest.java is broken / out of date and semi-duplicates code
in android.util.cts.TimeUtilsTest. It has been deleted here.
time_zones_by_country.xml file has not been updated since (at least)
2009.
Ideally this information would be updated as needed when the
timezone rule data is updated on device. This change just brings the
data up to date without addressing that issue. Given the apparent,
non-obvious, ordering requirements it may not be possible to use
zone1970.tab data directly.
---------------
Impact assessment:
At the time of writing time_zones_by_country.xml is used from:
Non-public methods:
android.util.TimeUtils.getTimeZones(String)
Public methods:
android.util.TimeUtils.getTimeZone(int, boolean, long, String)
android.util.TimeUtils.getTimeZonesWithUniqueOffsets(String)
Therefore there is some app / user benefit from updating it.
Within the framework, this affects:
telephony.ServiceStateTracker - in some circumstances when receiving
offset information from cell networks when better information is not
available.
There is some clockwork code affected that uses the calls for similar
purposes.
---------------
Notes on file formats / mapping the IANA source data:
The updated data was sourced from the IANA tzdata 2016g file
called zone1970.tab. The time_zones_by_country.xml file was manually
edited in a text editor using criteria detailed below.
The zone1970.tab file maps country codes (column 1) to a zone ID
(column 3). A country can be mapped to multiple zones. The zone.tab file
that was likely used in the past is similar in content and format. See
the zone.tab file header for details of the differences.
The time_zones_by_country.xml can have multiple entries for each
country, starting with a comment.
Comments exist for each (Country, Offset) pair. The name is
free-text, the offset is a non-DST offset for a zone as of 14th Oct
2016 using the 2016g data.
<!-- {Country name}, {offset from UTC} -->
Countries are listed in ASCII ascending order of the country code.
Within each country offsets are mostly ordered east to
west. An exception appears to be Australia. The data may have a
secondary order of "best match" (e.g. maybe by population). This might
be important for getTimeZone(int, boolean, long, String)) since it
returns the first match for a given offset, dst, country.
The timezone offset, transition information itself (offset, dst) is
pulled from the timezone rules data on the device, not this file.
The data is encoded for each (Country, Offset) pair by a sequence
of:
<timezone code="xx">{Olson ID}</timezone>
xx is the country code from column 1 in the zone1970.tab file, the
element content is the zone ID from column 3.
---------------
Notes on the changes made to time_zones_by_country.xml:
There are various changes in this commit associated with switching from
zone.tab to zone1970.tab as a data source: zone.tab uses different
Olson IDs due to the different criteria used by these files.
The offset in each case will be the same so will have no practical
effect on offsets / zone detection, though will affect the exemplar
location for the zone found.
The remaining changes reflect actual zone / offset changes that
have occurred.
When adding new zones or rearranging existing ones they have been
positioned so as not to modify the first zone for each country or
the first zone per offset because of the uncertainty about the
secondary ordering. This is to avoid the risk of now picking a
different zone for a country or {country + dst + offset}. This
has resulted in a couple of places where the ordering is
non-intuitive.
The zone names and the offset information contained in the comments was
checked semi-manually using other 2016g data, i.e. the base offset of
each zone was checked against output from a script that created a
TimeZone object from each Olson ID in the file and output the raw
(non-DST) offset.
---------------
Change specifics:
Changes made due to zone1970.tab vs zone.tab:
ANTIGUA AND BARBUDA
ANGUILLA
ANGOLA
ALAND ISLANDS
ARUBA
BOSNIA AND HERZEGOVINA
BURKINA FASO
BAHRAIN
BENIN
BOTSWANA
CONGO
CENTRAL AFRICAN REPUBLIC
CONGO
CAMEROON
DJIBOUTI
DOMINICA
ERITREA
ETHIOPIA
GABON
GRENADA
GUERNSEY
GAMBIA
GUINEA
GUADELOUPE
EQUATORIAL GUINEA
CROATIA
ISLE OF MAN
JERSEY
CAMBODIA
COMOROS
SAINT KITTS AND NEVIS
KUWAIT
CAYMAN ISLANDS
LAO PEOPLE'S DEMOCRATIC REPUBLIC
SAINT LUCIA
LIECHTENSTEIN
LESOTHO
MONTENEGRO
MADAGASCAR
MACEDONIA
MALI
NORTHERN MARIANA ISLANDS
MAURITANIA
MONTSERRAT
MALAWI
NIGER
OMAN
RWANDA
SAINT HELENA
SLOVENIA
SVALBARD AND JAN MAYEN
SLOVAKIA
SIERRA LEONE
SAN MARINO
SENEGAL
SOMALIA
SAO TOME AND PRINCIPE
SWAZILAND
TOGO
TANZANIA
UGANDA
UNITED STATES MINOR OUTLYING ISLANDS
HOLY SEE
SAINT VINCENT AND THE GRENADINES
VIRGIN ISLANDS
YEMEN
MAYOTTE
ZAMBIA
ZIMBABWE
---------
Changes due to new data:
ANTARCTICA
ARGENTINA
AUSTRALIA
BRAZIL
CANADA
CHINA
MICRONESIA
INDIA
MYANMAR
MEXICO
PAPUA NEW GUINEA
PALESTINE
RUSSIAN FEDERATION
UNITED STATES
UKRAINE
---------
Removal of NETHERLANDS ANTILLES (country code "an"):
"an" no longer present in the IANA data.
The country code is no longer in use.
https://en.wikipedia.org/wiki/ISO_3166-2:AN
New country entries for:
Saint Barthélemy
Caribbean Netherlands
Curaçao
Collectivity of Saint Martin
Sint Maarten
---------
Changes due to new data *and* with differences between zone1970.tab
and zone.tab:
GERMANY
South Sudan (entirely new)
VIET NAM
FRENCH SOUTHERN TERRITORIES
---------
Changes to comments or arrangement of existing entries due to non-DST
offset changes since the last update:
Antarctica/Mawson
Europe/Minsk
America/Resolute
Atlantic/Stanley
Asia/Pyongyang
America/Cancun
America/Grand_Turk
Pacific/Fakaofo
Europe/Istanbul
America/Caracas
Pacific/Apia
Bug: 25338903
Test: Build / CtsUtilTestCases
Change-Id: I87e3db795f55ddd92e7402459c5e97aa70b9301e
* No new functionality was added, this was already possible via
-Djava.class.path=classpath
* However, this makes it a bit more compatible with other tools
that use -cp to invoke the main class.
* Also update the benchmarks README for correct up-to-date vogar
instructions.
Test: vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/ParcelBenchmark.java
Bug: 31807538
Change-Id: Idb04600fed3dd955437ccac832617dcfd1b52b63
In order to make the tests run a few methods must be made public so that
they can be called from a class loaded by a different class loader.
Fixed: 28217358
Change-Id: I98ce1e952a78528ae6ebd3a0e843c9ddfe937337
(cherry picked from commit 36afe5b5cc000620d77150437ba21503c44c87eb)
The previous patch (ef23bf19 Allow leading slash in path...) made
a single slash path unmatchable.
To solve it, this patch stops removing a slash character if the path
only has a slash character.
Now, a single slash is a matchable path for a URI without path string.
Bug: 29524484
Change-Id: I90b357aa48be1a3e0cf36e75ed2a9d6532908972
Declare MultiDexLegacyTestApp_corrupted with a fake secondary dex (size
0). This is to test correct correct handling of suppressed exception on
API 19 or 20.
Bug: 28808797
Change-Id: Ib700d7e2ecaaf026ada2c974f0410fd98d773926
Previously the DisplayMetrics passed to a new ResourcesImpl
object would be generated from the default DisplayAdjustments.
We now use the correct DisplayAdjustments for the ResourcesImpl
and make sure to update them for things like rotation changes.
Bug:29619314
Change-Id: If2ba0d7670a4554dcd3fde9766e2337f20a191fd
(cherry picked from commit 8e8d23214a71d8813ebd3676b192924c530cb913)
We allow each individual Resources object to select the best
Locale for the given APK. This allows one update to the configuration
instead of multiple updates, once the locale is chosen.
The Java locale is selected from the app context's locale.
Bug:28625993
Bug:27325465
Change-Id: I99e1e53f522e560f3b80bbd1e1c605f552dbdff0
We handled stale wakelocks (wakelocks that disappear from /d/wakeup_sources)
differently in previous version of Android. They would be set stale, but still be
updated with their previous counts (they would never disappear).
The method setStale has been replaced with endSample(), which is semantically different.
Once a SamplingTimer has endSample() called, it expects any future calls to update() to
be a new sample, meaning the entire amount passed to update() is included in the kernel
wakelock's total. Since stale wakelocks were never removed from the list, this would
increase by large amounts when nothing had actually changed.
This was exacerbated by the fact that there was a bug where the last wakelock in
/d/wakeup_sources was never parsed, so if the order ever changed, this "stale" wakelock
would suddenly re-appear and the entire amount reported would be charged to the wakelock,
instead of just the difference since the last update.
All this was exposed when we added support to handle wakelocks that would disappear and
reappear with smaller values, meaning the kernel had pruned them from its accounting and
reset them.
Bug:28601080
Change-Id: Ic96027f7d580dac5e20aa73d67e5cedac4ccabeb
Since LocaleList needs to depend on android.os.Parcelable, we cannot let
that class belong to "android.util" package, which causes layering
violation.
Bug: 28819696
Change-Id: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
Settings is using a MemoryIntArray to communicate the settings table
version enabling apps to have up-to-date local caches. However, ashmem
allows an arbitrary process with a handle to the fd (even in read only
mode) to unpin the memory which can then be garbage collected. Here we
make this mechanism fault tolerant against bad apps unpinning the ashmem
region. First, we no longer unpin the ashmem on the client side and if
the ashmem region is purged and cannot be pinned we recreate it and
hook up again with the local app caches. The change also adds a test
that clients can only read while owner can read/write.
bug:28764789
Change-Id: I1ef79b4b21e976124b268c9126a55d614157059b
NetworkPolicyManagerService (NMPS) keeps an internal list of uid
rules (mUidRules) for network restrictions, and when these rules
changes it needs to notify external listeners (such as
ConnectivityService / CS).
Prior to Android N, both Data Saver mode (the feature previously known
as "Restrict Baground Data") and Battery Save mode used the same set of
firewall rules to implement their restrictions: when Battery Saver mode
NPMS would mark all networks as metered and set the proper firewall
rules externally.
Recently, these 2 modes were split in 2 distinct firewall rules and
NMPS.updateRuleForRestrictBackgroundLocked() was changed to update
the mUidRules logic based on the Data Saver firewall (since the Battery
Saver firewall changes are handled externally, on
updateRuleForRestrictPowerLocked()). As such, CS was not notified when
the power-related changes were made, which would cause apps to get a
state of CONNECTED / CONNECTED when querying its active connection.
This change refactores the mUidRules to use bitmasks, in preparation for
another change that will fix the issue.
It also fixes a minor bug that was preventing removed packages to be
removed from the whitelist.
BUG: 28521946
Change-Id: I9f0e1509a6192cad403f740c1cd76a6b7dab7d26
am: f71d7fe
* commit 'f71d7feef22db9e0cab2f32edc7440aedb86fdfe':
Ensure local settings caches are not stale
Change-Id: I356b9ad0b6dc1e91bfad140de1b9fc79ab6efef3
We used the system proterties as a shared memory mechanism
to propagate information to local settings caches when the
content has changed and the cache should be cleared. The
system properties are unfortunately updated asynchronously
leading to cases where clients may read stale data.
This change adds a simple int array data structure backed
by shared memory which guarantees individual values are
atomically read and updated without memory tear. Multi-
index opearations are not synchronized between each other.
The settings provider is using the new data structure to
propagate the settings generation which drives when caches
are purged.
We have a single memory array keeping the generation for
different settings tables per user. Since memory array is
not a compact data structure and the user space exceeds
the memory array size we use an in-memory map from keys
to indices in the memory array where the generation id of
a key is stored. A key is derived by the setting type in
the 4 most significant bits and the user id in the 28 least
significant bits.
The mapping from a key to an index is cleared if the user is
removed and the corresponding index in the memory arry is
reset to make it available for other users. The size of the
memory array is derived from the max user count that can be
created at the same time.
bug:18826179
Change-Id: I64009cc5105309ef9aa83aba90b82afc8ad8c659
SamplingTimer has been losing some data, as well as not correctly handling
entries that have gone away and come back with less data (reset).
This change correctly ends a SamplingTimer sample by adding the accumulated amount
to the total, then reseting the running counter to accept new values.
This is also triggered automatically when the incoming data is less than what is currently
recorded.
Bug:25695597
Change-Id: I6b540906e6be527578d1003485384a75ba211b52
am: 752434a
* commit '752434a0ff54ac30b7701292b66361e64b2ae5a0':
Record in progress count when parceling Timer
Change-Id: Icc7e8312df00bd22f0e5433e15fc65d2ad705db4
am: 7ecd767
* commit '7ecd7671b75b2ae7c4d20928722b4a1d41bd62ff':
Delete emojis before and after ZWJ at the same time.
Change-Id: If877cde7549f0bd0e56c7cbd707e360c8df012fd
Vendor may want to introduce their own ZWJ emoji sequence. To delete
them by one back space as the same behavior of Unicode emoji sequence,
use all emoji as the zwj emoji.
Bug: 28248662
Change-Id: I572dad42ee108476962d4b3fe9f3a6019cb50098
While processing an unlock request, we might go async to handle
long-running operations like dispatching PRE_BOOT_COMPLETED. This
change ensures that all unlock requests for a particular user wait
in line behind any pending async operations.
Without this CL, any subsequent unlock requests would immediately
return successful, even though PRE_BOOT_COMPLETED events were still
being processed.
Bug: 28240584
Change-Id: I307d6aaebfb8f38028f3666a2e19e4399b7cf3a7
am: 5dc3c67
* commit '5dc3c674a2635179d17e96af8fb248142e03b87e':
Add some tests for procstats, and fix some bugs that the tests uncovered.
Change-Id: I53ee3334f58db4a0904370fc4f2f1b6b29365020