Commit Graph

9817 Commits

Author SHA1 Message Date
Nikita Ioffe
ee4d7be219 Add a whitelist to control packages that can use Bugreporting API
Test: checked SecurityException is thrown for my custom app
Test: whiltelisted my custom app, checked no SecurityException is thrown
Bug: 126541701
Change-Id: Id0b61ccc1adf40bcb455d3b59b640f4b160bdd84
Merged-In: Id0b61ccc1adf40bcb455d3b59b640f4b160bdd84
(cherry picked from commit 07964b49ac)
2019-03-13 17:01:56 +00:00
Treehugger Robot
894c578a02 Merge "continue read file when returned count > 0" 2019-03-13 07:36:51 +00:00
Treehugger Robot
88b57a2c4d Merge "Schematize Crypto state system property" 2019-03-13 01:30:58 +00:00
Kiyoung Kim
5cba0cff2c Add product apk support from libnativeloader
Currently libnativeloader appends vendor lib path if apk is from vendor
partition. Similar to this we should add product lib path if apk if from product partition.

Bug: 124705551
Test: m -j && tested from crosshatch with product apps (such as Wallpaper)
Change-Id: Ic85b16e8e4484a35c659c16e067f1e7c7285d05e
Merged-In: Iaa8d0ea61b1b9ab8a1da676a492f75c6a5d71d5d
2019-03-11 11:42:28 +09:00
Bernie Innocenti
e5e3ac639b Merge "Add junyulai@ as owner of the core networking dirs" 2019-03-08 15:21:01 +00:00
Bernie Innocenti
ea89cf2c6e Add junyulai@ as owner of the core networking dirs
Also removed emeritus accounts ek@ and silberst@ from various places.
A cleanup using 'include' would probably be in order...

Test: N/A
Change-Id: I575e60dd5e600e42d9571ce8e8d7661d30e99bfe
2019-03-08 13:04:05 +00:00
Chalard Jean
65087f4705 Merge "Support VPN Proxy(1/2)" 2019-03-08 00:34:25 +00:00
Andrei Onea
cf1a82953b Add @UnsupportedAppUsage annotations
For packages:
  com.android.internal.app
  com.android.internal.appwidget
  com.android.internal.location
  com.android.internal.os
  com.android.internal.policy
  com.android.internal.statusbar
  com.android.internal.telecom
  com.android.internal.telephony
  com.android.internal.widget

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Merged-In: I6eba34467b2492047e5264684312adfa029eb317
Change-Id: I413c4b6dd12bcf40b69423718ed278cbefe82087
2019-02-28 17:01:29 +00:00
Kiyoung Kim
0b434967fb Schematize Crypto state system property
Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.

Bug: 117924132
Test: m -j
Change-Id: I968b342fdd0b8c30405611e53aca2479784636d7
Merged-In: Id36208fac5d4de062a51d541b64145560242f8fc
2019-02-26 14:26:26 +09:00
Takayuki, Ogura
5ad260d087 Support VPN Proxy(1/2)
Use VPN Proxy if it is set in VPN Settings

Bug: 118793208
Test: runTest
Change-Id: Ib58685fe3afc6e0279f6abe762e9adabd6ea6ccc
2019-02-26 10:53:33 +09:00
Sudheer Shanka
daddc5bb50 Merge "Fix potential crash when per-procstate cpu times tracking is turned on." 2019-02-22 01:24:03 +00:00
Sooraj Sasindran
9f0115bb6e Merge "Allow UiAutomation to adopt the shell permission indentity" 2019-02-22 00:41:29 +00:00
Svet Ganov
c2841ec7fe Allow UiAutomation to adopt the shell permission indentity
For testing we often need to run shell commands. This can be done
today via running a shell command from an instrumentation test
started from the shell. However, this requires adding shell commands
which are not in the API contract, involve boilerplate code, require
string parsing, etc.

This change allows an instrumentation started from the shell to
adopt the shell UID permission state. As a result one can call APIs
protected by permissions normal apps cannot get by are granted to
the shell. This enables adding dedicated test APIs protected by
signatures permissions  granted to the shell.

Test: cts-tradefed run cts-dev -m CtsUiAutomationTestCases
          -t android.app.uiautomation.cts.UiAutomationTest#testAdoptShellPermissions

bug:80415658

Merged-In: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
Change-Id: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
2019-02-21 19:59:14 +00:00
Kiyoung Kim
03c14760a5 Merge "Schematize Crypto system properties" 2019-02-21 00:16:45 +00:00
Chris Wailes
b13bfc5682 Updated Zygote IPC related comments.
Bug: 124637285
Test: None; comment only changes
Change-Id: Ie567715a1ee08cdf65e3135aa75e3bd95ef5ab0d
2019-02-20 11:19:54 -08:00
Xin Li
4ba3b12efb Merge changes from topic "PPRL.190205.001"
* changes:
  Fix merge problems with cherry-picking "Add notification settings to backup&restore" change into pi-dev
  DO NOT MERGE - Merge PPRL.190205.001 into master
2019-02-20 16:25:58 +00:00
Andrei-Valentin Onea
619ed85e81 Merge "Use sampled value in hidden api logger" 2019-02-20 14:49:10 +00:00
Andrei Onea
3513d3c8b0 Use sampled value in hidden api logger
The hidden api logger interface also receives the actual sampled value.
This is an intermediate step before a new logging method is added.

Test: m
Bug: 119217680

(cherry picked from commit 31bde16393)

Change-Id: I3345bdcdf57e1f60970c85572e503d7b33af7148
Merged-In: I707a2624a254a80391cdae277dd59daa503d055f
2019-02-20 12:56:52 +00:00
Bin Chen
5f0521e3b9 Fix potential memory leak in SomeArgs
When recycling SomeArgs in pool, some fields are not set to null.
Which result potential memory leak as SomeArgs in pool still holds
the reference object.
To fix this issue, clear all args when recycling.

Change-Id: Ie730c3889da948c60ef746ddbe2e926d94ad7e06
Signed-off-by: Bin Chen <bin0515@gmail.com>
Signed-off-by: Wei Huang <hwbest.v@gmail.com>
2019-02-20 17:40:02 +08:00
Treehugger Robot
43d11758fa Merge "Fix for testLifecycleOnMoveToFromSplitScreenRelaunch" 2019-02-19 02:02:35 +00:00
Kiyoung Kim
feab82cf82 Schematize Crypto system properties
Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.

Bug: 117924132
Test: m -j
Change-Id: I141ae3a011f9cb3ea283ca25175205b6af966ec6
Merged-In: I141ae3a011f9cb3ea283ca25175205b6af966ec6
2019-02-18 11:51:50 +09:00
Sudheer Shanka
6ebb1d15f3 Fix potential crash when per-procstate cpu times tracking is turned on.
When per-procstate cpu times tracking is turned on,
BatteryStatsImpl tries to access mKernelSingleUidTimeReader but
it's possible that mKernelSingleUidTimeReader hasn't been initialized
yet after a reboot and this could lead to a system_server crash.

Bug: 111523951
Test: manual
Change-Id: Id014f23fbe31fed64fba769f14ba4396a003092e
Merged-In: Id014f23fbe31fed64fba769f14ba4396a003092e
(cherry picked from commit 020239df85)
2019-02-15 18:27:38 -08:00
Xin Li
0e71b4f19b DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
2019-02-14 09:48:06 -08:00
Andrei-Valentin Onea
deb35fb00b Merge "Fix regression in Dalvik:HEAP_TOTAL" 2019-02-11 11:26:46 +00:00
Raj Mamadgi
7b6ae663d6 Fix for testLifecycleOnMoveToFromSplitScreenRelaunch
The configuration change occurs twice and the CallbackTrackingActivity is
relaunched twice, this causes the test to fail on some devices with certain
densities.

BUG:123342948

Change-Id: Idbf79a48a55477445cd70a6f76c104d7669bf2fa
Signed-off-by: Raj Mamadgi <r.mamadgi@samsung.com>
2019-02-07 22:17:32 +00:00
Andrei Onea
e6efa0540a Fix regression in Dalvik:HEAP_TOTAL
Make HiddenApiUsageLogger a singleton initialised in Zygote pre-fork and
rely on copy-on-write to prevent heap size increases

Test: atest google/perf/memory/memory-test
Bug: 123705750
Change-Id: I384d3bdefa6525fcce494783c548e85979bce4d5
Merged-In: Idc5ad13d4e158659009290f410ce721013345308
2019-02-07 17:12:59 +00:00
Mathieu Chartier
f5cd8c1601 Add use_app_image_startup_cache feature flag
Passed down to the zygote if the corresponding system property is set:
runtime_native / use_app_image_startup_cache.

Bug: 123524494
Bug: 116059983
Test: adb shell device_config put runtime_native use_app_image_startup_cache true

(cherry picked from commit ced7e08129)

Merged-In: I27c0b9ea9533b2b6ad1ccd45f0fb9292c4cfca02
Change-Id: I27c0b9ea9533b2b6ad1ccd45f0fb9292c4cfca02
2019-02-06 12:30:36 -08:00
Varun Anand
62a9b66a38 Merge "Add an API that allows VPNs to declare themselves as metered." 2019-01-31 02:43:25 +00:00
Christian Wailes
3ad8923842 Merge "Added OWNERS entries for some Zygote related files." 2019-01-31 01:04:28 +00:00
Varun Anand
1215f09b07 Add an API that allows VPNs to declare themselves as metered.
For VPN apps targeting Q and above, they will by default be treated as
metered unless they override this setting before establishing VPN.

Bug: 120145746
Test: atest FrameworksNetTests
Test: On device tests verifying meteredness setup correctly for apps
targeting Q and apps targeting P.
Change-Id: Ia6d1f7ef244bc04ae2e28faa59625302b5994875
2019-01-30 14:09:03 -08:00
Andrei Onea
89acbab9c8 Initialise hidden api usage logger pre-fork
Topic: hidden-api-reporting-upcall
Test: m
Bug: 119217680
Change-Id: I8722f0bf4275fea4a8faf41d7b862c04b4014824
Merged-In: I80f82092ef779a7dc1f1322cb7c05ebf5e59939b
2019-01-30 11:17:07 +00:00
Neil Fuller
927c15c470 Track ZygoteHooks API changes in libcore
Track ZygoteHooks API changes in libcore to make
the ZygoteHooks API more consistent.

Bug: 111742291
Test: build / boot / treehugger
Merged-In: Ie65aac6539cffc90663807791511b95a6cd61ab4
Change-Id: Ie65aac6539cffc90663807791511b95a6cd61ab4
2019-01-29 19:47:35 +00:00
Ganesh Mahendran
baff465f66 continue read file when returned count > 0
In android, we met a lot of watchdog timeout which
caused by read file "/d/wakeup_sources".

The root cause is that in kernel side wakeup.c, it uses single_open()
interface to show the stats. But single_open() interface
requires that the whole output must fit into a single
buffer(physical continuous). This will lead to timeout when system
memory is not in a good situation.

Problem in kenrel side has been merged in [1]. Then kernel will return
max a page bytes to user space. So in KernelWakelockReader, we
need to read again when returned count > 0.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.0-rc4&id=00ee22c28915d111ba415750a3311d7678fd1206

Change-Id: If7886514c609c8d6338532c67c1cee79f2754ab1
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
2019-01-29 06:30:30 +00:00
David Brazdil
faedae5981 Merge "Add @UnsupportedAppUsage to methods known to be used by apps" 2019-01-28 14:23:43 +00:00
David Brazdil
576da0582f Add @UnsupportedAppUsage to methods known to be used by apps
Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 123308819
Bug: 122291025
Test: m appcompat
Change-Id: Iafd62b8ece0d19268fad65086134a1e7369bc0bb
2019-01-28 12:46:33 +00:00
Chris Wailes
5d0f240569 Added OWNERS entries for some Zygote related files.
This commit adds two OWNERS files and modifies a third to add owner
entries for files related to the Zygote.

Test: none
Change-Id: Id26271e5af168775b2d2d3f9d3cc0c3421ad03f1
2019-01-25 11:22:58 -08:00
Christian Wailes
33a09948e5 Merge "Enables the use of the blastula pool." 2019-01-25 02:06:47 +00:00
Christian Wailes
0d9156a9c0 Merge "Added Java Language methods for blastula management." 2019-01-25 02:06:28 +00:00
Chris Wailes
cffbf1c9b4 Enables the use of the blastula pool.
This commit adds the code necessar to initialize and use the blastula
pool during application launching.  Highlights include:
* Modifying ZygoteState to allow the creation of blastula session
sockets
* Modified application startup to track if a web view process is being
created.
* Initialization of the blastula pool during Zygote initialization.
* Blastula lifecycle management via reporting pipes and event FDs.
* Launching of applications via the blastula pool.

The creation, maintenance, and use of the blastula pool can be disabled
by setting Zygote.BLASTULA_POOL_ENABLED to false.  When this feature is
disabled applications will launch as they did before this patch.

Topic: zygote-prefork
Test: make & flash & launch app & check log message
Bug: 68253328
Change-Id: I46c32ad09400591e866b6c6121d5a9b0332092f3
Merged-In: I46c32ad09400591e866b6c6121d5a9b0332092f3
2019-01-24 16:50:05 -08:00
Chris Wailes
c37ebe1313 Added Java Language methods for blastula management.
This commit adds Java Language wrappers for native blastula management
functions.  No changes are made to the application lifecycle.

Topic: zygote-prefork
Test: make & flash & launch apps & check log for messages
Bug: 68253328
Change-Id: Ie9fd0aea2952dbd3baaca22c820e9af700f5e89d
Merged-In: Ie9fd0aea2952dbd3baaca22c820e9af700f5e89d
2019-01-24 16:50:02 -08:00
Chenbo Feng
48f46ac83c Merge "Use delta reads for per uid traffic stats" 2019-01-24 18:16:25 +00:00
Treehugger Robot
8b5917965d Merge "Add API for proxy configuration over VPN." 2019-01-24 17:52:22 +00:00
Irina Dumitrescu
044a436ac9 Add API for proxy configuration over VPN.
Test: runtest -x
frameworks/base/tests/net/java/com/android/server/ConnectivityServiceTest.java
&& atest HostsideVpnTests
Bug: 76001058
Change-Id: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a
Merged-In: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a
2019-01-24 16:07:20 +00:00
Chris Wailes
682b479a88 Refactored ZygoteConnection.Arguments to ZygoteArguments.
This commit moves the ZygoteConnection.Arguments class into its own file
and re-names it to ZygoteArgumens.  Doing this also required small
changes to files that used ZygoteConnection.Arguments.  In turn, this
required some changes to make the files conform to the Frameworks style
guide.

Highlights include:
* Moving ZygoteConnection.Arguments to ZygoteArguments
* Moving helper functions from ZygoteConnection to Zygote
* Re-named member variables in the ZygoteArguments class
* Removed unused imports.

Topic: zygote-prefork
Test: make & flash & launch apps & check log for messages
Bug: 68253328
Change-Id: Ideb414c87a92020128a644147949ef4f4133ae33
Merged-In: Ideb414c87a92020128a644147949ef4f4133ae33
2019-01-23 13:35:16 -08:00
Chris Wailes
cd92db2545 Code cleanup in ZygoteInit.
This commit mostly re-flows the code in ZygoteInit.java to conform to
the Frameworks style guide.

Topic: zygote-prefork
Test: make & flash & launch apps
Bug: 68253328
Change-Id: I0d348caa1d9ca2a4c1e32430e0eebdd91672e473
Merged-In: I0d348caa1d9ca2a4c1e32430e0eebdd91672e473
2019-01-23 13:35:06 -08:00
Chris Wailes
6e3c7ced5e Code cleanup to conform to style guide / linter.
This commit made the following changes to make the code conform to the
Frameworks style guide:
* Re-named variables
* Re-flowed code
* Organized includes

Topic: zygote-prefork
Test: make & flash & launch apps
Bug: 68253328
Change-Id: I9274b32f1f606f29f6eb3a1e5068ca18f607afe7
Merged-In: I9274b32f1f606f29f6eb3a1e5068ca18f607afe7
2019-01-23 13:34:52 -08:00
Chris Wailes
8b35ba25a9 Implemented native functions and types for blastula management.
This patch adds native support for spawning and managing blastula pools,
as well as several code cleanups and modernizations.

Changes includes:
* A function to fork blastulas
* A table for managing blastula-related data
* Functions for adding and removing blastula data from the
aforementioned table
* Switching from NULL to nullptr
* Replacing string-passing error handling with a curried failure
function
* Utility functions for handling managed objects
* JNI functions for blastula pool management

Topic: zygot-prefork
Test: make & flash & launch apps & check log for messages
Bug: 68253328
Change-Id: I12cd9f2c87a2e3c00d64b683edf3631e29a51551
Merged-In: I12cd9f2c87a2e3c00d64b683edf3631e29a51551
2019-01-23 13:34:40 -08:00
Chenbo Feng
b29a6166e0 Use delta reads for per uid traffic stats
For the detailed network stats of each uid and tag, the native
implementation provides delta read instead of consistent stats
data since boot. Every time the readNetworkStatsDetail function gets
called, the data pulled will be cleared. We will keep a persistent data
since boot in NetworkStatsService instead.

Fixed some checkstyle complains in related files as well.

Bug: 79171384
Test: android.app.usage.cts.NetworkUsageStatsTest
      NetworkStatsServiceTest
Change-Id: I50bcf278739135081d522e50b0e88d76fd9ab131
2019-01-22 13:50:35 -08:00
Remi NGUYEN VAN
c1c02dcb65 Remove NetworkStack dependencies on hidden members
- DhcpClient only shares its handler with IpClient, and NetworkMonitor
   has its own handler: remove Protocol.BASE_DHCP,
   Protocol.BASE_NETWORK_MONITOR
 - Remove dependency on Network.netid in NetworkMonitor
 - Remove dependency on Sets.newArraySet in DhcpServingParams
 - Remove dependency on formatDuration() in DhcpClient
 - Replace isMetered() with hasCapability() in NetworkMonitor
 - Use WifiManager.isScanAlwaysAvailable instead of reading setting

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Ieef54d847ddc081fb33cbad0b050b06d2e52548e
2019-01-22 18:48:12 +09:00
Treehugger Robot
9613bfd2a4 Merge "Adjust map names due to new bpfloader" 2019-01-09 18:34:49 +00:00