Commit Graph

5501 Commits

Author SHA1 Message Date
Nandana Dutt
cefdee8540 Merge "Add error handling and other improvements to Bugreporting API" 2019-02-05 13:48:13 +00:00
Nandana Dutt
551906c296 Add error handling and other improvements to Bugreporting API
* Validate input arguments
* Ensure primary user
* Handle remote exceptions
* Pass error conditions to listener
* Ensure only one bugreport is in progress, at least via the API.

BUG: 123584708
BUG: 123571915
Test: Builds
Test: Manual; unit tests coming up

Change-Id: I4d1e0000fe815a02b82ce625864759fd818e6a24
2019-02-05 10:37:37 +00:00
Hans Boehm
13060ffbd8 Improve AsyncTask API documentation
Bug: 34278255
Test: TreeHugger
Change-Id: I0347072112254f98d257a72ef1fc7c21b086df39
2019-01-31 17:36:36 -08:00
Howard Chen
0b2057db02 Merge "Add the DynamicAndroid Service" 2019-01-31 14:35:49 +00:00
Howard Chen
f17f42b0df Add the DynamicAndroid Service
Define the DynamicAndroid with AIDL.
  Add a java implementation.
  Start a service instance in the system server.
  Add a permission test.

Bug: 122015653
Test: Build & Test on a pixel phone with following command \
  ./frameworks/base/services/tests/runtests.py -e class com.android.server.DynamicAndroidTest

Merged-In: I2e54b6b71fac4a4c5a9c9c25ce6bdac74cddcfb7
Change-Id: I2e54b6b71fac4a4c5a9c9c25ce6bdac74cddcfb7
2019-01-31 15:10:21 +08:00
Remi NGUYEN VAN
b334bbefd4 Merge "Add UserHandle.getAppId to SystemApi" 2019-01-31 06:04:11 +00:00
Remi NGUYEN VAN
9e70a42252 Add UserHandle.getAppId to SystemApi
This is consistent with other methods in this class, and unbundled
system apps such as the network stack need this API to verify their
callers regardless of the userid. The method is already marked as
TestApi.

Test: m
Bug: 123655057
Change-Id: I0ecef4abcd850dc641cd70681a56cb038778c04c
2019-01-31 12:52:03 +09:00
Christian Wailes
3ad8923842 Merge "Added OWNERS entries for some Zygote related files." 2019-01-31 01:04:28 +00:00
Nandana Dutt
706b2d0e16 Merge "Remove DumpstateOptions" 2019-01-28 17:20:45 +00:00
Nandana Dutt
6ac57c669a Merge "Expose bugreporting API as system API." 2019-01-28 16:27:07 +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
Nandana Dutt
9abc452d0e Remove DumpstateOptions
This is not used anymore, instead bugreport mode is used to encapulsate
a number of options.

BUG: 111441001
Test: builds

Change-Id: I04f17b2605d242a33909cfaecbc647e9eee8d1fc
2019-01-28 10:56:48 +00:00
Nandana Dutt
2083e8c8b8 Expose bugreporting API as system API.
BUG: 111441001
Test: Builds
Change-Id: I1530f92971807b7e43c763a58dd1e18e793255da
Merged-In: I1530f92971807b7e43c763a58dd1e18e793255da
2019-01-28 09:33:55 +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
Nandana Dutt
28d8dd7890 Follow API guidelines in BugreportManager
* Add an executor for callback
* Rename *listener to *callback
* Accept ParcelFileDescriptor.

Not changing the binder interface to accept ParcelFileDescriptor because
there seem to a bug in generated java code for "out"
ParcelFileDescriptors causing compilation errors.

BUG: 111441001
Test: Builds
Change-Id: I9caf91b504eacc3ab6ff23620f1d6ded51caee1a
2019-01-25 15:31:45 +00:00
Christian Wailes
33a09948e5 Merge "Enables the use of the blastula pool." 2019-01-25 02:06:47 +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
Treehugger Robot
1bed967833 Merge "Add a new bugreport error code" 2019-01-24 22:21:16 +00:00
Josh Gao
8d7976a37e Merge "ParcelFileDescriptor: fix various ownership mistakes." 2019-01-24 18:49:03 +00: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
Nandana Dutt
bba7e82696 Add a new bugreport error code
Add an error code for consent request timing out.
BUG: 111441001
Test: builds

Change-Id: I91b947545c3adcb2104759e4d277dd1686de41ee
2019-01-23 19:11:01 +00:00
Treehugger Robot
212353c896 Merge "Improvements to Bugreporting API." 2019-01-23 17:00:48 +00:00
Nandana Dutt
b2da22a0de Improvements to Bugreporting API.
* Add cancelBugreport method.
* Remove unused arguments to onFinished listener call.
* Publish the system service now that sepolicy for it
  is submitted.
* Use the new bugreportd service.

Test: boots
BUG:111441001
Change-Id: I12d72e0e1f4ca72d285fd02a3fc1a44f5c179885
2019-01-23 10:21:45 +00:00
Remi NGUYEN VAN
6c7877b7bb Add UserHandle constants to SystemApi
The affected constants are already SystemApi in internal.

Bug: 112869080
Test: m
Change-Id: Iacefdefa59346eaebd8b92743fe8710845edcc29
Merged-In: I261dfcc5cfdfc76bda5d70181785e11c2715a558
2019-01-23 11:06:18 +09:00
Remi NGUYEN VAN
3b887bdf4a Merge "Expose UIDs for NetworkStack permission checks" 2019-01-22 13:40:57 +00:00
Remi NGUYEN VAN
0d81df94cd Expose UIDs for NetworkStack permission checks
The UIDs are unlikely to change and added as public API.

Test: m
Bug: 112869080
Change-Id: I5477093a4c8593dd9ada7587b86c65352e628c34
2019-01-22 20:44:06 +09:00
Lorenzo Colitti
a27da72cd1 Expose ServiceSpecificException as @SystemApi.
This class is useful as a system API because:

- It is one of the few exceptions that is natively Parcelable.
- It is directly supported by native code without using JNI,
  using Status::fromServiceSpecificError.
- Unlike other natively parcelable exceptions, it contains both
  an error message and an error code.

Test: m
Bug: 112869080
Change-Id: Ica3e88c2b6877e429a61b053d75f69b9f19fc74a
2019-01-22 18:44:12 +09:00
Nandana Dutt
161a44616c Pass in calling UID and package to dumpstate
BUG: 111441001
Test: builds
Change-Id: Ib623f6d4f50b81f331131cf3fda92fe2526dd6c7
2019-01-17 16:15:27 +00:00
Treehugger Robot
4fefbddead Merge "BugreportAPI : Connect listener to binder callbacks" 2019-01-16 16:24:15 +00:00
Lorenzo Colitti
29afcf0eb0 Merge changes Iec53a9fd,Iac4cfe70
* changes:
  Test parceling empty LinkProperties.
  Delete the clatd functions from NetworkManagementService.
2019-01-16 09:28:06 +00:00
Steven Moreland
bc79587a85 Merge "HIDL stuff to TestApi." 2019-01-15 21:15:34 +00:00
Nandana Dutt
55c2344bc5 Merge "Add the new dumpstate listener methods to implementations" 2019-01-15 14:12:28 +00:00
Nandana Dutt
c8c77bc043 BugreportAPI : Connect listener to binder callbacks
BUG: 111441001
Test: builds
Test: interactive bugreport still works
Change-Id: Ie3f2328f558bb2de1dec2908c6ab13f5a17df115
2019-01-15 12:51:42 +00:00
Lorenzo Colitti
9307ca2ba1 Delete the clatd functions from NetworkManagementService.
Make Nat464Xlat talk to netd directly instead of through
NetworkManagementService. The methods in NetworkmanagementService
don't really provide any value: since the only thing they do is
call into netd, we might as well have the callers talk to netd
directly,

In order to do this, pass INetworkManagementService and INetd to
the NetworkAgentInfo constructor, and update callers appropriately.

Bug: 65674744
Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: Iac4cfe709c6279e4d9682b6754963e533707bd12
2019-01-15 11:13:07 +09:00
Steven Moreland
14b9eb6b95 HIDL stuff to TestApi.
Since the CTS test for android.os is build with test_current.

Bug: 78650449
Test: android.os.cts
Change-Id: If784f4949af931c6c4efc284f1d16414705fe2d4
Merged-In: If784f4949af931c6c4efc284f1d16414705fe2d4
2019-01-14 22:36:09 +00:00
Nandana Dutt
432f8c7b86 Add the new dumpstate listener methods to implementations
Add dummy implementations for status, error and finished callbacks.
Next step: wire these up end-to-end; change Shell's listener to be
BugreportManager.BugreportListener, and make it communicate with the
native service explicitly through the new system api.

BUG: 111441001
Test: Verified progress in interactive bugreport still works
Change-Id: Iad0bb7b23b04f6bc7e3b31e5071df42409c78684
2019-01-14 17:55:27 +00:00
Nathan Harold
360e25280c Merge changes from topic "cellinfocallback-error"
* changes:
  Add an onError() method to CellInfoCallback
  Add AIDL for ParcelableException
2019-01-14 17:50:39 +00:00
Nandana Dutt
3386fb7172 Add a privileged API for capturing and consuming bugreports
The API is mostly implemented; except for hooking up the listener
and handling an already running bugreport.

BugreportManager is the handle to the new API exposed to apps.

Generating bugreports requires root privileges. To limit the footprint
of the root access, the actual bugreport generation in Dumpstate binary,
is accessed as a oneshot service and dies after it finishes
running.

System server accesses Dumpstate via a binder interface since it does
not have root privileges.

Starting a oneshot service is done via setting a system property, which
needs to be done from system server. BugreportManagerService is the
new system server service that does this. BugreportManager calls into
BugreportManagerService via a binder interface, since the former is in
the app's process.

Both app to system server as well as system server to native service
calls are via implementations of IDumpstate binder interface.

Bug: 111441001
Test: builds. Flashed & verified it boots.
Test: wrote a test client (not included) and verified invoking
startBugreport works.

Change-Id: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
Merged-In: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
2019-01-11 13:29:09 +00:00
Junyu Lai
bd73798585 Merge "Ignore ipv6 tx traffic on clat uid." 2019-01-04 09:29:10 +00:00
Nathan Harold
d2715b7c70 Add AIDL for ParcelableException
Add an AIDL for ParcelableException so that the
type can be explicitly used in other AIDLs.

Bug: 120489428
Test: compilation
Change-Id: I5839cc0c62744be856ea41fdf6ed1d77150259b5
2018-12-28 16:05:22 -08:00
Mathew Inwood
55418eada5 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 14:26:35 +00:00
Remi NGUYEN VAN
c094a5402c Add NetworkStack app
The app is not started yet, and does not contain any service for now.

Test: built, booted
Bug: b/112869080
Change-Id: Id5a0fd02c891100e85d86b1040e53beec3581950
2018-12-25 11:42:42 +09:00
Treehugger Robot
760e074e50 Merge "NativeHandle.java: dup() with O_CLOEXEC" 2018-12-18 18:36:35 +00:00
Ken Chen
3176e8be7a Merge "Remove 'hasDns' parameter" 2018-12-18 11:17:27 +00:00
Nick Kralevich
1de009645c NativeHandle.java: dup() with O_CLOEXEC
Don't use Os.dup(), as it creates file handles which leak across exec()
boundaries. Instead, use fcntl(F_DUPFD_CLOEXEC);

O_CLOEXEC is essential for ensuring that file descriptors do not leak
across an exec() boundary. Setting O_CLOEXEC ensures that file
descriptors can't linger around unnecessarily in an exec()ed process
which doesn't use them, making more efficient use of resources.
Additionally, O_CLOEXEC is important in ensuring that untrusted
exec()ed code cannot take advantage of leaked file descriptors.

Test: Android compiles and boots
Bug: 120983106
Change-Id: I99a66834cc6b9bb25e1b4daf75384ec6a91ae9e2
2018-12-17 14:48:35 -08:00
Treehugger Robot
a32f898720 Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master" 2018-12-13 05:45:20 +00:00
Adrian Roos
6115769c16 API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Merged-In: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-12 15:02:26 +01:00
Lorenzo Colitti
481251a0c2 Merge changes from topic "netd-event-listener-aidl"
* changes:
  Depend on the stable AIDL version of the netd metrics interface.
  Delete INetworkManagementService#getNetdService.
2018-12-12 06:17:25 +00:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00