252465 Commits

Author SHA1 Message Date
Brad Ebinger
836efade0c Adds registerSessionListener API to Log
Adds the registerSessionListener API to android.telecom.Log to allow
callbacks to occur when a session has been fully completed.
CP from internal branch.

Test: Manual Testing
Bug: 26571395
Change-Id: I70ebd6f432768a5d7bd8f3a0997b8e0ef335bb35
2016-10-19 14:32:46 -07:00
Andreas Huber
2202b164d8 Merge "HIDL Vectors are now exposed to Java as ArrayList<T>, the supporting APIs on" 2016-10-19 19:30:29 +00:00
Treehugger Robot
239df3cc5a Merge "Use this.isUp() inside InterfaceConfiguration" 2016-10-19 19:15:31 +00:00
Jason Monk
03e4eb32fe Merge "Hide QS customizer correctly" 2016-10-19 15:05:41 +00:00
Brad Ebinger
42598f4a96 Merge "Add support for new SessionManager and EventManager tests" 2016-10-18 21:22:19 +00:00
Andreas Huber
ef1a565bd4 HIDL Vectors are now exposed to Java as ArrayList<T>, the supporting APIs on
HwParcel now reflect this change.

Bug: 32237331
Test: hidl_test_java
Change-Id: Ia1ce5a4e3acedd8ebcff15107aea53ce28fde589
2016-10-18 09:36:02 -07:00
Yoshinori Hirano
1dd7d07460 Hide QS customizer correctly
When users open and close QS customizer quickly, QSCustomizer#hide()
is not called because QSCustomizer#isCustomizing() returns false.
The isCustomizing() becomes true when the expand animation ends.
The hide() should be called even though the animation is ongoing.

Bug: 30545089
Test: manual - open and close QS customizer quickly

Change-Id: Ic483addfb6ae9da31c997fec7778e5acd718c353
2016-10-18 04:31:47 +00:00
Treehugger Robot
ff5c3ad08b Merge "Fix static analyzer warnings." 2016-10-18 01:30:55 +00:00
Treehugger Robot
9cff57312d Merge "Remove APIs that are not directly usable." 2016-10-17 21:16:22 +00:00
Treehugger Robot
78929f3ee0 Merge "missing includes" 2016-10-17 21:12:08 +00:00
Sanket Agarwal
fb6322425a Remove APIs that are not directly usable.
The right way to expose this API is done via MediaBrowser.

Bug: b/28791287
Change-Id: I0a8a185934fd7aaa9f2b5eac7398955fa380060f
(cherry picked from commit b5fbb75aa26a6322b26b1289cc5d14a8c31acb34)
2016-10-17 12:47:10 -07:00
Mark Salyzyn
4d6c372eae missing includes
Assumptions are made about header side effects

Test: compile
Bug: 30465923
Change-Id: Icc9415aed5e54b2bc00b70aa0da6df4148f30654
2016-10-17 12:32:54 -07:00
Christopher Wiley
87100cce39 Use this.isUp() inside InterfaceConfiguration
Bug: 31337216
Test: Compiles
Change-Id: I968a739f9ada47b1357932d2da76451eb26c3d5f
2016-10-17 10:32:40 -07:00
Treehugger Robot
9a904d68c7 Merge "Avoid automatically mirroring Drawable of CustomTile" 2016-10-17 16:42:18 +00:00
Treehugger Robot
c7ea99a63c Merge "Add InterfaceConfiguration.isUp()" 2016-10-17 16:30:44 +00:00
Treehugger Robot
143d13ce59 Merge "Update time_zones_by_country.xml / delete unused files" 2016-10-17 16:21:59 +00:00
Treehugger Robot
09dcaf1948 Merge "[ActivityManager] Fix the inconsistence between ProcessRecord and BroadcastQueues" 2016-10-17 15:59:17 +00:00
Neil Fuller
50e9b8620c Update time_zones_by_country.xml / delete unused files
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
2016-10-17 12:14:50 +00:00
Yoshinori Hirano
eb09362c72 Avoid automatically mirroring Drawable of CustomTile
Developers of custom tiles should decide whether
the Drawable of their own tiles should be automatically mirrored.
So State#autoMirrorDrawable should be false by default.

Bug: 30930145
Test: manual - change to RTL language and open Quick Settings

Change-Id: Ia3fd8c2aeddb4a27b9ecfaaf52edbcce01fd7f48
2016-10-17 20:04:16 +09:00
yangzhenyu
d509bc93e6 [ActivityManager] Fix the inconsistence between ProcessRecord and BroadcastQueues
Symptom:
Even though one process is executing one BroadcastReceiver,
it may be killed as one EMPTY process occasionally

Detail and sample:
https://code.google.com/p/android/issues/detail?id=221524

Root cause:
app.curReceiver can only remember the last running.
If an application is both receiving FG and BG broadcast,
when one is finished, app.curReceiver becomes null,
the state of application becomes EMPTY.

Solution:
save all running receivers at ProcessRecord

Change-Id: I01b8813af652a8c434be7de0678dc06f99831ae0
Signed-off-by: yangzhenyu <yangzhenyu@xiaomi.com>
2016-10-17 13:58:17 +08:00
Treehugger Robot
2fbf30d3fe Merge "Fix static-analyzer warning." 2016-10-14 02:21:10 +00:00
Treehugger Robot
3ef0315eb7 Merge "Fix Bluetooth OOB pairing not working for unseen devices" 2016-10-14 01:25:11 +00:00
George Burgess IV
56f5f7b79b Fix a static-analyzer warning.
frameworks/base/tools/aapt2/util/Files.cpp:81:21: warning: Null pointer
passed as an argument to a 'nonnull' parameter
     while ((entry = readdir(dir))) {

Bug: None.
Test: Warning no longer appears.
Change-Id: If242598405e995928378ce317a2e909654e1e985
2016-10-13 15:52:34 -07:00
George Burgess IV
0c2774b16a Fix static-analyzer warning.
frameworks/base/tools/aapt/Images.cpp:845:17: warning: Assigned value is
garbage or undefined
     row += bpp;

Bug: None.
Test: The warning is gone.
Change-Id: Idf4623d2510111a9188ed39922e109a8db225c76
2016-10-13 15:51:04 -07:00
George Burgess IV
e8efec56f0 Fix static analyzer warnings.
frameworks/base/libs/androidfw/ResourceTypes.cpp:742:46: warning: Result
of 'calloc' is converted to a pointer of type 'char16_t *', which is
incompatible with sizeof operand type 'char16_t **'
    mCache = (char16_t**)calloc(mHeader->stringCount,
        sizeof(char16_t**));

frameworks/base/libs/androidfw/ResourceTypes.cpp:4359:28: warning:
Potential leak of memory pointed to by 'set'
     return NO_MEMORY;

Bug: None
Test: Builds without the aforementioned warnings.
Change-Id: I1f84c1b9f4cba05f5cc7c3ae9fec1a07bc9cd8fe
2016-10-13 15:32:33 -07:00
Brad Ebinger
096d2829ed Add support for new SessionManager and EventManager tests
Test: Ran new unit tests
Bug: 26571395
Change-Id: I6d14d7c05b8fdc8dc1319a81f0e41f7bcd989b85
2016-10-13 15:26:58 -07:00
Svetoslav Ganov
c98b34bdce Merge "Allow SetupWizard to do WiFi scans if location off" 2016-10-13 20:06:38 +00:00
Treehugger Robot
6057a8360a Merge "Fix memory leak of Dnd tile" 2016-10-13 13:00:45 +00:00
Selim Cinek
6f3a05ae77 Merge "DO NOT MERGE - Fixed an issue where the emergency affordance would show" 2016-10-13 00:48:24 +00:00
Treehugger Robot
d33e79c328 Merge "DO NOT MERGE - Added translations for emergency action string" 2016-10-13 00:45:20 +00:00
Selim Cinek
42a4338850 DO NOT MERGE - Added translations for emergency action string
Bug: 30404490
Change-Id: Ic20d93005882bb71cef32a705443e427b0a9bd71
2016-10-12 23:23:52 +00:00
Selim Cinek
4df8d64dab DO NOT MERGE - Fixed an issue where the emergency affordance would show
If a device isn't voice capable, it shouldn't show the emergency
option.

Test: use tablet which isn't voice capable, insert indian sim and
make sure no emergency option is displayed in global actions.
Bug: 31953703
Change-Id: I351e87320f3ffec76d1c1fc5aac78e5c48c0ac54
2016-10-12 23:20:30 +00:00
Robert Greenwalt
73c50f7dbc Merge "Add free short codes for direct carrier billing and others" 2016-10-12 22:05:32 +00:00
Treehugger Robot
aae64557e1 Merge "Don't compare FQDN with providerFriendlyName" 2016-10-12 15:44:35 +00:00
Adam Lesinski
78382db820 Merge "RRO: Synchronize access to overlays.list" 2016-10-12 14:52:49 +00:00
Jorim Jaggi
6738617652 Merge "Fix split-screen flash issue" 2016-10-12 13:24:46 +00:00
Yuta Yamada
99fd277a47 Fix memory leak of Dnd tile
The instance of Dnd tile leaks when user taps the edit button
of Quick Settings. To fix this issue, QSTile#destroy should be
called when the tile is no longer needed.

Bug: 32103239
Test: manual - go to Quick Settings -> Edit repeatedly

Change-Id: I9bc9ee836be5c8e46eb1ccd202bd5cc50070ef47
2016-10-12 08:45:11 +00:00
Martin Wallgren
f12af5e907 RRO: Synchronize access to overlays.list
idmap --scan is executed as a part of the pre-loading in ZygoteInit.
The pre loading is executed in parallel for each supported architecture
(32/64 bit). This will cause a race condition in the creation of the
overlays.list file and the idmap files for the system overlays.

Apply flock on overlays.list to prevent the file from being thrown away
and recreated when it is in use by another Zygote.

Bug: 28032298

Change-Id: I51d39f121d207b11181340b68b164b60020f0c61
2016-10-12 15:42:04 +09:00
Treehugger Robot
e011bf80c5 Merge "Tethering: check if configManager is null" 2016-10-12 03:48:03 +00:00
Svetoslav Ganov
c573661f4c Allow SetupWizard to do WiFi scans if location off
Location permission is needed for apps to do WiFi scans
and if location is globally off no app can scan too. It
is possible that an OEM does not want location to be on
until the user agrees to that or a device owner can turn
location off before setup. As a result setup wizard
cannot show the WiFi networks preventing the user form
logging in. This change allows the setup wizard component
to perform WiFi scans even if location is globally off.

bug:29577364

Change-Id: I6b7c5dca76b8c8ee6051ea2dad3cec6879683524
2016-10-12 02:58:26 +00:00
Christopher Wiley
08395dce6a Add InterfaceConfiguration.isUp()
Bug: 31337216
Test: None
Change-Id: Ifd83b069472fc50c9517fc69306e7938a9e9628c
2016-10-11 16:47:44 -07:00
Rebecca Silberstein
87e8014117 Tethering: check if configManager is null
cherry-picked from b07f1409045091476e5296f9b0dd41c8712fe49a

Before attempting to retrieve a carrier entitlement setting, first make
sure we have a carrier config manager and if we do have a carrier config
manager, the config it holds is not null.

Bug: 31929638
Test: unittests coming in follow on CL
Change-Id: Iee476c476cb3de109cdccbd955b7fb986dd4267b
2016-10-11 16:46:55 -07:00
Brad Ebinger
4fb372fe16 Switch on android.telecom.Log in Telecom
Move over the Runnable Class into android.telecom and turn on the
framework's usage in Telecom.

Test: All Telecom unit tests pass. Manual Log testing has also been
confirmed to be working as it did before.
Bug: 26571395
Change-Id: If7e2036c746c5a953f3a77e2d625a423ce5bf8f3
2016-10-11 16:26:11 -07:00
Brad Ebinger
cbb03d1ad3 Merge "Transplant the Logging system from Telecom" 2016-10-11 22:24:15 +00:00
Matthew Campbell
ad378ef923 Add free short codes for direct carrier billing and others
Whitelist free short code batch 2016 Q1 - Android Partner Engineering.
Short codes for Bahrain, Vietname and Slovakia are for Direct carrier
billing, USA and Brazil short codes are used by Google Allo and Italy
short code change is due to government regulation.

Test: manual - uploaded modified file onto test device and tested
sending sms to changed shortcodes to verify behaviour.

Bug: 30212667

Change-Id: If4fe0605d4ad5aafad9ce9b9670526d40ad88f45
Signed-off-by: Matthew Campbell <matthewca@google.com>
2016-10-11 14:01:40 +01:00
Jakub Pawlowski
3eb490f903 Fix Bluetooth OOB pairing not working for unseen devices
When Out Of Band info is provided, first time we learn about
device is when it's state is changed to "Bonding". This currently cause
this event to be discarded and pairing fails. Instead, we should add
CachedDevice object for newly added device.

Bug: 30188629
Change-Id: I4046bfe30e8bf32b888f608ac06d5041e2999dc9
2016-10-10 22:37:36 +00:00
Christopher Wiley
6408e2e5cc Merge "IndexOutOfBoundsException observed in ProcessStats" 2016-10-10 22:31:33 +00:00
Treehugger Robot
2dc11c0500 Merge "Fix SurfaceViewPositionListener race bugs" 2016-10-10 21:48:52 +00:00
Andre Eisenbach
5c043f51b0 Merge "List HF_INDICATORS_VALUE_CHANGED broadcast as protected" 2016-10-10 21:25:07 +00:00
Jack He
b798f79ba2 List HF_INDICATORS_VALUE_CHANGED broadcast as protected
android.bluetooth.headset.action.HF_INDICATORS_VALUE_CHANGED
notification should be protected.

Bug: 32059227
Test: manual
Change-Id: I06d4a7e3aa3a5586eb09d2538b4b526a5d073f9a
2016-10-10 21:24:55 +00:00