344949 Commits

Author SHA1 Message Date
Hall Liu
378f1f4972 Add CallAudioState ctor as TestApi
Needed for CTS testing

Bug: 79528185
Test: CTS
Change-Id: Iad154257a93cc776d5800527e46e777fd6c88220
Merged-In: Iad154257a93cc776d5800527e46e777fd6c88220
2018-05-25 15:22:16 -07:00
Bryan Henry
f98f8a4c6c Merge "Allow changing signing cert for system apps that use shared users" 2018-05-25 20:21:23 +00:00
Treehugger Robot
4517eacd5d Merge "Fix: ConnectivityManager is initialized with a wrong context" 2018-05-25 16:42:59 +00:00
Tetsutoki Shiozawa
f9f15fce9d Fix: ConnectivityManager is initialized with a wrong context
ActivityThread#setHttpProxy uses a system context to get
a ConnectivityManager instance. If it's not already cached, the
system service registry will cache this instance initialized
with the system context, and subsequent calls to get this service
will return the bad instance.
This patch uses the application context instead, unless it's
not available for some unlikely reason.

A possible symptom of this issue is to have Bluetooth tethering
failing with a security exception, because it's requested by
the "android" package without system uid.

Merged-In: Ib8815f010883cdb94fcad2cdfb237de39327b20a
Bug: 73572062
Change-Id: Id652c1625194dc73dcbf8dfcad4b4e2e6fbebf4e
2018-05-25 15:04:59 +00:00
Treehugger Robot
79b473ed7b Merge changes from topic "location_provider"
* changes:
  Remove FlpHardwareProvider
  Create the stubs lib for com.android.location.provider
2018-05-25 10:04:43 +00:00
eddy-sh.chen
50016ca463 Do not call finishKeyguardDrawn with PWM's mlock
Otherwise it may cause a deadlock between
PWM's mlock and WMS's mWindowMap.
Just post the work to the policy handler instead.

Bug: 80279029
Change-Id: Idae333687cf5c88e1893ee216c278b9e6c17dd98
2018-05-25 08:58:11 +00:00
Treehugger Robot
1fb2ed3de3 Merge "Add permission check to setAllowOnlyVpnForUids" 2018-05-25 08:26:34 +00:00
Jiyong Park
fa15a99fe9 Remove FlpHardwareProvider
After Treble's FLP merge into GNSS HAL, the FlpHardwareProvider is just
an empty shell. Removing FusedLocation and/or Flp + Hardware classes
altogether.

Bug: 35726697
Test: m -j
Test: Open Google Map and then walk around. The dot moves as I walk.

Merged-In: I7f413e38b57424e8ebb9d7d14d94f145a48d10f8
Change-Id: I7f413e38b57424e8ebb9d7d14d94f145a48d10f8
(cherry picked from commit 4cc3a1c056f69ac4da1dc5055c36b7357e9f673c)
2018-05-25 16:38:52 +09:00
Jiyong Park
409e5d25a9 Create the stubs lib for com.android.location.provider
com.android.location.provider.stubs is the stubs library for the shared
library com.android.location.provider. The stubs library is intended to
provide the stable set of APIs to the apps implementing location
provider.

Without the stubs library, apps had to directly link to the shared
library which is built without Android SDK and exposes private APIs that
are not intended to be used by apps. This also has been causing the
lin-type check warnings when the shared lib is used by apps built with
SDK; apps built with SDK is not allowed to link to lib built without
SDK. This has been reported as warnings but will soon be errors. Now
such apps are required to link to the stubs lib, which is built with
SDK.

While building the stubs library, following APIs are made hidden because
they are exposing private APIs from the Android platform.

1) Activity* classes are removed from the API, as they are not intended
to be used by apps since O.
2) GeocodeProvider and GeofenceProvider are removed from the API.
3) LocationProvider.mLocationManager is removed as it is exposing the
private symbol ILocationProvider
4) ProviderPropertiesUnbundle.getProviderProperties are removed from the
API as it is exposing the private symbol ProviderProperties.
5) The constructor of ProviderRequestUnbundled is removed since the
class is intended to be instantiated by the service.

Bug: 71420593
Test: m -j com.android.location.provider.stubs

Merged-In: I20aba7e9ca9c3adc75db241f37a55f0d657f3ced
Change-Id: I20aba7e9ca9c3adc75db241f37a55f0d657f3ced
(cherry picked from commit eee99986c8021d6825f99a25434725fccf7b2b12)
2018-05-25 16:30:22 +09:00
Remi NGUYEN VAN
b19a838f47 Merge "Use AI_ADDRCONFIG for most DNS requests" 2018-05-25 03:28:05 +00:00
Remi NGUYEN VAN
96dbac0c5c Merge "Migrating remaining core networking tests to Junit4" 2018-05-25 03:27:39 +00:00
zengjing
452da339bd Do not setForceUse when a2dp config without change
When device connected with wired headset and without any bluetooth
connection, APP may call MediaRouter to setForceUse to set FOR_MEDIA
with FORCE_SPEAKER, then sound be output to SPEAKER. In this case,
if setBluetoothA2dpOn(false) was called, FOR_MEDIA will be set with
FORCE_NONE and sound be output to wird headset.

The issue discussed above occurred on our device. We developed an FM radio APP.
Beforce work, wired headset must be plugged in to be used as antennas. Then we
setForceUse FOR_MEDIA to FORCE_SPEAKER, and audio stream was output to speaker.
At this moment, if we play other sound (such as ScreenCapture sound),
MediaRouterService will detected audio playbacked state changed. Because FM Audio
was not monitor by AudioPlaybackMonitor, there was not any audio playback active.
So, restoreBluetoothA2dp was called in the function of onAudioPlayerActiveStateChanged,
which call AudioService.setBluetoothA2dpOn(false). As a result sound was switch to headset.

There are two solutions to fix our issue.
1) Check a2dp state before setBluetoothA2dpOn in MediaRouterService::restoreBluetoothA2dp,
   if a2dp state does not change, setBluetoothA2dpOn should not be called
2) Check a2dp state before setForceUse in AudioService::setBluetoothA2dpOn,
   if a2dp state does not change, setForceUse should not be called
Consdering that setBluetoothA2dpOn may be called by other method, we try to fix it
with the second one.

Test: NA

Change-Id: I3a2e64e7d73d9aa9539176fea556feb433cb7211
Signed-off-by: zengjing <zengjing@xiaomi.com>
2018-05-25 11:15:20 +08:00
Treehugger Robot
d01890df3c Merge "Work around b/24465209, do not pack relocation table." 2018-05-24 19:13:19 +00:00
Treehugger Robot
1109e2333f Merge "Framework: Add API to get zygote PID" 2018-05-24 18:28:59 +00:00
Tyler Gunn
f2e08b4c2c Ensure self-managed calls use voip audio mode.
Although Telecom ensures that new calls use voip audio mode, the default
value from a Connection would override the Telecom default.

Bug: 76362663
Test: Modify test app to ensure it does not set voip audio mode, ensure
Telecom uses voip audio mode for new calls.

Change-Id: Ie6477659cf6dabd08f371d4958ece1d258cd3106
2018-05-24 10:44:44 -07:00
Treehugger Robot
daff857ffd Merge "Use correct filename when adding to ringtone" 2018-05-24 16:55:49 +00:00
Chih-Hung Hsieh
eeb1ea86ce Work around b/24465209, do not pack relocation table.
Global flag --pack-dyn-relocs=android is used with clang lld.
For b/24465209, we need to override that with pack_relocations:false.

Bug: 24465209
Bug: 80093890
Test: build with USE_CLANG_LLD=true and run dlext.compat_elf_hash_and_relocation_tables
Change-Id: I9364feb4070d4f75705d8651d535c792fe6ad6f7
2018-05-24 09:31:50 -07:00
Treehugger Robot
e7372ab0d5 Merge changes Id81271ff,I8f298371
* changes:
  DO NOT MERGE ANYWHERE Update hiddenapi-p-light-greylist.txt
  DO NOT MERGE ANYWHERE Sort hiddenapi-p-light-greylist.txt
2018-05-24 10:14:08 +00:00
David Brazdil
85c81cb24c DO NOT MERGE ANYWHERE Update hiddenapi-p-light-greylist.txt
Test: N/A
Change-Id: Id81271ffe2080091d4e4c3d40325183b086dba8e
2018-05-24 08:39:02 +00:00
David Brazdil
1c04a887fb DO NOT MERGE ANYWHERE Sort hiddenapi-p-light-greylist.txt
Test: N/A
Change-Id: I8f298371df3efbc3d968c95337e058d6140fe5de
2018-05-24 08:26:02 +00:00
Remi NGUYEN VAN
7b0935509d Merge changes I3b3bcbbd,I18b3f263,I3c416c1a
* changes:
  Use CaptivePortalProbeSpec method in portal app
  Add configurable captive portal probes
  Move CaptivePortalProbeResult to its own file
2018-05-24 07:53:00 +00:00
Hugo Benichi
fe530062ff Migrating remaining core networking tests to Junit4
Bug: 62918393
Test: runtest frameworks-net
Merged-In: I30f7eaa0307b8fad5a8de7a0da235a4f76c18677
(clean cherry-pick of I30f7eaa0307b8fad5a8de7a0da235a4f76c18677)

Change-Id: I272fea0bb4a9e7f6252bb3bd14a6b769a082039e
2018-05-24 16:24:47 +09:00
Sundong Ahn
d138adfdf6 com.android.media.tv.remoteprovider is built with java_sdk_library
The com.android.media.tv.remoteprovider is built with java_sdk_library
and api files are added by running "make update-api".
The com.android.media.tv.remoteprovider is removed in platform.xml
since it will be made auto generation by soong when the library is
built with java_sdk_library.

Bug:77577799
Test: make -j
      make checkapi

Change-Id: If0f33bbdde42d891471cd7d3d295d433a88affec
2018-05-24 16:17:03 +09:00
Treehugger Robot
a7183b92c4 Merge "Fixup SntpClient to bypass Private DNS" 2018-05-24 07:07:15 +00:00
Erik Kline
9e3c25de55 Fixup SntpClient to bypass Private DNS
NTP may be necessary in order to validate Private DNS certificates,
so it should be allowed to bypass Private DNS.

Test: as follows
    - built, flashed, booted
    - tcpdump for port 53; adb shell am restart
      queries for the NTP hostname appear in the clear
    - runtest frameworks-net passes
Bug: 64133961
Bug: 80118648
Merged-In: I4655e3ce5691098c73bf070b8a9e4759485bb17a
Merged-In: I327b816a9f472e94328232157a3b8887d17b0baf
Change-Id: Id9ceb3fcaaffb48cbbd4cd381d48cae991572c9e
(cherry picked from commit 7eccfeb9ca60aa6e09afbdf3a4435cb2f0d12987)
2018-05-24 13:58:58 +09:00
Remi NGUYEN VAN
9f85505432 Use CaptivePortalProbeSpec method in portal app
This only changes behavior if the EXTRA_CAPTIVE_PORTAL_PROBE_SPEC extra
is passed, which only happens if extra probe specs have been defined in
settings.

Bug: b/79499239
Test: manual: on 2 different portals, works w/ and w/o the setting
Merged-In: Iebd307b5d73a7b4679baea2a1c12c3baba6a7447
Merged-In: I851d8c41d42dccb03f813e549439f44c83f7d5ac
(clean cherry-pick of pi-dev I70acfd9213bf620cbb79ad999b8ad03472e8d43f)

Change-Id: I3b3bcbbd380f8cbd0b663556d55276f43e30b3e5
2018-05-24 12:14:34 +09:00
Remi NGUYEN VAN
13e6e21db9 Add configurable captive portal probes
The probes allow testing for a configurable status code and location
header (regexes). They are disabled by default, so this CL is a
no-op unless the probe configurations are pushed.

Bug: b/79499239
Test: tests in CL pass, manual: captive portal login works
Merged-In: Iec7a74bbf2569a91e958c497200d77e8451cbf7b
Merged-In: Ia958815325d1466345e9626efc8f62fc9d08d774
(clean cherry-pick of pi-dev I785723aaed06054b9aa8ebff77803f23d7836db9)

Change-Id: I18b3f263fed08fa4fee20d5e88f3ec8647d7f835
2018-05-24 12:08:36 +09:00
Remi NGUYEN VAN
d57329d853 Move CaptivePortalProbeResult to its own file
This is necessary to resolve visibility issues for the next change.

Bug: b/79499239
Test: runtest frameworks-net
Merged-In: Ia48b32307a51a66f2672d7112f71166dd6db41b1
Merged-In: I5df7ee9f16bc6be4f02353d40a843a383dd4cbd9
(Clean cherry-pick of pi-dev I50bc96afe6ae88c8f58a693f0a4e821f1f9b3299)

Change-Id: I3c416c1a91ebfdf914fd528ff8ab73e3eb490562
2018-05-24 12:04:27 +09:00
Remi NGUYEN VAN
a6085d17ca Use AI_ADDRCONFIG for most DNS requests
Not using it doubles the number of DNS lookups for single-stack
networks.
Private DNS hostname resolution still does not use this flag so that we
get all address families in advance, in case of LinkProperties changes.
Bug: b/79811321
Test: manual: Captive portal, 464xlat, networking in apps working
Merged-In: I7037342a93dc48b8e0988e719b9a9a2d5055bcf2
Merged-In: I8ca15fa079cd5ff94e4d9f7e0476504769f9708f
(Clean cherry-pick of pi-dev Ib46756e5e5f8d8d2698c90c5183c368d2d44be7a)

Change-Id: Iedb7a9c5f9caeb66de4505189fca8db91013d844
2018-05-24 11:42:05 +09:00
Daisuke Teranishi
ce4d67b6d0 Use correct filename when adding to ringtone
If the title of the music file includes "/", it's recognized
as a directory separator.
Use correct filename to select the file properly.

Bug: 80202253
Test: Add mp3 which title includes "/" to ringtone

Change-Id: I9bb05f6fe2d7d4dbbdf4f67db7ac6fde04707979
2018-05-24 11:39:33 +09:00
David Brazdil
ddceca858f Merge "Update hidden API lists in AOSP" 2018-05-23 16:36:47 +00:00
Pete Gillin
0040a61c3e Merge "Remove Arrays.checkOffsetAndCount from the greylist." 2018-05-23 15:55:48 +00:00
David Brazdil
aa8d4ef032 Update hidden API lists in AOSP
This should only be merged into AOSP branches

Merged-In: Ib66ef392c19c937718e7101f6d48fac3abe51ad0
Test: N/A
Change-Id: Ia9b362cf44821273a8c4d25f73ffd881895e7df1
2018-05-23 16:04:34 +01:00
Pete Gillin
46ab91aa14 Remove Arrays.checkOffsetAndCount from the greylist.
This method is being removed. All usages of this @hide method in the
platform have already been removed. For an analysis of the usage in
apps, see the bug.

Bug: 78447530
Test: cts-tradefed run cts-dev -m CtsLibcoreTestCases

(cherry picked from commit 094f08bc41d4124aed63123440d9efcafe1f473c)

Change-Id: I60a158654ad962c8e3b5282c035dae0c014903d0
Merged-In: Ic89cf0775170393fe906f581364bff0e852958ef
2018-05-23 14:16:31 +00:00
Jiyong Park
9f89b3393d Merge "Shared lib def for org.apache.http.legacy comes from java_sdk_library" 2018-05-23 11:35:25 +00:00
Treehugger Robot
1771240c80 Merge "Reset the profile when system application change version." 2018-05-22 23:15:36 +00:00
Christopher Ferris
10e3fdd263 Merge "Remove unnecessary references to libunwind." 2018-05-22 19:22:39 +00:00
Treehugger Robot
00c0a5bb23 Merge "PacProcessor: Include libpac as a JNI_SHARED_LIBRARY." 2018-05-22 12:24:33 +00:00
Jiyong Park
c73b9e9e17 Shared lib def for org.apache.http.legacy comes from java_sdk_library
org.apache.http.legacy is now built using java_sdk_library. Since the
share lib defintion file for the lib is automatically created and
installed, we don't need to have duplicated entry for the lib.

Bug: 77577799
Test: m -j
Test: adb shell cmd package list libraries shows an entry for
org.apache.http.legacy

Merged-In: I06b356c2ba08abc6c1cece81daf7c1773ed93ed0
Change-Id: I06b356c2ba08abc6c1cece81daf7c1773ed93ed0
(cherry picked from commit 49c0a869550dc6a80f75fb08fd38e11ee84bc33d)
2018-05-22 20:43:51 +09:00
Christopher Ferris
41fa069e52 Remove unnecessary references to libunwind.
Bug: 79209464

Test: Builds.
Change-Id: Ica58edd0d11b54c45b0af8e75eed67936f4309c2
Merged-In: Ica58edd0d11b54c45b0af8e75eed67936f4309c2
(cherry picked from commit 2197eebc6421cc98ee024b195915a97c037f7670)
2018-05-21 14:19:06 -07:00
Treehugger Robot
59fa1bcf69 Merge "Use AAPT2 for modules with manifest validation errors" 2018-05-21 19:53:38 +00:00
Colin Cross
b3c1814b98 Use AAPT2 for modules with manifest validation errors
Add LOCAL_AAPT_FLAGS += --warn-manifest-validation to the modules
that have manifests that AAPT2 can't parse.

Bug: 79755007
Test: m checkbuild
Change-Id: I357fcba75909495ba2b46b9ed1b532e65fee3fe1
2018-05-21 19:52:43 +00:00
Colin Cross
61f92e7e13 Merge changes from topic "aapt2-warn-manifest-validation"
* changes:
  AAPT2: treat manifest validation errors as warnings when asked
  AAPT2: Better error messages for ManifestFixer
  AAPT2: Differentiate between Android and Java package names
2018-05-21 19:52:24 +00:00
Izabela Orlowska
533c09b01b AAPT2: treat manifest validation errors as warnings when asked
Bug: 65670329
Test: updated
Change-Id: Ic554cc20134fce66aa9ddf8d16ddffe0131c50e9
Merged-In: Ic554cc20134fce66aa9ddf8d16ddffe0131c50e9
(cherry picked from commit ad9e1324ff2c459d0ee6ee571d4a3e458c02cc81)
2018-05-21 19:51:50 +00:00
Adam Lesinski
b2b20f26db AAPT2: Better error messages for ManifestFixer
AAPT2 will now print the XML hierarchy where it found an unexpected
element.

Test: make aapt2_tests
Change-Id: Iac7918b2f344fab874f0a3e7aa9c6936ecde8913
Merged-In: Iac7918b2f344fab874f0a3e7aa9c6936ecde8913
(cherry picked from commit ed37f4842ad838792b16bf19768ed9b2519b0194)
2018-05-21 19:51:42 +00:00
Adam Lesinski
ef506c73bb AAPT2: Differentiate between Android and Java package names
Android package names are more strict (ASCII only) than Java package names.
Also fixed an issue where trailing underscores were disallowed in Android
package names.

(cherry picked from commit 96ea08f1e737e0d19e274e9a29f71c387d81b09a)

Also includes part of I357fb84941bfbb3892a8c46feb47f55b865b6649 to remove
usage of FindNonAlphaNumericAndNotInSet.

Bug: 79481102
Test: make aapt2_tests
Change-Id: I1052e9e82b6617db6065ce448d9bf7972bb68d59
Merged-In: I1052e9e82b6617db6065ce448d9bf7972bb68d59
2018-05-21 19:48:36 +00:00
Treehugger Robot
1e0a5d397d Merge "Change ownership of AAPT2 and libandroidfw" 2018-05-21 19:46:00 +00:00
Jordan Liu
d25198f62f Merge "Change directory where apns-conf.xml is stored" 2018-05-21 19:06:54 +00:00
Treehugger Robot
923208e8c9 Merge "ActivityManager: Fix slow-app ANR dumping" 2018-05-21 16:59:17 +00:00
Niklas Lindgren
d3904f1ca3 Change directory where apns-conf.xml is stored
When apns are downloaded OTA they are stored directly under data/misc
by system server. Files created there gets assigned with file context
system_data_file which TelephonyProvider cannot read.

In order to make sure that downloaded apns gets a file context TelephonyProvider
can read we create an apns sub directory in init where radio_data_file:s are
created. The data path to where apns-conf is stored is here changed from /data/misc/
to /data/misc/apns/.

This change is aligned with other files that ConfigUpdateInstallReceiver writes.

Test: Trigger Apn update via intent UPDATE_APN_DB
Go to settings/apn-list and verify that newly downloaded are present
Bug: 79948106

Change-Id: I5a9ec262bfbac291cca9fee5accf93eb6c06f253
2018-05-21 18:43:44 +02:00