Commit Graph

424916 Commits

Author SHA1 Message Date
Tobias Thierer
a8bfed9104 Merge "Make CTS more opinionated about the platform's default MimeMap." 2019-10-02 15:36:27 +00:00
James Lin
74ad1b81ab Merge "[RCS] Add carrier config "use_rcs_sip_options_bool" for check if SIP OPTIONS is supported" 2019-10-02 15:26:22 +00:00
Chalard Jean
4b4f463d3c Merge "Decrease load-related flakiness in ConnectivityServiceTest" 2019-10-02 02:38:30 +00:00
Mathieu Chartier
5a883e16e8 Merge "Add a test that we get samples for a common core-oj method" 2019-10-01 23:09:07 +00:00
Jordan Liu
e3dfe362dc Merge "Expose CdmaSmsCbProgramData as SystemApi" 2019-10-01 20:33:29 +00:00
Mathieu Chartier
bafd39c1cb Add a test that we get samples for a common core-oj method
Test: atest frameworks/base/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java
Bug: 139883463
Change-Id: I11d0d98731756da5b9739b18acb5ab140657ca34
2019-10-01 19:53:19 +00:00
James.cf Lin
9f5e1f7509 [RCS] Add carrier config "use_rcs_sip_options_bool" for check if SIP OPTIONS is supported
Bug: 139260798
Test: Manual
Change-Id: I93df866fe020d03130458175a8823368069c47e6
Merged-In: I875e597fa3cb5d7f5a93989d2ff8e4abbbd9d045
2019-10-02 03:25:39 +08:00
Jordan Liu
4ae91c0308 Expose CdmaSmsCbProgramData as SystemApi
Only getOperation and getCategory are currently used, so we only expose
those parts of the functionality. Eventually if we move BearerData to
the CBR app we will also have to expose the constructor, at which point
we may also want to expose the other constants that the constructor
uses, but for now this is okay.

Bug: 135956699
Test: manual
Change-Id: I1d3ba564372845f9b8a470adf82e84df745c02a7
Merged-In: I1d3ba564372845f9b8a470adf82e84df745c02a7
2019-10-01 10:42:56 -07:00
Brad Ebinger
25f4dca660 Merge "Add Telecom command for setting connectionservice filter" 2019-10-01 17:30:40 +00:00
Treehugger Robot
0517cd144f Merge "Improve comparison of fractions" 2019-10-01 17:30:17 +00:00
Nathan Harold
c75cf96f72 Merge "Add Debounce text to ACTION_NETWORK_COUNTRY_CHANGE" 2019-10-01 17:29:29 +00:00
Tobias Thierer
adeea59b4d Make CTS more opinionated about the platform's default MimeMap.
Historically, the mapping implemented by MimeMap (formerly MimeUtils)
was largely untested and therefore differed between Android devices.

This CL topic makes CtsMimeMapTestCases a lot more opinionated by
checking that:

 - MimeMap.getDefault() must respect all of the mappings supplied
   in stock Android. This is enforced via CTS bundling a copy of:
   - the {,android.,vendor.}mime.types data files
   - DefaultMimeMapFactory (rewritten via jarjar to
     android.content.type.cts.StockAndroidMimeMapFactory)
   MimeMap.getDefault() is allowed to implement _additional_
   mappings, but changed or removed mappings are not allowed.
 - Public APIs android.webkit.MimeTypeMap and
   URLConnection.getFileNameMap() must behave consistently with
   MimeMap.getDefault() (in stock Android, those APIs are
   implemented directly on top of MimeMap.getDefault()).

Test: atest CtsMimeMapTestCases
Test: atest CtsLibcoreTestCases:libcore.libcore.net.MimeMapTest
Test: The above atest runs pass on a device that contains an
      additional mapping in vendor.mime.types that is not
      present in CTS.
Test: Checked that on a device that changes a mapping in
      android.mime.types, CtsLibcoreTestCases still passes
      but CtsMimeMapTestCases fails.

Bug: 141842930
Bug: 139895945

Change-Id: I68e0e9c3ce53c1acf2a89f8b80519f4658c07217
2019-10-01 16:26:16 +01:00
Chun-Wei Wang
e899023544 Merge "Show file path when listing APEXes (1/n)" 2019-10-01 11:10:49 +00:00
Jeffrey Vander Stoep
152ced4b87 Merge "InetDiagSocketTest: ignore test that times out" 2019-10-01 10:44:24 +00:00
Chalard Jean
d1c510f749 Merge "Rename some Vpn fields." 2019-10-01 09:08:07 +00:00
Jeff Vander Stoep
69b83c9b3c InetDiagSocketTest: ignore test that times out
Test: atest InetDiagSocketTest
Change-Id: Ieef0ca291924c0d81b1110bd25020d57fa9f0fec
Bug: 141870193
2019-10-01 08:21:41 +00:00
Treehugger Robot
2efe92bdbe Merge changes Iaf918ce3,I60032b97
* changes:
  Introduce vendor.mime.types
  android.mime.types: Fix typo.
2019-10-01 07:02:16 +00:00
Chalard Jean
15da7c17b5 Merge "Opportunistic cleanup" 2019-10-01 05:25:57 +00:00
Hall Liu
e93165456c Merge "Add carrier config for ignoring user RTT setting" 2019-10-01 01:37:05 +00:00
JW Wang
9a72263bce Show file path when listing APEXes (1/n)
-f now works for APEXes as well.

Bug: 140813980
Test: adb shell pm list packages --apex-only -f
package:/system/apex/com.android.apex.cts.shim.apex=com.android.apex.cts.shim
package:/system/apex/com.android.art.debug.apex=com.android.art
package:/system/apex/com.android.conscrypt.apex=com.google.android.conscrypt

Change-Id: I6206c4db392a37152f14aa5510c35e52f565f9a6
2019-10-01 09:05:33 +08:00
Brad Ebinger
a9a33e1d68 Add Telecom command for setting connectionservice filter
For testing we need the emergency call to go through the CTS
ConnectionService. This is achieved by passing in a package
name filter for testing, which restricts which ConnectionServices
are available for emergency calling.

For safety this filter will be bypassed if the user calls an
actual emergency number (instead of a test number).

Bug: 138741228
Test: atest CtsTelecomTestCases
Change-Id: I656533e4a36a7bba48625bf6f763731991695aed
2019-09-30 17:46:36 -07:00
Brad Ebinger
4a54c2fa2b Merge "Integrate the active emergency session listener in TelephonyRegistry" 2019-09-30 22:48:25 +00:00
Nathan Harold
af66dea4de Add Debounce text to ACTION_NETWORK_COUNTRY_CHANGE
Explain that once a country signal is lost, the broadcast
will be delayed for some time until we are confident that
we have lost visibility to any country (unless we detect
a new country).

Bug: 136036974
Test: make offline-sdk-docs (docstring-only change)
Merged-In: I29536ca2d60968405bb476a97dfbda69487c0013
Change-Id: I29536ca2d60968405bb476a97dfbda69487c0013
(cherry picked from commit 3bdc7e4c62)
2019-09-30 14:43:44 -07:00
Shuo Qian
b61230c51d Integrate the active emergency session listener in TelephonyRegistry
Add Telecom shell command: "adb shell telecom set-system-dialer"

Test: PhoneStateListener cts
Bug: 135204580
Merged-In: I5eaada6a671606642a849f0ff6fe964332d80d5f
Change-Id: I5eaada6a671606642a849f0ff6fe964332d80d5f
2019-09-30 20:43:42 +00:00
Ryan Mitchell
5491eb92fc Merge "Fix memory leak in aapt2" 2019-09-30 18:10:53 +00:00
Jeffrey Vander Stoep
20bdc26698 Merge "Fix FD leak in ConnectivityManager.getConnectionOwnerUid" 2019-09-30 17:41:30 +00:00
Tobias Thierer
324349142c Introduce vendor.mime.types
Like mime.types and android.mime.types, this file specifies mappings
between MIME types and file extensions. Unlike those files, it can
only be used to define _additional_ mapping but not modify (change,
remove) any mappings defined by those files.

This is done by prepending '?' to every line element from
vendor.mime.types that doesn't already have one; when there is a
leading "?", it is ignored so that it's okay to move a line from
{android,vendor}.mime.types without necessarily changing it.

Test: Checked manually that vendor.mime.types works as expected.
  Specifically, after adding these lines to vendor.mime.type:

    audio/mpeg testmpeg
    audio/testmpeg mp3
    ?mime/foo ?fooext

  the following test passes:

    MimeTypeMap map = MimeTypeMap.getSingleton();
    // Original mapping is unchanged
    assertEquals("mp3", map.getExtensionFromMimeType("audio/mpeg"));
    assertEquals("audio/mpeg", map.getMimeTypeFromExtension("mp3"));

    // Map from the key to existing value is added
    assertEquals("audio/mpeg", map.getMimeTypeFromExtension("testmpeg"));
    assertEquals("mp3", map.getExtensionFromMimeType("audio/testmpeg"));

    // Completely new mapping is added both ways
    assertEquals("mime/foo", map.getMimeTypeFromExtension("fooext"));
    assertEquals("fooext", map.getExtensionFromMimeType("mime/foo"));

Bug: 141842825
Change-Id: Iaf918ce39324709ff58a8e0f9612e4827a673323
2019-09-30 17:10:53 +01:00
Stan Iliev
f2539c3bac Improve comparison of fractions
Fraction comparison does not work for 143.999985 and 2.000001.
This CL resolves this corner case.

Bug: 140778647
Test: pass CTS
Change-Id: I7e39ba822167a3c36c628255a4c79b1ade976929
(cherry picked from commit 019adb0293)
2019-09-30 10:32:04 -04:00
Tobias Thierer
e25c54f328 android.mime.types: Fix typo.
Test: Treehugger
Change-Id: I60032b97251146006c2dc95b4be19c3d2d70697f
2019-09-30 14:16:51 +01:00
Jeff Vander Stoep
59940afb16 Fix FD leak in ConnectivityManager.getConnectionOwnerUid
Add unit tests to verify that bug has been fixed.

Re-enable testGetConnectionOwnerUid() unit tests in presubmit. These
were disabled due to test flakiness caused by expected failures passing
as a result of other sockets on the system. This is fixed by checking
that failures do not have the UID of the calling process instead of
INVALID_UID since previously some Qualcomm telephony sockets were
causing lookup successes.

Test: atest InetDiagSocketTest#testGetConnectionOwnerUid
Test: ls -1 /proc/<pid of system_server>/fd | wca
Test: atest --generate-new-metrics 200 InetDiagSocketTest#testGetConnectionOwnerUid
   To verify flakes have been cleaned up.
Bug: 141603906
Bug: 141459241
Change-Id: Ib76674f10e4bd24952c557bac7b9c65fba42fdb2
2019-09-30 12:46:03 +02:00
Chalard Jean
afdecd51ca Opportunistic cleanup
Test: FrameworksNetTests NetworkStackTests
Change-Id: I370ad15fb0d8301f9720caf5296365c04aebeb62
2019-09-30 19:12:25 +09:00
Tobias Thierer
6ed8fce33f Merge changes from topics "bug136256059_attempt2", "bug136256059_builder"
* changes:
  MimeMapImpl.createDefaultInstance() -> DefaultMimeMapFactory.create().
  Make MimeMap final and introduce MimeMap.Builder.
  Move default MimeMap implementation to frameworks.
2019-09-30 09:15:53 +00:00
Treehugger Robot
417aed2c61 Merge changes from topics "dsu_ashmem", "dsu_clean_up"
* changes:
  Use Ashmem to reduce buffer copies
  Clean up usage on deprecated GSID methods
2019-09-28 11:45:28 +00:00
jungshik
b44f88b3c9 Merge "Use NotoSansMyanmar (pure Unicode) fonts" 2019-09-28 02:40:04 +00:00
Treehugger Robot
62031438a7 Merge "Add /system_ext sepolicy support to SELinuxMMAC.java" 2019-09-28 00:28:57 +00:00
Treehugger Robot
fc733e1d5e Merge changes from topic "textureview_readback"
* changes:
  Improve integer aligned coordinate detection
  Improve logic when to use filtering in readback and TextureView
2019-09-27 17:36:31 +00:00
Tobias Thierer
af0cef987d MimeMapImpl.createDefaultInstance() -> DefaultMimeMapFactory.create().
The class no longer implements MimeMap, so the name MimeMapImpl
no longer made sense.

Test: Treehugger
Bug: 136256059
Change-Id: I2cbc70a7769232b704a9bdfde2def832c1e292b8
2019-09-27 17:25:13 +01:00
Tobias Thierer
fd9657d032 Make MimeMap final and introduce MimeMap.Builder.
This CL topic introduces a new @CorePlatformApi MimeMap.Builder
and uses it to make MimeMap a concrete, final, immutable type.

This has the following advantages:

 - Consistency of behavior of MimeMap implementations with regards
   to lower-casing and treatment of null is trivial to guarantee
   because there is only one implementation.
 - The @CorePlatformApi surface now makes more sense. The responsibility
   for lower-casing and treatment of null was previously split between
   MimeMap in libcore and  MimeMapImpl in frameworks/base, which is why
   MimeMap.toLowerCase() and MimeMap.isNullOrEmpty() were in the
   @CorePlatformApi.
 - Most of the logic now lives in libcore / ART module.
   frameworks/base now has minimal logic. This makes it easier to write
   (in a follow-up CL) a CTS test that asserts all the default mappings,
   because that test can now duplicate that small amount of logic in
   order to read from a copy of the same data files.

Note: The semantics of the @CorePlatformApi Builder.put(String, List<String>)
are fairly complex, which isn't great. This was done because:
 - By following the semantics of the *mime.types file format, it allows
   us to minimize the logic in frameworks/base.
 - It's simpler than having multiple overloads of put() for
   mimeType -> file extension mapping and vice versa,
   and for whether or not any existing mapping should be overwritten.
   If we had named classes for MimeType and FileExtension with
   appropriate case-insensitive equals and hashCode semantics, then
   we could instead have API such as
      builder.asMimeToExtensionMap().put(...)
   but existing API (e.g. Intent.getType(), android.webkit.MimeTypeMap)
   has set precedent for treating these as Strings.

Bug: 136256059
Test: atest CtsLibcoreTestCases
Test: atest CtsMimeMapTestCases

Change-Id: I9a185a689745726dd79b15117892001461fa4a0d
2019-09-27 17:02:31 +01:00
Tobias Thierer
878c77b704 Move default MimeMap implementation to frameworks.
This is the second attempt to submit this CL. The first attempt
regressed on app startup because RuntimeInit installed the
custom MimeMap from commonInit() which runs post-fork of the zygote,
but that was fixed by installing it pre-fork.

This CL topic moves the default MimeMap implementation to frameworks.
Libcore starts with a minimal implementation sufficient to pass
CtsLibcoreTestCases,  but frameworks can inject the real implementation.
Before this CL topic, the data files and logic (MimeMapImpl) were part of
core-*.jar on device; after this CL, they instead live in framework.jar.

Tests from MimeMapTest that check behavior of that default
implementation also move to a non-libcore CTS test.

Planned work for follow-up CL:
 1. Make CTS more opinionated, with a plan to assert that all of
    the default mappings are present. How exactly the expectated
    mapping will be bundled in CTS is still TBD.
 2. Add a vendor.mime.types file (defaults to empty) where vendors
    can add additional mappings; I plan to make it such that mappings
    in that file are parsed last but never override any earlier
    mappings, as if each mime type / file extension was prefixed
    with '?'.
 3. Perhaps enforce that public APIs android.webkit.MimeTypeMap
    and java.net.URLConnection.getFileNameMap() behave consistently
    with MimeMap.getDefault().

Test: atest CtsLibcoreTestCases
Test: atest CtsMimeMapTestCases
Test: Checked that CtsLibcoreTestCases still passes on a build that
      is missing the MimeMap.setDefault() call from RuntimeInit.java.
Test: Checked that app startup time does not regress as part of this
      CL topic - see http://b/136256059#comment17
Bug: 136256059

Change-Id: I716914bf1a7e6205e539f0551f010615dacb17a8
2019-09-27 16:53:15 +01:00
Treehugger Robot
f2a739d5f0 Merge changes from topic "flicker-rotation"
* changes:
  New FlickerTests: Run split screen tests at 0 and 90 degrees
  New FlickerTests: Start app warm and cold at both 0 and 90 degrees
  New FlickerTests: Start IME alongside the app (0 and 90 degrees)
  New FlickerTests: Start IME tests with app rotated by 90 degrees
2019-09-27 14:21:58 +00:00
Anna Trostanetski
e8e6390829 Merge "Rate limit non statsd logs." 2019-09-27 13:13:04 +00:00
Chalard Jean
b299b8418f Decrease load-related flakiness in ConnectivityServiceTest
Almost always this timeout is not waited anyway.

Test: ConnectivityServiceTest
Change-Id: I74376633d0ec8d93fb48609a4df73cad5fc5d508
2019-09-27 21:44:54 +09:00
atrost
a8f3c48495 Rate limit non statsd logs.
Limit 1 log per app launch as the statd logs as this is spamming logs.
Consider increasing in the future to once every x minutes/seconds if
needed.

Bug: 138374585
Bug: 141714588
Test: flash device
Change-Id: I3ed696fb557527d807d03aecc64c0207d7b93f08
2019-09-27 11:25:06 +00:00
Chalard Jean
85dc33f512 Rename some Vpn fields.
This member has an extremely confusing name, and the logic
handling it being convoluted does not help. This change renames
the member and add comments.

Bug: 112341346
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: Icfb6098d1c9e6293078ea7eede3f24a2fabe9d6b
2019-09-27 20:24:34 +09:00
Treehugger Robot
0e45bfabfe Merge "Properly test TrafficController permissions on package updates." 2019-09-27 05:35:25 +00:00
Treehugger Robot
5b78c2324b Merge "CallScreeningService API changed." 2019-09-26 23:32:26 +00:00
Treehugger Robot
a828ee6442 Merge changes from topic "system_ext"
* changes:
  Consider overlay in system_ext as system's
  Support /system_ext partition
2019-09-26 22:18:07 +00:00
Grace Jia
2d21e95e61 CallScreeningService API changed.
Test: manual
Merged-In: Idf44886158dcebf96e8bdffd98be3621f496deaa
Change-Id: Idf44886158dcebf96e8bdffd98be3621f496deaa
2019-09-26 14:37:19 -07:00
Tobias Thierer
52efd46075 Merge "Introduce ZygoteInit.preForkInit()." 2019-09-26 18:38:39 +00:00
Treehugger Robot
1f38a14659 Merge "zygote: remove ashmem initialization" 2019-09-26 17:56:53 +00:00