Commit Graph

4688 Commits

Author SHA1 Message Date
Josh Gao
5ada87388c ParcelFileDescriptor: support bionic's fd ownership tracking.
Also, delete a bunch of deprecated functions that are package-private,
and not called anywhere in the package.

Test: booted walleye
Change-Id: I728e63e7d6f9e1ba42644f93983cfcd6a2d2634c
2018-07-20 16:00:20 -07:00
John Reck
107e6f2f53 Remove unneeded JNI method
Test: ran PFD CTS tests
Change-Id: I9a40319595c757835f7e19a50dc0311077c9e627
Merged-In: I9a40319595c757835f7e19a50dc0311077c9e627
(cherry picked from commit d7bd919075)
2018-07-16 16:32:38 -07:00
Olivier Gaillard
d3d065dc42 Add a getTransactionName method to Binder.
This method transforms a binder call code to a human readable name.
AIDL generator will have the ability to override this method.

Test: n/a
Bug: 111200705

Change-Id: Ic1d82e9b403ab40c8b625ca977a819ccd521dd97
2018-07-09 20:58:51 +00:00
Treehugger Robot
20e243d627 Merge "Use ParcelFileDescriptor's C++ implementation in libbinder" 2018-06-11 07:27:41 +00:00
Treehugger Robot
0559afdbcc Merge "Check for null path in getInternalPathForUser" 2018-06-08 20:16:14 +00:00
Jerry Zhang
30f63cf1f9 Check for null path in getInternalPathForUser
In some situations, path could be null resulting
in a crash.

Test: no crash
Bug: 109730998
Change-Id: I2ce0410162d1327905d690331f461f9187e20906
(cherry picked from commit 6f6154bf04)
2018-06-08 11:26:33 -07:00
Neil Fuller
d2f29d7a6f Remove CommonClock / CommonTimeManagementService
The service and associated code is unused.

Bug: 80462439
Test: build / boot
Merged-In: Ibdfab1b7d2951a0c45e07bd47850af037990841b
Change-Id: Ibdfab1b7d2951a0c45e07bd47850af037990841b
2018-06-06 17:03:55 +01:00
Ryo Hashimoto
20529959e8 Use ParcelFileDescriptor's C++ implementation in libbinder
Bug: 80377815
Test: build
Change-Id: I5bfce159fc5c06df29aff9d93ed7d771b7c33d72
2018-05-30 17:57:34 +09:00
Treehugger Robot
1109e2333f Merge "Framework: Add API to get zygote PID" 2018-05-24 18:28:59 +00:00
Pete Gillin
ca3450b524 Merge "Stop using Arrays.checkOffsetAndCount." 2018-05-16 13:04:13 +00:00
Treehugger Robot
87a7c657bd Merge "add install action for carrier id to system API" 2018-05-11 17:36:24 +00:00
fionaxu
4ff8de609b add install action for carrier id to system API
Bug: 79426800
Test: Manual
Change-Id: Icd3e9ae527dc17ab5762aa57df596f058de08d5b
(cherry picked from commit 2776ed56b8)
Merged-in: Icd3e9ae527dc17ab5762aa57df596f058de08d5b
2018-05-11 15:54:45 +00:00
Pete Gillin
60f55a255f Stop using Arrays.checkOffsetAndCount.
Start using ArrayUtils.throwsIfOutOfBounds instead. The Arrays method
is going to be removed.

Bug: 78447530
Test: cts-tradefed run cts-dev -m CtsOsTestCases (shows only unrelated failures: two user/userdebug mismatches and one from b/79471510)
Test: cts-tradefed run cts-dev -m CtsDrmTestCases
Test: adb shell am instrument -w -e class android.content.pm.LimitedLengthInputStreamTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: adb shell am instrument -w -e class android.os.FileBridgeTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ib3cd4f4ead61dbec1ccdc94b2ad4ad9c28574582
2018-05-10 18:17:50 +01:00
Andreas Gampe
8444dca38c Framework: Add API to get zygote PID
Add a zygote call that returns the PID of the zygote. Used for
profiling.

Bug: 79266002
Test: m
Change-Id: Idf9ba5ec314eb4cb72921000ad6cb34d1035a92a
2018-05-10 09:10:00 -07:00
Mathew Inwood
5449fc727f Treat hidden API exemptions as whitelist.
Update docs accordingly.

Test: m
Bug: 64382372
Merged-In: Ief8daf3badeb046b0461a3ebcd289e242d559070
Change-Id: Ief8daf3badeb046b0461a3ebcd289e242d559070
(cherry picked from commit 33d5138e13)
2018-05-08 10:29:29 +01:00
Mika Raento
6a30ff8326 Systrace support for NNAPI
Change-Id: Ie73d28937eba33e2d90f1447f17fd6d8e5719a65
Bug: 78137932
Test: mm
2018-04-26 09:34:12 +01:00
Colin Cross
88a2b68252 Merge changes from topic "hidl-system-api"
* changes:
  HIDL: add APIs used by subclasses to SystemApi
  Update HIDL-related documentation.
  Add remaining missing HIDL SystemApi methods.
  HIDL: reportSyspropMethod -> enableInstrumentation
  Allow HIDL to be used in priv-apps.
2018-04-10 16:06:28 +00:00
Daniel Colascione
d1520aa11b Clarify doc comment for android.os.Build.VERSION.RELEASE
The RELEASE field has no guaranteed internal structure and developers
should not attempt to parse it.

Test: no code changes
Change-Id: I0ea3ab5ba5dd4cc733feb62725cf7c62c00c857b
2018-04-06 08:36:18 -07:00
Steven Moreland
86d170c7ce HIDL: add APIs used by subclasses to SystemApi
Two methods:
- HwBinder()
- HwBinder registerService
- HwBinder onTransact

are used by Stub classes generated by hidl-gen.

Bug: 72480743
Test: build hidl-gen generated stubs with system_current
    after manually copying stub jar to prebuilts.
Change-Id: I9b409271b683ad4769a0420e1688b14c561d39d1
Merged-In: I9b409271b683ad4769a0420e1688b14c561d39d1
(cherry picked from commit 4c0d6b62a9)
2018-03-29 15:04:27 -07:00
Steven Moreland
9efa13f38c Update HIDL-related documentation.
This is a followup CL to previous @SystemApi CLs.

Bug: N/A
Test: N/A
Change-Id: I9c7dcc776dcfb89fd90afa4fc5d74e40ff0a5f94
Merged-In: I9c7dcc776dcfb89fd90afa4fc5d74e40ff0a5f94
(cherry picked from commit 739811a5c5)
2018-03-29 15:04:20 -07:00
Steven Moreland
ff0a3642e4 Add remaining missing HIDL SystemApi methods.
A couple methods of Java classes which became SystemApis
but were used are still @hide.

Bug: 72480743
Test: hidl_test_java
Change-Id: I0cb82384932ab1758fa7576b2125825c48a4a6c9
Merged-In: I0cb82384932ab1758fa7576b2125825c48a4a6c9
(cherry picked from commit adcb896fd6)
2018-03-29 15:04:14 -07:00
Steven Moreland
9312938842 HIDL: reportSyspropMethod -> enableInstrumentation
Renaming this method with a semantic meaning which
better explains its purpose without caring about
its implementation details.

Bug: 72480743
Test: hidl_test_java
Change-Id: I4b0577b3f61180ecfd66ae146973fa5cc2a3b244
Merged-In: I4b0577b3f61180ecfd66ae146973fa5cc2a3b244
(cherry picked from commit 36be191dfd)
2018-03-29 15:04:06 -07:00
Steven Moreland
4dde8a113b Allow HIDL to be used in priv-apps.
Marking HIDL as SystemApi to allow vendor apps to talk to their own
native HIDL services. This includes implementing HIDL callback objects.

HIDL (HAL interface design language) is a language that is used to
facilitate vendor<->system communication which provides guarantees
of ABI stability. For system and vendor services alike, this can also
be used for internal communication.

Bug: 67725182
Test: boot device, hidl_test_java
Change-Id: I9d028cc43ce6f81ea619f01e18f1cd772e17cbfa
Merged-In: I9d028cc43ce6f81ea619f01e18f1cd772e17cbfa
(cherry picked from commit e8e63aae6f)
2018-03-29 15:03:59 -07:00
Bookatz
ebf962f74b Dummy WorkChain class
To avoid future merge conflicts, a dummy WorkChain class must be
added temporarily. It goes along with the dummy StatsLog.java class.

Bug: 71607284
Test: none
Merged-In: Iff361eb98e079c7b2146c092dc27a3618a813c94
Change-Id: I66cf0c36c1842b99a5a4dd104fc5c06c0cfbe2b5
2018-03-29 09:43:05 -07:00
Treehugger Robot
b43daf5f7b Merge "MessageQueue: explicitly remove FD event listeners." 2018-03-28 18:06:31 +00:00
Treehugger Robot
4b8285b907 Merge "Configurable hidden API exemptions." 2018-03-27 20:49:45 +00:00
Mathew Inwood
2c6f97d4c9 Configurable hidden API exemptions.
Extend the existing hidden_api_blacklist_exemptions config to support a
list of API signature prefixes to exclude from hidden API enforcement.

Push this list down to the zygote process when that process is created,
and when the list changes. This minimizes overhead, but should also ensure
that all new processes get the latest whitelist.

Test: $ adb shell settings put global hidden_api_blacklist_exemptions \
Test:    Landroid/view/RemoteAnimationDefinition\\\;:Landroid/app/ActivityManager\\\$TaskDescription\\\;
Test: Manually verify logcat output from app which uses named APIs
Bug: 73337509
Change-Id: Ib1245b69da4dac50c6968f1be62f1a74591dc433
2018-03-27 10:51:10 +01:00
Martijn Coenen
cd5c65a8b1 Add new trace tag for AIDL.
So we can auto-generate tracing code for AIDL interfaces.

Bug: 74416314
Test: inspect atrace output
Change-Id: I42eee24358763305d6b4e954087f3331ad20f9b7
Merged-In: I42eee24358763305d6b4e954087f3331ad20f9b7
2018-03-26 09:59:32 +02:00
Treehugger Robot
76f64641bb Merge "Pass all relevant resolver info to netd" 2018-03-23 23:41:11 +00:00
Erik Kline
e5dac904d3 Pass all relevant resolver info to netd
Test: runtest frameworks-net passes
Test: manual testing of opportunistic and strict mode works
Bug: 34953048
Bug: 64133961
Bug: 72345192
Change-Id: Ia4f1905e1fa60e7a468c2246fb809191d2ba796b
2018-03-22 23:50:13 -07:00
Remi NGUYEN VAN
088ff6824f Add method to NetworkStatsService for UID stats.
Useful for clients such as BatteryStats which currently rely
on NetworkStatsFactory. Data at that stage is incomplete as
it does not account for tethering, VT data and corresponding
464xlat corrections.

Test: runtest frameworks-net, CTS tests pass.
Change-Id: I763b77f601c827fd2963204694fb5b45425cc791
2018-03-22 15:31:28 +09:00
Andreas Gampe
bd12b4476b Frameworks: Fix Binder.joinThreadPool
Fix the lack of a native implementation.

(cherry picked from commit acd1987950)

Bug: 75254055
Bug: 75291614
Test: atest BinderTest
Merged-In: Id5b15442a59851e566a24d406a7487f9de66d42f
Change-Id: Id5b15442a59851e566a24d406a7487f9de66d42f
2018-03-19 20:38:52 -07:00
Andreas Gampe
7074e6fd4c Frameworks: Handle exceptions in SystemProperties callbacks
When notifying callbacks, catch thrown exceptions.

Bug: 73058952
Test: m
Test: atest SystemPropertiesTest
Change-Id: I1c61e11b833e8ddd30d80b9859b20a9fb3185a33
2018-03-19 08:36:11 -07:00
Pete Gillin
121eb58ab4 Merge "Add new 'explicit GC' policy to StrictMode." 2018-03-08 10:55:00 +00:00
Treehugger Robot
4b0172bcb6 Merge "Obtain cellular related battery statistics" 2018-03-06 18:19:20 +00:00
Pete Gillin
cc5885f92b Add new 'explicit GC' policy to StrictMode.
This change adds the policy but offers no public way to enable it. A
follow-up change will expose the detect/permit methods in the API and
change detectAll to enable it.

This new policy can only be triggered through the libcore BlockGuard API.

Bug: 3400644
Test: cts-tradefed run cts-dev -m CtsLibcoreTestCases
Test: cts-tradefed run cts-dev -m CtsOsTestCases
Change-Id: I2e7f34ce010c78d6a5a7ac85512c045bfb13d204
Merged-In: Ieebe4db747902246968d6382bbc9cee0e539af85
2018-03-06 11:17:07 +00:00
David Pursell
c16b77558f MessageQueue: explicitly remove FD event listeners.
When removing an FD listener from a MessageQueue, the MessageQueue waits
until the next event callback on that FD to remove it from the
underlying native Looper.

This works as expected most of the time, but due to the epoll rebuild
logic in the native Looper, there is a rare condition where FDs can get
stuck in the Looper:
  1. Register two or more FD listeners.
  2. Unregister FD1 listener and close FD1.
  3. Before the Looper processes FD1, get an event on FD2 and close it.
(3) will trigger a rebuild of the epoll set but as FD1 is no longer
valid it cannot be added back to the epoll set, and the MessageQueue
will never get the final callback to clean it up.

Each time this happens:
 * There is a small memory leak (24-32 bytes) in native Looper
 * Rebuilding the epoll set incurs slightly more processing
 * An error is logged for each lost FD on each epoll rebuild
This is fairly minimal, and does get cleaned up if the lost FDs is
re-opened during an epoll rebuild (since it can now be added back in),
but worst-case if a process somehow triggers this on a large number of
FDs it might be noticeable.

It seems worth it to just remove the FD explicitly right away to avoid
this case altogether.

Bug: 64083817
Test: [aosp_x86-userdebug emulator] adb shell am instrument -w \
    -e class android.os.cts.MessageQueueTest \
    android.os.cts/android.support.test.runner.AndroidJUnitRunner

Change-Id: I33faca37678439f4b28a4138efcdd80ea8952ab2
2018-03-05 23:45:49 +00:00
Siddharth Ray
073f5de149 Obtain cellular related battery statistics
API to obtain cellular battery stats for power
drain diagnostics.

Test: Manual

BUG:67647477
Merged-In: Iffdb1471cd55847b6454313c94497ab2cd6533cc
Change-Id: Iffdb1471cd55847b6454313c94497ab2cd6533cc
2018-03-02 20:06:18 +00:00
Lorenzo Colitti
f4b4f4d43b Add DNS_TETHER to the list of UIDs in the framework.
It has been reserved in android_filesystem_config.h since
aosp/245632 in 2016, but was never included in the list of UIDs
in Process.java.

Bug: 29881876
Test: builds, boots
Change-Id: I6d36d7d15634445d992a10087b5ba31b480f9f20
2018-03-01 21:06:11 +09:00
Treehugger Robot
554cfd1f1d Merge "Add Zygote.startChildZygote() to fork a new process that itself is a zygote." 2018-02-17 01:39:54 +00:00
Robert Sesek
d0a190df8a Add Zygote.startChildZygote() to fork a new process that itself is a zygote.
This adds a new --start-child-zygote argument that instructs the main
zygote to create a new child process that will also be a zygote. The
system_server generates a random name in the abstract socket namespace
for it and the child-zygote to communicate over, and that is passed as
an argument to the new process.

A child-zygote bypasses the normal post-fork-child of the zygote process
in order to preserve itself as a zygote. This means not starting the
Binder threadpool nor launching into ActivityThread. Instead, a
child-zygote calls into its own main function. The main function runs a
ZygoteServer select loop, listening on the socket name specified by the
system_server when it was forked.

Unlike the system zygotes, a child-zygote can be killed without bringing
down the system. Killing a child-zygote will not terminate its child
processes, which will be reparented to init for reaping when they
eventually exit.

Bug: 63749735
Test: m (with multi-project commits landed)
Change-Id: I3e7ebbdba498f8fec1d84cdf927dc43a92be4b68
2018-02-16 14:17:41 -05:00
Calin Juravle
ea6c0ffb4a [framework] Extend profile operations to take the profile name
Extend the installd profile interface to take the profile name as
argument. This shifts the responsibility for choosing the names of
profiles for primary apks completely to PackageManager. Each of the
application code paths will get an unique profile name based on their
split name.

All the profile operations will now work on a specific profile name rather
than assuming a default global name.

Also, move dumpProfiles and clearProfiles functionality to the
ArtManagerService so that we can re-use profileName computations easier.

(cherry picked from commit 6ae39fc2e5)

Test: manual (dexopt apps, merge profiles, clear profiles)
      gts GtsAndroidRuntimeManagerHostTestCases
Bug: 30934496

Merged-In: Ie65d45eed7de0844edf4b7af918d7eaa74ec1f2c
Change-Id: Ie65d45eed7de0844edf4b7af918d7eaa74ec1f2c
2018-02-14 08:19:42 -08:00
Calin Juravle
369fbd2983 Implement ArtManager#snapshotProfile API
Complete the implementation of ArtManager#snapshotProfile. The snapshot is
performed by calling the installer and then return to the caller via the
specified callback.

(cherry picked from commit fd9f8ae973)

Bug: 30934496
Test: gts-tradefed -m GtsAndroidRuntimeManagerHostTestCases
Merged-In: I87131487846d91d79a56041445420376b61ca8e7
Change-Id: I87131487846d91d79a56041445420376b61ca8e7
2018-02-14 08:00:56 -08:00
Robert Sesek
5ac8abf9ca Refactor ZygoteProcess to deal in LocalSocketAddress.
Currently ZygoteProcess only uses String names in the RESERVED socket
namespace. This CL reworks the class to use LocalSocketAddress, so that
other socket namespaces can be used to communicate with zygotes.

Bug: 63749735
Test: m (no functional change)
Merged-In: I4146f684bfcd78b16500829d02ff54590a8b48f5
Change-Id: I0113a7189530c2e57c48058df542057e855bae42
2018-02-13 14:23:30 -05:00
Treehugger Robot
5a748e5ee2 Merge "VintfObject: add getTargetFcmVersion" 2018-02-08 20:12:02 +00:00
Yifan Hong
0e5e472b4b VintfObject: add getTargetFcmVersion
Add getTargetFrameworkCompatibilityMatrixVersion that returns
target FCM version in device manifest.

Test: VintfDeviceInfo
Bug: 70993015
Change-Id: Ia6354f85e7fae898444067977fb594febb0112fa
2018-02-07 14:30:43 -08:00
Ruchi Kandoi
dcf4c6dc26 Add UID and Service for Secure Element Application
Bug: 64994044
Test: Boot; Check Service loaded.
Merged-In: I2f48ff204acd29b1a9f6819910aba5f8f3762977
Change-Id: I2f48ff204acd29b1a9f6819910aba5f8f3762977
(cherry picked from commit dfaf4bdd1e7e12caf9bb69c8facc38e879861baf)
2018-01-26 11:11:52 -08:00
Treehugger Robot
572f65fb58 Merge "Use the correct value for Process.WEBVIEW_ZYGOTE_UID." 2018-01-23 18:14:00 +00:00
Robert Sesek
bceb382572 Use the correct value for Process.WEBVIEW_ZYGOTE_UID.
When the libcutils constant was added there a merge conflict, which
caused the AID_WEBVIEW_ZYGOTE value to land with a different value than
the Java-side Process value. Nothing yet uses the Process constant, so
there were no ill effects.

Test: m
Change-Id: I8cc87bce1ddbdcdaf79d85c828d86837e96cce21
2018-01-22 12:29:21 -05:00
Andreas Gampe
571b700fb6 Debug: Add attachJvmtiAgent with classloader
Add classloader support to android.os.Debug.attachJvmtiAgent. For
the original version without a given classloader, look up the
application's main classloader.

Bug: 65016018
Bug: 70901841
Test: m
Test: cts-tradefed run commandAndExit cts-dev
Change-Id: I649b6883e05dc2f75073fe1f978423f6a7b880df
2018-01-18 22:02:53 -08:00