Commit Graph

4631 Commits

Author SHA1 Message Date
Bowgo Tsai
3a315ab982 Merge "Disable AVB check in runtime vintf" am: 86c9951383
am: a241b4d488

Change-Id: Icf111bfeedde4a134ac77af935afff096961a852
2017-12-07 10:19:47 +00:00
Treehugger Robot
86c9951383 Merge "Disable AVB check in runtime vintf" 2017-12-07 08:15:35 +00:00
Hans Boehm
9020d22c6d Merge "Ensure that debug builds crash again if there is a BinderProxy leak." am: db122f90d9
am: 4fc1bb0e37

Change-Id: I949a3896f7613fe8bd3d92badba0fea5b3343e39
2017-12-01 15:56:23 +00:00
Hans Boehm
4fc1bb0e37 Merge "Ensure that debug builds crash again if there is a BinderProxy leak."
am: db122f90d9

Change-Id: Ibc470d844139fd2f74434a26d01903c67eb51f86
2017-12-01 15:46:09 +00:00
Hans Boehm
db122f90d9 Merge "Ensure that debug builds crash again if there is a BinderProxy leak." 2017-12-01 15:34:29 +00:00
Bowgo Tsai
78934c9b8b Disable AVB check in runtime vintf
GSI disables AVB by overriding vbmeta partition.
When a device can run runtime vintf checking, it should already
pass AVB, so we don't need to check AVB in runtime vintf.

We cannot change the original VintfObject.verify() because AVB check is
still needed for android.os.RecoverySystem to verify a newly downloaded
OTA package.

Bug: 68016134
Test: Boot with GSI and there is no Android System dialog
Change-Id: Ie1efa6f1abd8fa8f495aededd145c0ab2c0c1fae
Merged-In: Ie1efa6f1abd8fa8f495aededd145c0ab2c0c1fae
2017-12-01 12:09:50 +08:00
Hans Boehm
c79595fefa Ensure that debug builds crash again if there is a BinderProxy leak.
This fails when trying to run the AOSP mailer with CRASH_AT_SIZE = 500,
when the check interval is reduced sufficiently so that the test is
actually executed. System server has been observed to use more than
1000 BinderProxies. Thus 5000 seems like roughly the lowest safe limit.

Note that the test is executed somewhat rarely, so we may exceed
this number by quite a few before we actually crash.

Bug: 65760710
Test: Builds, AOSP boots & works for a few tasks. Fails as expected
with reduced limit.

Change-Id: I1c999b85e1ba1bd1d166a9ffba4f0b3992ffee45
2017-11-30 15:29:11 -08:00
Kevin Hufnagle
fcd96e847f cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java
am: d6ebb55c62

Change-Id: I88bf4c778a04b5f43a7fcd22d4aadb378860bb8a
2017-11-30 19:24:10 +00:00
Kevin Hufnagle
d6ebb55c62 cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java
Added note within getSerial() in android.os.Build class. Device
identifiers, such as hardware serial numbers, can be modified if a
device is rooted. Others can use key attestation to discover these
changes. Added a note to this effect within this method.

Test: make ds-docs -j8

Bug: 38312326
Change-Id: I76e3f6a15b9a8673ca3304218653e8cd26da38d7
Original-Change-Id: Ibd2dab621c14683e12a213957b567ee49b8d00fd
2017-11-29 14:41:05 -08:00
Dianne Hackborn
532c2f8a36 Merge "Add documentation for O and O_MR1 target SDK changes." into oc-mr1-dev
am: b94e697dcf

Change-Id: I40ef78ee243cbb2f5967115e40740a3f36b253ef
2017-11-28 00:50:13 +00:00
Dianne Hackborn
a47d0453d9 Add documentation for O and O_MR1 target SDK changes.
Whoops, forgot to do this!

Bug: 69805350
Test: built and looked
Change-Id: Ic42cbcb7a62e7474c4864d66944452fed2e9005c
2017-11-27 14:08:16 -08:00
Yifan Hong
8cf7761747 Merge "android.os.HidlSupport: add getPidIfSharable() for HALs"
am: e72b6f0d31

Change-Id: I7ea5895cdfd09786732b597be600329a334c1cb4
2017-11-22 23:06:33 +00:00
Yifan Hong
e72b6f0d31 Merge "android.os.HidlSupport: add getPidIfSharable() for HALs" 2017-11-22 22:51:19 +00:00
Yifan Hong
bb0bd00b00 android.os.HidlSupport: add getPidIfSharable() for HALs
... that returns PID of the process for debuggable builds.
This calls into the C++ equivalent of the function.

Test: lshal
Bug: 68992575

Change-Id: Ia177c709c6930510035cff33dc2389441a76351d
2017-11-20 11:51:07 -08:00
Calin Juravle
af657ae978 Merge "Workaround to get passed the broken install flow"
am: b0e6508a5b

Change-Id: Icbad0d985b4d8d3e206ee5e426cdd1f58955aec1
2017-11-17 02:46:57 +00:00
Calin Juravle
b0e6508a5b Merge "Workaround to get passed the broken install flow" 2017-11-17 02:36:29 +00:00
Jakub Pawlowski
b6946d8563 Merge "Add getProfileParentId (1/2)"
am: 7a2c66359a

Change-Id: Iea965e42bb79f939381971e8dd9466b824606ee0
2017-11-17 01:40:05 +00:00
Jeff Sharkey
5f44aa798b Workaround to get passed the broken install flow
For fresh installs the PM does not set the app uid before invoking
dexopt; so we would always get a bogus GID.

This is a temporary workaround which fixes the GID of newly
installed apps to an arbitrary UNKNOWN gid.

Test: adb install
Bug: 64548938
Bug: 69331247

(cherry picked from commit a73e165c2e)

Change-Id: I6438ec8cfca88df813e166f9ef5821e62faf524a
2017-11-17 00:17:21 +00:00
Jakub Pawlowski
0f1f5b7953 Add getProfileParentId (1/2)
Bluetooth service needs to natively access id of parent profile. Add
method exposing it.

Test: cts-tradefed run cts-dev -m DevicePolicyManager --test
com.android.cts.devicepolicy.ManagedProfileTest#testBluetooth
Bug: 69284968
Change-Id: I697906f2959b0736c1d3cc6af7560c27d77ce11b
2017-11-15 15:37:53 -08:00
Koji Fukui
8d36beec24 Merge "Remove AutofillManagerClient after AutofillManager is finalized"
am: dd5384a4fe

Change-Id: If0b092c5e18005fb4b8c1fd8405f4d666c98de5a
2017-11-15 02:35:18 +00:00
Treehugger Robot
dd5384a4fe Merge "Remove AutofillManagerClient after AutofillManager is finalized" 2017-11-15 02:23:27 +00:00
Xin Li
220871a697 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
2017-11-14 12:31:11 -08:00
Jeff Sharkey
7e875df695 Merge "Better, consistent definition of AID_SHARED_GID." 2017-11-14 16:49:30 +00:00
Jeff Sharkey
77a34500fe Better, consistent definition of AID_SHARED_GID.
AID_SHARED_GID is a GID shared by a specific app across all users on
the same device.  Bring the UserHandle and multiuser.c implementations
into agreement, and copy/paste the unit tests that verify that both
behave identically.

Since we might now return "-1" when a GID is invalid, have
ActivityManager handle these cases by quickly swapping in the
always-valid getUserGid().

Test: bit FrameworksCoreTests:android.os.UserHandleTest
Bug: 34151068, 64548938
Change-Id: I0463aba923ae5ce1942666359a394ae6cdb7c1f8
2017-11-09 17:42:29 -07:00
Koji Fukui
ccec6a6ae8 Remove AutofillManagerClient after AutofillManager is finalized
Symptom:
Global reference table overflow happens on system_server.

Root cause:
If a process repeatedly create a context and get AutofillManager
from the context, each BinderProxy of AutofillManagerClient are
registered to AutofillManagerServiceImpl. They aren't removed until
the process is died. BinderProxy consumes global reference and finally
causes crash on system_server.

Solution:
Remove AutofillManagerClient from AutofillManagerServiceImpl after
AutofillManager is finalized.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 68747744
Change-Id: I8b76c5368b54317b8696cac470cc390b36e910e7
2017-11-09 15:44:12 -08:00
Jakub Pawlowski
db62b26ba0 Make ParcelUuid and ParcelFileDescriptor accesible to native Binder (2/2)
Bug: 68359837
Test: compile
Change-Id: I3cec0b5b20dde33be09a5bbc451cd79273c67961
2017-11-09 19:40:03 +00:00
Treehugger Robot
faffb072a4 Merge "Allow to attach jvmti agents from inside of process" 2017-11-06 20:34:34 +00:00
Philip P. Moltmann
fd8ed85adb Allow to attach jvmti agents from inside of process
Test: cts-tradefed run singleCommand cts-dev -m CtsJvmtiAttachingTestCases
Bug: 65016018
Change-Id: I6d445afa288c6fec1d860150159fa05ed63cf517
2017-11-03 10:33:21 -07:00
Charles He
dfe472ecae Merge "TokenWatcher: fix bug in repeated calls to acquire()." 2017-11-02 10:36:01 +00:00
Treehugger Robot
762f27c6a2 Merge "Allow equality checking and hash for HIDL interface proxies." 2017-11-02 03:39:42 +00:00
Yifan Hong
73b6c27a6b Allow equality checking and hash for HIDL interface proxies.
IFoo.Proxy.equals() -> HidlSupport.equals() ->
IHwInterface.asBinder().equals() -> HwRemoteBinder.equals().
IFoo.Stub.equals() -> default Object.equals()

Notice that IHwInterface.asBinder() returns mRemote(of type
HwRemoteBinder) for proxies and itself (of type HwBinder) for stubs.
If IFoo.Stub.asBinder() had not return "this", its equals()
should also be overridden.

Bug: 68727931
Test: hidl_test_java

Change-Id: I916983d7bc739747145e2ebb6830226310fd4980
2017-11-01 18:30:04 -07:00
Narayan Kamath
19541e84b1 Debug: Remove obsolete InstructionCount code.
Support for instruction counting has been removed from ART
and the VMDebug APIs in question throw UnsupportedOperationException
unconditionally.

Test: make

Change-Id: Ibcaa160f755a5708bc6fbef3a783acfc26f0ba90
2017-11-01 13:24:47 +00:00
Charles He
cdef147ac3 TokenWatcher: fix bug in repeated calls to acquire().
The javadoc of TokenWatcher promised to implement repeated calls to
acquire() with the same token as a no-op, but this wasn't the case.

When acquire() is called repeatedly with the same token, its associated
DeathRecipient object is replaced by a new one. The old DeathRecipient
can therefore be destroyed. This is problematic because the finalizer of
this DeathRecipient implementation calls release() on the same token,
resulting in the token being released unexpectedly.

In this CL we properly implement the documented no-op behavior.

Bug: 68368071
Test: (First, cherry-pick to internal master)
Test: cts-tradefed run cts-dev -m OsTest -t android.os.cts.TokenWatcherTest
Test: CTS verifier > Managed provisioning > Device owner tests
      > LockTask UI

Change-Id: Idfad7c88075a510ea1f8527b5a8620121a5dd7bb
2017-11-01 09:43:14 +00:00
Andreas Huber
0eb37e06dc Adds APIs to extract/import arrays of primitive Java types out of/into a HwBlob.
Bug: 68654583
Test: hidl_test_java
Change-Id: I6ec799b423396f9212e4c221e41791adc9086410
2017-10-31 14:22:04 -07:00
Steven Moreland
ec5eb7e23d Reland "HIDL Java getService now the same as C++."
Add getService(retry) for Java for C++ feature parity.

Test: hidl_test_java, boot
Bug: 67981006

Change-Id: I4e6711f8c2d7ad0ef6994ce9c480118320e1bde8
2017-10-31 12:01:23 -07:00
Hans Boehm
29f388fc21 Don't allocate GlobalRefs for BinderProxy
This removes all GlobalRef allocation as part of building BinderProxys.
Previously these were used to map IBinders to the corresponding
Java object, so the Java objects could be reused. We now keep
that mapping at the Java level.

This means we often need to call into Java to look up or allocate
a BinderProxy. But this replaces a prior call to Java to dereference
a WeakReference. The Java custom Java map-to-WeakReference data
structure is probably not terribly efficient, but the original
attachement mechanism did not seem to be either. And this
avoids potentially even more catastrophic issues when the number
of GlobalRefs approaches its limit.

We decrease GC triggering frequency from 200 to 1000 allocated
references. This now only applies to other kinds of JNI References
allocated by Binder.

I saw a maximum bucket size of 16 for the ProxyMap data structure
while briefly exercising a freshly booted device. That occurred
in system_server.

Bug: 65760710

Test: Built and booted master with some debugging output. Looks sane.
Change-Id: I322c4d8e9c8e198586d591580c2cdbb094906677
2017-10-26 13:34:19 -07:00
Hans Boehm
5e5b13f27e Convert Binder & BinderProxy to NativeAllocationRegistry
Change the Java BinderProxy to only contain a single native pointer,
so that we can get by with a single NativeAllocationRegistry
registration. This adds some indirections and a new allocation. But it
marginally reduces the number of (expensive) JNI field lookups from
native code, and the extra allocation involves significantly less
overhead than registering each object twice. This also cleans up the
code a little by avoiding some explicit reference count adjustments.

Change BinderProxy Binder to use NativeAllocationRegistry instead of
finalize().

Change the mObject field in Binder to hold a non-reference-counted
but owning pointer to JavaBBinderHolder. Have JavaBBinderHolder no
longer inherit from RefBase.

Make it clear that neither Binder.mObject, not BinderProxy.mNativeData
can be null. Remove null checks.

Avoid checking for null returns from C++ new. It would throw
anyway, which would cause the process to abort.

Test: Booted master.

Bug: 65760710

Change-Id: I323d4bdc7e25f8c27b847b6fe2c073eac3f2efe5
2017-10-25 17:17:24 -07:00
Dianne Hackborn
8de9566375 Fix issue #64224738: Document return value of IBinder.transact()
Also add appropriate @NonNull and @Nullable annotations.

Test: built

Change-Id: I22de48105ef685baf594cfc004dd3e27e2ba09e9
Merged-In: I22de48105ef685baf594cfc004dd3e27e2ba09e9
(cherry picked from commit 4cd650c008)
2017-10-25 14:21:32 -07:00
Steven Moreland
65d1e549b6 Merge "Revert "HIDL Java getService now the same as C++."" 2017-10-25 04:50:08 +00:00
Steven Moreland
cc9e67c019 Revert "HIDL Java getService now the same as C++."
Appears to be causing problems on 2017 devices.

This reverts commit c1f00f8cd8.

Change-Id: I6c1717a612bfa3fe63f08160a1db652c284f6ba4
2017-10-25 04:46:26 +00:00
Treehugger Robot
0c41ad872f Merge "HIDL Java getService now the same as C++." 2017-10-25 01:53:16 +00:00
Steven Moreland
c1f00f8cd8 HIDL Java getService now the same as C++.
getService: wait for service if it is declared in the manifest
tryGetService: only return if the service is immediately available

Bug: 67981006
Test: hidl_test_java
Change-Id: I4485b84f0fde98851cf5f64d198a8c5410795c8c
2017-10-23 01:23:45 -07:00
Tom Cherry
3fb7276115 Merge "Allow ro. properties to have arbitrary lengths" am: 3851f132d1 am: 9fba6c2fe1
am: 918a29c88d

Change-Id: I29e0ca8d91d29431b498788b548fd48e85d6669b
2017-10-18 19:44:54 +00:00
Tom Cherry
918a29c88d Merge "Allow ro. properties to have arbitrary lengths" am: 3851f132d1
am: 9fba6c2fe1

Change-Id: I17743afca87569e5ef6e17572aec0e8e8e535847
2017-10-18 18:48:55 +00:00
Tom Cherry
9fba6c2fe1 Merge "Allow ro. properties to have arbitrary lengths"
am: 3851f132d1

Change-Id: Ie9c340401786d97e469e283418cffef6fbbbb186
2017-10-18 18:39:42 +00:00
Tom Cherry
38a77c4048 Allow ro. properties to have arbitrary lengths
Bug: 23102347
Bug: 34954705
Test: build
Change-Id: I99b074633c60e95cdd2284bf8a708b9187c1e310
2017-10-18 09:25:17 -07:00
Tom Cherry
3b01d0a09a Merge "Frameworks: Remove warning for SystemProperties.get" am: c589496ce9 am: b72c0626f5
am: 16e676be4b

Change-Id: Ie43c9ec866feba876016c8ceb4c1e5d6222f0a18
2017-10-17 20:04:51 +00:00
Tom Cherry
16e676be4b Merge "Frameworks: Remove warning for SystemProperties.get" am: c589496ce9
am: b72c0626f5

Change-Id: Ib0561d4ce3e027b2021bc6105f0be03ba6fffa99
2017-10-17 19:47:57 +00:00
Tom Cherry
b72c0626f5 Merge "Frameworks: Remove warning for SystemProperties.get"
am: c589496ce9

Change-Id: Ibef1415adec0dac324b0531b7038640c3584fdf1
2017-10-17 19:37:45 +00:00
Tom Cherry
95dd3cef21 Frameworks: Remove warning for SystemProperties.get
We now disallow non-UTF8 property values directly in property_service,
so there is no need for this warning.

This partially reverts 33aea8d40e.

Bug: 63177684
Test: make
Change-Id: I61f49f635c6095013f55b906e00925a8cbd1ea8c
2017-10-17 09:27:23 -07:00