We provide a way in developer option to opt-in an application to use updated
graphics driver. To make sure we set up the graphics environment correctly, we
need to access the package name of the selected application. This patch
introduces a global property to store the package name.
BUG: 119221883
Test: Build, flash and boot, verify with prototype
Change-Id: I49dfcccf387169c072fb9345f7a50c00fcdb0737
If root is available or the app is debuggable,
check for the following property and use it to load
a rules file instead of the one that comes with ANGLE:
debug.angle.rules
For example:
adb shell setprop debug.angle.rules /data/local/tmp/a4a_rules.json
Bug: 80239516
Test: Manual build, ensure rules behave as expected
Test: cts-tradefed run singleCommand cts -m CtsAngleIntegrationHostTestCases
Change-Id: Ie43c67c078ad962ba12f1046a878f79216660755
This system service will listen to ThermalHAL for throttling events and
take actions accordingly, e.g. shutdown device and/or sending
notification to registered listeners to IThermalSerivce.
Bug: 79443945
Bug: 118510237
Bug: 111086696
Bug: 116541003
Test: Boot and test callback on ThermalHAL 1.1
Test: Boot and test callback on ThermalHAL 2.0
Test: Kill ThermalHAL process
Test: Change device threshold to trigger shutdown
Change-Id: I1f4066c9f1cf9ab46c1738a0a4435802512e4339
* The use of meta-data to specify app preference for ANGLE was
temporary, so remove it.
* Since we no longer plan to allow apps to specify a preference
at all, remove the JNI plumbing.
Bug: 80239516
Test: Manual build, ensure rules are followed
Test: cts-tradefed run singleCommand cts -m CtsAngleIntegrationHostTestCases
Change-Id: If8eb6087ae85bb82eae6625778e1c3a926fe038a
A.K.A: "The thing's hollow — it goes on forever — and — oh my God! —
it's full of TODOs!"
Bug: 117944706
Test: m update-api && m
Change-Id: I0774a0df4f4ea0810a8c5f72a1fbcd4eef5cd09b
MediaStore has long suffered from race conditions around creation
of new media. For example, if developers write raw files before
inserting the MediaStore item, an in-progress media scan might pick
up the file before they could insert it. Conversely, if developers
insert the item before writing the files, backup apps get confused
about the file not existing yet.
In addition, the new storage model in Q means that apps can't write
raw files directly to disk, so they need to insert the MediaStore
item first.
To solve this collection of issues, this CL introduces first-class
APIs for contribution of new "pending" media, which includes hiding
the pending media until explicitly published. Apps can safely
resume pending sessions if they crash and restart, which is useful
when the media item is coming from a flaky network. Apps can also
publish progress information about pending media, such as when a
panorama is taking several seconds to process.
Bug: 115377970
Test: atest MediaProviderTests
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I6adee3c4ad1fb9db94906dd1293caaa1a09c6da0
This allows loading layers for GLES and Vulkan at the
same time by adding a GLES specific setting:
GPU_DEBUG_LAYERS_GLES
which mirrors the existing setting:
GPU_DEBUG_LAYERS
The Vulkan and GLES loaders now scan distinct layer
lists, correcting an issue that would prevent Vulkan
from loading when it failed to find GLES layers.
Bug: 110883880
Test: Load a GLES layer when running ANGLE with Vulkan backend
Test: cts-tradefed run singleCommand cts -m CtsGpuToolsHostTestCases
Change-Id: I370be4ce6fdde9e95989eb1f274add8b5790263e
Reads all thread CPU usage for the current process. This traverses
"/proc/self/task/*/time_in_state" to gather the thread ID and CPU usage
of each child thread. Process name, thread name, and UID are also read from
"/proc" for interpretable data.
Bug: 111534779
Test: Unit test in CpuThreadProcReaderTest
Change-Id: I6c71dde1dfcc9bbb87d95baf0886f9da7a782299
To support teamfooding of the new storage privacy features coming
in Q, we need apps to request new AUDIO/VIDEO/IMAGES permissions, but
most of those apps are prebuilts that won't land updates until
several months in the future.
So add system properties so teamfooders can "force" apps to request
these permissions, making them work on Q builds. Only takes effect
when isolated feature is enabled, and guarded with STOPSHIP to ensure
we remove it.
Here's a typical set of commands to use with this CL:
adb shell setprop persist.fw.force_legacy 1
- or -
adb shell setprop persist.fw.force_audio com.google.android.music
adb shell setprop persist.fw.force_video com.google.android.apps.photos
adb shell setprop persist.fw.force_images com.google.android.apps.photos,com.google.android.apps.messaging
- then -
adb shell setprop persist.sys.isolated_storage 1
adb reboot
Bug: 118504670
Test: manual
Change-Id: I631819648334994255256b6046bb4c8aec07ce3a
PropagateWorkSourceTransactListener intercepts outgoing calls and calls
Binde#setThreadWorkSource.
Also install the listener to system server to propagate the worksource
through binder calls.
Test: manual
Change-Id: I02e88c93eebdf200691dd72b79aa7648f4d85bcb
There are multiple use cases for it:
1) Make it easy for another process to set the worksource. The
worksource can be propagated in a thread local - this is how gmscore and soon
system server works - the worksource can then be set for all binder
calls using
Object transactStarted() {
Binder.setWorkSource(ThreadLocalWorkSourceUid.get());
return null; // No token needed.
}
void transactEnded() {
Binder.setWorkSource(null);
}
This will be used by system process and gmscore.
2) SystemUI team was interested in detecting binder calls done from the
main thread in dogfood/tests. This listener will make it easy to figure
out which thread is used.
Performance impact of transact method:
- With current code: 45ns per call
- With this code: 57ns per call
This is not significant compared to the total binder call time which is
10-100s of microseconds.
Test: unit test
Change-Id: Id0a2f52cba33b390ff83f703284b79471cc80b1c
As part of the storage changes in Q, we're removing the ability for
apps to directly access storage devices like /sdcard/. (Instead,
they'll need to go through ContentResolver.openFileDescriptor() to
gain access.) However, in several places we're returning raw
filesystem paths in the "_data" column. An initial attempt to simply
redact these with "/dev/null" shows that many popular apps are
depending on these paths, and become non-functional.
So we need to somehow return "_data" paths that apps can manually
open. We explored tricks like /proc/self/fd/ and FUSE, but neither
of those are feasible. Instead, we've created a cursor that returns
paths of this form:
/mnt/content/media/audio/12
And we then hook Libcore.os to intercept open() syscalls made by
Java code and redirect these to CR.openFileDescriptor() with Uris
like this:
content://media/audio/12
This appears to be enough to keep most popular apps working! Note
that it doesn't support apps that try opening the returned paths
from native code, which we'll hopefully be solving via direct
developer outreach.
Since this feature is a bit risky, it's guarded with a feature flag
that's disabled by default; a future CL will actually enable it,
offering a simple CL to revert in the case of trouble.
Bug: 111268862, 111960973
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ied15e62b46852aef73725f63d7648da390c4e03e
Instead of maintaining local copy of all appIds and sandboxIds,
StorageManagerService will just get required packages info
from PackageManagerService when an user starts and passes it
to vold.
Bug: 117988901
Test: manual
Change-Id: Ib7411645bd0c5e2801bc998d92fda00bceb9c258
The original Process::readProcFile could only read files smaller than 256 bytes.
This change allows the function to read in larger files. For files smaller than
256 bytes, the added cost is only an extra read call, which returns zero.
Documentation has also been added to Process::readProcFile.
Test: Used in change 5168194
Change-Id: I82f27355276e08f96bdb5fe7da49514a87afb429
UserManager#isAdminUser, UserManager#isPrimaryUser,
UserManager#isGuestUser, and UserManager#isRestrictedProfile
are now exposed as System APIs for SUW. All of them require the
MANAGE_USERS permission.
Bug: 115270753
Test: manual (run setup wizard)
Change-Id: I5b9685d486738c3d5a7f5cfa6748adb6efef91bb
This is disabled by default and leaves time (1 min) for processes to
finish running only if there are processes currently running, otherwise,
it goes into deep doze immediately.
Bug: 79955941
Bug: 109934270
Test: Turn on Battery Saver, enable quick doze feature, turn off screen
also run `atest BatterySaverPolicyTest`
also run `atest com.android.server.DeviceIdleControllerTest`
Change-Id: Iec0c8436134e18debfa4c71a8322a6c9cdb10846
ContentProvider has a getCallingPackage() method, which verifies
the remote package name against the current Binder identity. When a
provider wants to clear that IPC identity, they need to clear both
the Binder state and the ContentProvider.getCallingPackage() state
together, so add methods to facilitate that.
Also fix subtle bug so we don't try translating relative paths.
Bug: 117627072
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ifa3e1f745334abf625fdcc314b308a047c49ce73
In order to load a text file from an APK, it must be present
in the assets folder and be uncompressed. The AssetManager can
find assets from any application, so we point it at ANGLE. We
then pass the file descriptor, offset, and size, down to the loader
so it can parse json from the asset.
Bug: 80239516
Test: Manual build, ensure we can inspect rules from modified APK
Test: cts-tradefed run singleCommand cts -m CtsAngleIntegrationHostTestCases
Change-Id: Ib3ecce34b043753b2894915975b6dd8440154ae2
(cherry-picked from commit cfaa0ba52fcf60578acdd64bc4dc9a00f6e300ed)
This patch adds the ability to load whitelist from updatable graphcis driver
apk. Typically a whitelist is part of the graphics driver apk, and the name is
set by overwriting ro.gfx.driver.whitelist.0
BUG: 117241379
Test: Build, flash and boot, whitelist an app and verify.
Change-Id: Ie36ca0173a90a8e48acaca2979ab64bbf92eeaed
This reverts commit 2653e624dc.
Exempt-From-Owner-Approval: This restores a commit that was already
approved and rolled back for unrelated reasons in frameworks/native.
Test: cts-tradefed run singleCommand cts -m CtsGpuToolsHostTestCases
Test: Chromium starts up
Test: CtsDeqpTestCases:include-filter:dEQP-EGL.*
Test: CtsDeqpTestCases:include-filter:dEQP-GLES2.*
Test: CtsDeqpTestCases:include-filter:dEQP-GLES3.*
Test: CtsDeqpTestCases:include-filter:dEQP-GLES31.*
Bug: 110883880
Bug: 117609555
Change-Id: Iab23a5d598986ba34c0ba62dc78299d022924cd9
When device identifier access was moved from a runtime permission to a
privileged permission device and profile owner access regressed by no longer
requiring consent to access the identifiers. With this change device and
profile owners will still need to have the READ_PHONE_STATE permission to
access identifiers.
Bug: 117611604
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases \
-t com.android.cts.devicepolicy.DeviceOwnerTest#testDeviceOwnerCanGetDeviceIdentifiers
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases \
-t com.android.cts.devicepolicy.ManagedProfileTest#testProfileOwnerCanGetDeviceIdentifiers
Change-Id: Ib2d86440c531eab075d010de183ccfa45c2443e5