This is a cherry-pick of 7dc66b31c1.
Bug: 147667830
Change-Id: Ibc26afc5e9e8744839dce7e863d0635788ad9507
Merged-In: Ibc26afc5e9e8744839dce7e863d0635788ad9507
AChoreographer will consume these callbacks in lieu of going through SF
for the callbacks. This is so that DMS can update its view of display
configs before apps receive the refresh rate callback so that apps can
get consistent information.
Bug: 154874011
Test: ChoreographerNativeTest
Test: Manually verify that HWUI is receiving callbacks
Change-Id: I992c247fd16ef414f94a259bbd300bea3e4c9467
We cache the reference to the HAL and use a DeathRecipient to keep track
of whether it's still good.
Adds waitForService and waitForDeclaredService to the ServiceManager
Java implementation because they were missing.
Test: atest LightsManagerTest
Test: atest LightsServiceTest
Bug: 152509747
Bug: 154631113
Bug: 154627432
Bug: 154629168
Change-Id: Ife8471f3a7e47b48bb31015ddf40f1d7fef6240f
Otherwise bionic might still have a pointer into the old content.
(Cherrypick of 07ce3ccc80c26105f2ccfc8c255353274d8b5861.)
Bug: https://issuetracker.google.com/152893281
Test: treehugger
Merged-In: I25e31c5da33e529c750ef6f2e3f36ca62cf4d231
Change-Id: I25e31c5da33e529c750ef6f2e3f36ca62cf4d231
The graphics JNI code is now separate from libandroid_runtime
and it along with HWUI headers are no longer visible to targets
outside the boundary of what is to become the UI mainline module
The exposed headers to targets outside the module are now restriced
to C APIs contained in the apex header directory.
Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: I30d34055b6870dc1039f190a88f4a747cee17300
This change adds the ability to configure the priority, default enable
state, and mutability (previously know as staticness) of an overlay.
Rather than overlays configuring themselves, the system can configure
overlays relative to each other.
An example configuration file looks like:
<config>
<merge path="auto-generated.xml" />
<overlay package="com.example.one" mutable="false"
enabled="true"/>
<overlay package="com.example.two" mutable="false"
enabled="true"/>
<overlay package="com.example.three" enabled="true"/>
</config>
The <overlay> tag configures the overlay while the <merge> tag allows
additional configuration files to be included at a position within
the configuration file.
If the configuration file is not present for a partition, the legacy
android:isStatic and android:priority will continue to configure the
overlays in the partition. Once at least one configuration file has
been defined in any partition, strict partition precedence will be
enforced and overlays on separate partitions will no longer be able
to use android:priority to reorder themselves conversely from the
overlay partition precedence.
The order of the system partitions from least to greatest precedence
is system, vendor, odm, oem, product, system_ext.
Bug: 135048762
Test: atest OverlayConfigTest
Change-Id: If57e8caa9b881f9d424ef48bba80b18cc8b7b943
Once AudioDeviceAddress, then AudioDevice, now AudioDeviceAttributes.
Bug: 148565943
Test: atest AudioServiceHostTest#testAudioDeviceAttributes AudioServiceHostTest#testPreferredDeviceRouting
Change-Id: I17b2b8fc6a5eda6ee1176d6aa27ada3cdd820acc
Update KernelSingleUidTimeReader to read BPF data rather than per-UID
proc files when the BPF data is available. This is implemented by
calling libtimeinstate functions via JNI.
Extend KernelSingleUidTimeReaderTest to exercise both the BPF and proc
file code paths.
Bug: 138317993
Test: KernelSingleUidTimerTest passes
Test: no regression in BatteryStatsTests
Change-Id: Ie962ddd9e30d96aa0fab6104a4164af9ad02f55e
Signed-off-by: Connor O'Brien <connoro@google.com>
Update KernelCpuUidTimeReader and its subclasses to support reading
frequency, active & cluster times from BPF maps rather than proc files
on devices that support this approach. BPF-based accounting offers
improved accuracy as it can detect every context switch, whereas the
proc files attribute a full tick period to whatever happens to be
running when the tick occurs.
Add a KernelCpuUidBpfMapReader class modeled on
KernelCpuProcStringReader, with singletons for reading each distinct
set of data. These follow the locking approach used by
KernelCpuProcStringReader to ensure thread safety, but they collect
data by calling libtimeinstate functions via JNI rather than reading
text from proc files. They also provide a getDataDimensions() function
to retrieve information currently provided by the header rows of the
proc files, such as the list of available freqs or the number of cores
on each cluster.
Extend the KernelCpu*TimeReaderTest classes to exercise the BPF path
for each reader class, and add a KernelCpuUidBpfMapReaderTest modeled
on KernelProcStringReaderTest.
Bug: 138317993
Test: KernelCpu*TimeReaderTests and KernelCpuUidBpfMapReaderTest pass
Test: no regressions in BatteryStatsTests
Change-Id: Ie7c0b11a47289e16f72fd6868de4185e858c7e4f
Signed-off-by: Connor O'Brien <connoro@google.com>
As part of statsd becoming a mainline module in R,
libstats_jni needs to live in the apex.
Bug: 148620413
Test: m
Test: fastboot flashall
Change-Id: I22c2816c863e7a4462a79ac99238b06aca40a2d6
A wrapper still exists at android.view.RenderNode animator
as it needs access to internals of the view that would violate
the package layering if moved into android.graphics.animation.
This CL also moves the Java and cpp files associated with creating
a native interpolator that can be run directly on the RenderThread.
Bug: 149293249
Test: CtsViewTestCases
Change-Id: I5260331fedbd634cf2f6d6d392941e7284527420
Currently, the variables 'clazz' and 'constructor' are not stored properly.
Cache them to make it consistent with all of the other jni code.
This would also prevent a crash in checkjni for using deleted local
reference (it's never made global in the current code).
Bug: 134977432
Test: atest VerifyInputEventTest (run several times)
Change-Id: Icef5271d915fce49b24d987923942fbdc4b6898b
Currently these are command line options for dalvikvm. Exposing them to
system property.
Bug:143848108
Test: flash device; adb shell setprop dalvik.vm.finalizer-timeout-ms
<val>; adb shell stop; adb shell start; adb shell getprop dalvik.vm.finalizer-timeout-ms
Change-Id: I3bd16ea0c4a01b7e400b3e6e67eb47cf7a26afce
The ART runtime no longer runs dex2oat directly, so all
-Xcompiler-options flags are used only by JIT. As such, -Xms
and -Xmx flags are useless, so we do not need to pass them.
When we want to skip compilation, pass -Xnoimage-dex2oat and
do not pass any other -Ximage-compiler-option. Also, since
we no longer relocate to /data (patchoat has been removed),
do not request -Xnorelocate as relocation in memory is OK.
Pass --generate-mini-debug-info if dalvik.vm.minidebuginfo
is set also as -Ximage-compiler-option.
And move the check for /system/etc/boot-image.prof from
AndroidRuntime.cpp to the deprecated GenerateImage() in
art/runtime/gc/space/image_space.cc . If it's not found,
just report the error and compile with the "speed" filter.
Previously we used to set --compiler-filter=speed-profile,
making the dalvik.vm.image-dex2oat-filter useless. Instead
rely on dex2oat using speed-profile or speed as the default.
Test: aosp_taimen-userdebug boots; check zygote args in logcat.
Bug: 119800099
Change-Id: Ie019f00e3b37030920a72b1ad8944a33b8665817
In recent releases, Android has used the GID of files on external
storage to compute quota for various media types. This was implemented
by the kernel sdcard filesystem, which kept a mapping of file
extension->GID, and automatically set the correct GID on the lower
filesystem. We then simply asked the kernel "how much space is used by
the GID corresponding to image files" to determine how much space image
files took up on external storage.
sdcardfs will be removed starting with devices launching with R; this
means that the quota tracking implementation can no longer live in the
kernel on these devices. MediaProvider is a logical place to initiate
the quote handling in userspace, since it is responsible for all files
on external storage.
But since MediaProvider is now a mainline module, we don't want the
quota tracking implementation to live in MediaProvider itself. Instead,
provide a new @SystemAPI on StorageManager that can be called whenever
we need to set the quota type for a file on external storage. This
allows MediaProvider to call this API whenever a file is created on
external storage, or whenever its type is changed such that it requires
using a different quota type (eg going from an image file to an audio
file, which is presumably a rare case).
The API doesn't require a special permission, because the current
implementation is not a binder call, but an in-process call to modify
filesystem attributes. That means that the caller must already be in an
SELinux domain that allows these attribute modifications. Currently,
only MediaProvider and vold are allowed to modify these attributes.
Therefore, this API is effectively protected by SELinux.
Bug: 146419093
Test: builds. Functionality will be tested with existing
StorageHostTest CTS test, but running that tests depends on other
changes (eg a device without sdcardfs). This is tracked in the
test plan for removing sdcardfs.
Change-Id: I9ffb11a89b17e5596fce70e96c06a8af2142e41f
Re-add StatsLog JNI regsitration in AndroidRuntime.cpp.
This will have to be revisited once StatsLog is moved into statsd apex.
Test: m
Test: fastboot flashall
Test: adb logcat "*:E"
Change-Id: I233a527d00d524cbc2edaed7c2be76ea1c212b29
Add the delay to save the resolved classes as a system property and pass
it down to the runtime
Test: build and check profile saver activity
Bug: 141487932
Change-Id: I17278505e29295d3ecfe1e1e782da11f5356ebfd
This cl creates libstats_jni, puts the android_util_StatsLog class in it
to implement the jni StatsLog.writeImpl() call, and puts the library in
the statsd apex.
Right now, it does NOT load the library properly and therefore the
library is still in the platform. It needs to be removed from the
platform.
Test: boots
Test: adb shell cmd stats print-logs shows logs still flow
Bug: 147315667
Change-Id: I0a06b66d4640d00ee75bc273423b33dafc944b05
For testing, this feature can be enabled per-application with
adb shell am compat 135754954 <app.name>
Bug: 135754954
Bug: 147147490
Test: malloc() returns tagged pointer with the feature enabled
Change-Id: I067b4ba6f5fbfcb8287f0cc07d17978dbe708806
The implementation of IIncrementalManager.aidl. TODO to refactor this.
Test: atest service.incremental_test
Change-Id: Ib8c8a9c0e7f0289b4bcd8961fa39746ed12b4310
The API offered by SoundTrigger.java is now implemented on top of
the new soundtrigger_middleware service.
There is no longer any need for JNI - the API now talks directly
with the AIDL interface of the new service.
In the process, some annotations and input validation have been added
to improve the overall quality of this API.
Change-Id: I731ffd5a275b88f38d84dd3daa022a13f97a5ee1
Bug: 142070343
Routing is done per AudioProductStrategy. For instance routing
media is done by using the AudioProductStrategy that supports
the AudioAttributes with USAGE_MEDIA.
Routing is for a connected device, AudioDeviceInfo, or for on a
device that is not currently connected, uniquely specified by
its role, type and address.
Preferred routing can be set, removed, queried (get).
When audioserver crashes, AudioService restores the preferred
routing operating on the audio policy engine.
Bug: 144440677
Test: atest AudioServiceHostTest#PreferredDeviceRoutingTest
Change-Id: I0647608088fe2906e78b71341615975a56747c2f
This service will be extended by custom data loader services.
Hide for now till we update it with latest API.
Test: builds
Change-Id: I72d6a1528019dda5b1de4ca066dbda094d3bb4a3
This allows the use of structural class redefinition on debuggable
apps.
Also allows override of this via the new 'dalvikvm.vm.opaque-jni-ids'
option.
Test: Manual
Test: ./art/tools/jvmti-agents/field-counts/count-fields.py 'Ldalvik/system/ClassExt;.instanceJfieldIDs:Ljava/lang/Object;' 'Ldalvik/system/ClassExt;.staticJfieldIDs:Ljava/lang/Object;' 'Ldalvik/system/ClassExt;.jmethodIDs:Ljava/lang/Object;'
Bug: 134162467
Change-Id: I9e9c7e5a7ff95d62f9969ebeb472e81a7357d7f9
This change adds support for reading/writing a HidlMemory
instance into / out of a HwParcel and HwBlob, in a format that
is compatible with the hidl_memory C++ type.
This paves the way to be able to exchange shared memory blocks
between native and Java via HwBinder, which will be exposed
as adding Java support for the HIDL 'memory' type.
Change-Id: I6cbbf852218c8a631f9014e7caa7a97d17e11889
Bug: 143566068
Merged-In: I6cbbf852218c8a631f9014e7caa7a97d17e11889
This change adds support for reading/writing a HidlMemory
instance into / out of a HwParcel and HwBlob, in a format that
is compatible with the hidl_memory C++ type.
This paves the way to be able to exchange shared memory blocks
between native and Java via HwBinder, which will be exposed
as adding Java support for the HIDL 'memory' type.
Change-Id: I6cbbf852218c8a631f9014e7caa7a97d17e11889
Bug: 143566068
Check dalvik.vm.dex2oat-cpu-set in AndroidRuntime and pass to ART
with "--cpu-set=" as a compiler option, if found.
Check dalvik.vm.image-dex2oat-cpu-set in AndroidRuntime and pass
to ART with "--cpu-set=" as an image compiler option, if found.
Bug: 141446571
Test: manual
Change-Id: Ica6a39048292d3d43aeb58d25f79f1398a7d5a79