Commit Graph

4615 Commits

Author SHA1 Message Date
Philip P. Moltmann
b567ea9dda Merge "Allow to attach jvmti agents from inside of process" am: faffb072a4
am: 491058e089

Change-Id: Ib636dd1ebcee0bfbd57e12e632137561bb661d3e
2017-11-06 20:58:48 +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
4e701561d3 Merge "TokenWatcher: fix bug in repeated calls to acquire()." am: dfe472ecae
am: c214d506d4

Change-Id: I0760ba5c839af8a9dd4b9161dbbad16eacdb3550
2017-11-02 10:58:30 +00:00
Charles He
dfe472ecae Merge "TokenWatcher: fix bug in repeated calls to acquire()." 2017-11-02 10:36:01 +00:00
Yifan Hong
ddfee6b154 Merge "Allow equality checking and hash for HIDL interface proxies." am: 762f27c6a2
am: 0134fd1577

Change-Id: I9b7b2b45967506469309353eb09c49738805b213
2017-11-02 04:01:07 +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
39343bf215 Merge "Debug: Remove obsolete InstructionCount code." am: f5a8edeaf0
am: 47659c3351

Change-Id: I1d4b929ead3af4ef3f9d28de2a3e905d124e718c
2017-11-01 20:56:50 +00: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
4b5806cea6 Merge "Adds APIs to extract/import arrays of primitive Java types out of/into a HwBlob." am: a546c38130
am: 33569ca480

Change-Id: Ic3048cf4539b112027089726b529e3c0838c40f4
2017-11-01 00:03:34 +00:00
Steven Moreland
be0f18fe3d Merge "Reland "HIDL Java getService now the same as C++."" am: c1616f6820
am: 0c6f0240b2

Change-Id: I35ee525aaa1563cc6d8fde5dac1e38e04803bb38
2017-10-31 23:40:34 +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
1c12235c08 Merge "Don't allocate GlobalRefs for BinderProxy" am: 1455a1d0c0
am: b4210d8160

Change-Id: Ida801a358acab13e8515db98b37165179cf5135a
2017-10-27 17:38:31 +00:00
Hans Boehm
d4fff83a65 Merge "Convert Binder & BinderProxy to NativeAllocationRegistry" am: bd6d3c5743
am: a177c5c9d2

Change-Id: I087b9b3374fc51fa5ded63fbd999f4398f564628
2017-10-27 03:58:59 +00: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
b29739e1c9 Merge "Revert "HIDL Java getService now the same as C++."" am: 65d1e549b6
am: 4868f5311e

Change-Id: I80789cb8e1cf0d49e3f85fffe29a12eb74b7726e
2017-10-25 05:56:47 +00: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
Steven Moreland
fd05e9a075 Merge "HIDL Java getService now the same as C++." am: 0c41ad872f
am: 34b5b69de9

Change-Id: I3d7bd6b7b352093306da5d250b518ca9b7dc0f6b
2017-10-25 02:13:39 +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
Patrik Torstensson
7528452f57 Merge "Incorporate slab reclaimable into meminfo" into oc-mr1-dev
am: 20fb01eb23

Change-Id: Ia6afee63376c98552c3a5a0ee249fa751c3d3603
2017-10-13 07:35:04 +00:00
Patrik Torstensson
20fb01eb23 Merge "Incorporate slab reclaimable into meminfo" into oc-mr1-dev 2017-10-13 01:30:40 +00:00
Robert Benea
5e099800f8 Incorporate slab reclaimable into meminfo
Instead of using the whole slab mem for kernel usage, split the
unreclaimable to kernel and reclaimable to cache (since is freed
under mem. pressure).

Test: tested on gobo
Bug:67753120
Change-Id: I0f5a310bb88603ad7bb28e5398ea57c249c04fc2
2017-10-13 00:41:47 +00:00
Pankaj Kanwar
975c272419 Merge "Cleanup of Cellular/Wifi aggregate statistics" into oc-mr1-dev
am: eb98edfb83

Change-Id: Id45e4e83eadebbe812aa44bdfa5592831813fec9
2017-10-13 00:34:57 +00:00
Pankaj Kanwar
eb98edfb83 Merge "Cleanup of Cellular/Wifi aggregate statistics" into oc-mr1-dev 2017-10-13 00:26:11 +00:00
Siddharth Ray
3c648c4673 Cleanup of Cellular/Wifi aggregate statistics
Cleanup of Cellular/Wifi aggregate statistics in Batterystats dumpsys

Cellular
- Modification of field names to improve clarity
- Removed count "x" values
- Added power values to Rx signal strength
- Added power values to Tx power
- Added "Cellular Sleep time"
- Removed erroneous battery field (This is being fixed in b/67213886,
b/67213967)
- Removed the following fields (Mobile radio active unknown time, Mobile
radio active adjusted time, Signal scanning time)

Wifi
- Modification of field names to improve clarity
- Removed count "x" values
- Added power values to Rx signal strength
- Removed the following field (Wifi on, Wifi running)

BUG:67322291
Change-Id: I9630f154a73c7e3cb4bae4779609302f3674602f
2017-10-11 16:29:53 -07:00
Andreas Gampe
77de886b55 Merge "Parcel: Avoid NPE in finalization" am: b085deece9 am: cb34bdf55c
am: 7934a7f828

Change-Id: I5c2819892170855c4d009261785f9e8d26f9ad5e
2017-10-10 18:01:22 +00:00
Andreas Gampe
7934a7f828 Merge "Parcel: Avoid NPE in finalization" am: b085deece9
am: cb34bdf55c

Change-Id: Idd444cd9dfe78d4200f67a4fe6b3c4fb13767f29
2017-10-10 17:52:50 +00:00
Andreas Gampe
cb34bdf55c Merge "Parcel: Avoid NPE in finalization"
am: b085deece9

Change-Id: I646baf55627a3874a10775846458af5f1dcd5d8c
2017-10-10 17:35:55 +00:00
Andreas Gampe
009b852133 Parcel: Avoid NPE in finalization
Check whether the guard is null to avoid:

 Uncaught exception thrown by finalizer
 java.lang.NullPointerException: Attempt to invoke virtual method 'void dalvik.system.CloseGuard.close()' on a null object reference
      at android.os.ParcelFileDescriptor.closeWithStatus(ParcelFileDescriptor.java:740)
      at android.os.ParcelFileDescriptor.finalize(ParcelFileDescriptor.java:990)
      at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250)
      at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237)
      at java.lang.Daemons$Daemon.run(Daemons.java:103)
      at java.lang.Thread.run(Thread.java:764)

Follow-up to commit da5a3e12f4.

Bug: 7426029
Bug: 10330121
Test: m
Change-Id: I903f1545ab784008727ff23bb95fe182bd95b62a
2017-10-10 08:06:42 -07:00
Mike Ma
8cb8bdf657 Merge "Add AOD metrics in batterystats" into oc-mr1-dev
am: 6204a60c53

Change-Id: Ife567f987a1585cb1108725db6ad63516a8dc67a
2017-10-06 07:17:25 +00:00
Mike Ma
1ce1d3a42c Add AOD metrics in batterystats
Fixes: 64899521
Test: manual - flash build, reset batteryStats, use device > 1 hr
with alternating pattern between screen on/off/AOD. Dump stats, check
all screen related stats look normal, esp. record matches actual time
spent in each screen state. In raw bugreport:
Search "amount discharged" for % discharge;
Search "Screen on/off/doze discharge" for mAh discharge;
Search "time on battery" for up/real time in each state.

Test: Added two unit tests for note AOD screen state

Merged-In: I7193a36751124dd380818b2b665303c0f0d8c984
Change-Id: I51cead7f92abd9e4c620f7dfde393993cdad494e
2017-10-06 00:50:03 +00:00
Jeff Sharkey
187b437818 Merge "Only construct real Throwable objects." into oc-dev am: 0868533760 am: f0278f30da
am: 08415b47b0

Change-Id: I6fac18c8ba18f387b9b864055985b2a6bd12de68
2017-09-28 00:35:12 +00:00
Jeff Sharkey
08415b47b0 Merge "Only construct real Throwable objects." into oc-dev am: 0868533760
am: f0278f30da

Change-Id: Id23ee02fb7cfd4b4ab9782066a085ee000fb8a70
2017-09-28 00:23:50 +00:00
Jeff Sharkey
2c56bb54be Merge "Only construct real Throwable objects." into oc-dev am: 0868533760
am: f0278f30da

Change-Id: I3a7cbb7cad2c9663e4f7aa2e583ef5707cf6bbc2
2017-09-28 00:23:46 +00:00
Jeff Sharkey
f0278f30da Merge "Only construct real Throwable objects." into oc-dev
am: 0868533760

Change-Id: I260dc1d1c903f1c1c2828d68049f9f202daa0869
2017-09-28 00:15:18 +00:00