summaryrefslogtreecommitdiff
path: root/core/java/android/os/GraphicsEnvironment.java
Commit message (Collapse)AuthorAgeFilesLines
* fwb : Silence some AOSP logspamGeorge Zacharia2022-10-261-1/+1
| | | | Change-Id: I967c9bec0fde47fc1da24f498cbabde2a7a5aa9f
* Add Vulkan 1.2 and 1.3 to getVulkanVersion()Trevor David Black2022-04-211-0/+10
| | | | | | Bug: 191881132 Test: build Change-Id: I73d18850180f2d7a627fb3879e4653d0e470d6fb
* Add loading boost intervention for games.jimblackler2022-03-311-0/+7
| | | | | | Bug: 207845905 Test: atest com.android.server.app.GameManagerServiceTests Change-Id: I2d0b4988797fe21bd7aec6d5351273757ae1a3ce
* Introduce new game mode config xml resource fileXiang Wang2022-02-011-1/+1
| | | | | | | | | | If the new resource file parser fail to parse the boolean values from the resource file due to tag not found in manifest or missing file, the existing metadata values will be used to populate pre-existing flags Bug: 214448560 Test: atest GameManagerTest Change-Id: I1543a1bb84379a2e9322a65d41e44fa6014821b9
* ANGLE: Global.Settings should override GameManagerServiceTim Van Patten2021-12-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | If ANGLE is enabled by the Game Dashboard (GameManagerService), but the user has specified the native driver should be loaded, GraphicsEnvironment::shouldUseAngle() will still return 'true' and ANGLE will be loaded. This CL updates GraphicsEnvironment::shouldUseAngle() to not return true if the user has forced the native driver. This CL also updates GameManagerService to allow config values that only specify 'useAngle', rather than requiring 'downscaleFactor' also. Tested with the following adb commands: 1.) Enable ANGLE via DeviceConfig for Angry Birds 2: adb shell device_config put game_overlay com.rovio.baba mode=3,downscaleFactor=0.7,useAngle=true 2.) Force the native driver: adb shell settings put global angle_gl_driver_selection_pkgs com.rovio.baba adb shell settings put global angle_gl_driver_selection_values native Test: adb commands Test: atest CtsAngleIntegrationHostTestCases Bug: b/209519090 Change-Id: Ic1fb867129e0707a38470250d333fcbf486cab76
* Merge "Correctly call setGpuStats() for ANGLE/system driver" am: c6d9eda8c0 ↵Tim Van Patten2021-12-081-4/+17
|\ | | | | | | | | | | | | | | am: 4d3d322f09 am: f47bb4c73e am: 78fadbe415 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1906687 Change-Id: I8625045b4bc0ea3aa8604a769a16418467642c58
| * Merge "Correctly call setGpuStats() for ANGLE/system driver" am: c6d9eda8c0Tim Van Patten2021-12-081-4/+17
| |\ | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1906687 Change-Id: I93a7c79612c189198ef1200d471b685c35664694
| | * Correctly call setGpuStats() for ANGLE/system driverTim Van Patten2021-12-011-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In GraphicsEnvironment, correctly indicate if the loaded driver is ANGLE or the system driver. This allows the 'dumpsys gpu' command to have the correct value in the angleInUse field. Bug: b/154955572 Test: adb shell dumpsys gpu Test: atest CtsAngleIntegrationHostTestCases Change-Id: I6db466b796e216367b0a220e432067b9ae6f485b
| * | Enable ANGLE as a Game Dashboard InterventionTim Van Patten2021-08-311-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable ANGLE as a Game Dashboard intervention via Phenotype. Bug: b/188475576 Test: GameManagerServiceTests Change-Id: I91894a76b8dcf7a97244cff679a501001734f671 Merged-In: I91894a76b8dcf7a97244cff679a501001734f671 (cherry picked from commit acf3851b8fa242a986ca54f3e3508a273a638d48)
| * | Remove support: libfeature_support_angle.soTim Van Patten2021-08-241-145/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Remove support for ANGLE's libfeature_support_angle.so. This also removes all of the logic related to checking the rules file, since libfeature_support_angle.so is what parsed the JSON rules file. Bug: b/187342779 Bug: b/184757175 Test: make and manual verification ANGLE is loaded Change-Id: I02ac083fb8144465b60ac0ed2738c73b31addda1 Merged-In: I02ac083fb8144465b60ac0ed2738c73b31addda1
* | Enable ANGLE as a Game Dashboard InterventionTim Van Patten2021-07-141-9/+36
| | | | | | | | | | | | | | | | Enable ANGLE as a Game Dashboard intervention via Phenotype. Bug: b/188475576 Test: GameManagerServiceTests Change-Id: I91894a76b8dcf7a97244cff679a501001734f671
* | Remove support: libfeature_support_angle.soTim Van Patten2021-06-231-145/+8
|/ | | | | | | | | | | Remove support for ANGLE's libfeature_support_angle.so. This also removes all of the logic related to checking the rules file, since libfeature_support_angle.so is what parsed the JSON rules file. Bug: 187342779 Test: make and manual verification ANGLE is loaded Change-Id: I02ac083fb8144465b60ac0ed2738c73b31addda1
* [GraphicsEnvironment] Remove unnecessary prefix.Peiyong Lin2020-10-151-10/+10
| | | | | | | | ANGLE global settings variables have an unnecessary prefix, remove it. Bug: b/170982184 Test: atest CtsAngleIntegrationHostTestCases Change-Id: Id98e69820c90ede16cec8e798c0c77200b951966
* Merge "Add global settings variables for ANGLE debug."Peiyong Lin2020-09-301-35/+58
|\
| * Add global settings variables for ANGLE debug.Peiyong Lin2020-09-281-35/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduce angle.egl.features to assist ANGLE debugging. The input contains lists for each opt-in apps. The format is each list of features is separated by a comma, each feature in each list is separated by a colon, e.g. feature1:feature2:feature3,feature1:feature3:feature5 Bug: b/169156341 Test: use adb shell command to verify Test: atest android.gputools.cts.CtsRootlessGpuDebugHostTest Test: atest CtsAngleIntegrationHostTestCases Change-Id: I752047df1c2567b4ebf900c3acb4a965e35dd6c2
* | [GraphicsEnvironment] Avoid null access.Peiyong Lin2020-09-281-0/+1
|/ | | | | | | | | | | Currently when debug layer apk is not installed, GraphicsEnvironment logs the message and proceeds, which results in null pointer access crash when later trying to access primaryAbi. Avoid null access by an early return statement. Bug: N/A Test: specify not installed debug layer apk and no crash Change-Id: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff
* [GraphicsEnvironment] Minor polish.Peiyong Lin2020-09-251-112/+115
| | | | | | | | | | Log more information to assist debugging without having to rebuild the system image. Adjust ANGLE related properties. Bug: b/169156341 Test: atest android.gputools.cts.CtsRootlessGpuDebugHostTest Test: atest CtsAngleIntegrationHostTestCases Change-Id: I30b0056d42d30ccadc72fd642068c3aa66592a5c
* Rename driver build time manifest flag.Peiyong Lin2020-08-181-4/+5
| | | | | | | | | The driver apk is an implication of updatable, hence the word updatable is redundant. Bug: b/164449016 Test: build Change-Id: Ia9477ed9277e20540f79e94e7229dc3760025eb8
* Rename game driver to updatable driver.Peiyong Lin2020-08-141-48/+55
| | | | | | | | | Game driver is considered a production name. We should use the term updatable driver instead of the production name. Bug: b/164449016 Test: build Change-Id: I787f97b4801dcc7b5ec2acd569a7ce284c9a1f18
* Use more inclusive terms.Peiyong Lin2020-07-291-1/+1
| | | | | | BUG: b/162288333 Test: N/A Change-Id: Icd58adb5eb19395548f20bd9349639e84a0cce88
* Use more inclusive terms inside GraphicsEnvironment.Peiyong Lin2020-07-271-24/+24
| | | | | | Bug: b/162288333 Test: N/A Change-Id: I2f1f13a892be0c8ff3f89e0ceabe39058390727d
* Allow to load implicit layer from /vendor/app.Peiyong Lin2020-06-031-76/+90
| | | | | | | | | | | | | | | Currently when loading implicit layers from apks, NativeLoaderNamespace doesn't allow to dlopen the binaries if they come from apks from /vendor/app. Implicit layers ship within /vendor/app should work like other implicit layers. This patch extracts the construction of library paths of the implicit layers and includes those paths when NativeLoaderNamespace is created as the part of the permitted library paths. Bug: b/157832445 Test: atest android.gputools.cts.CtsRootlessGpuDebugHostTest Test: setup debug layer and use adb logcat to check vulkan loader output Change-Id: Ie2ca989bcab890578b5aa540d07f2aee2a0182bd
* GraphicsEnv: refactor to unify the debuggable logicYiwei Zhang2019-11-081-19/+6
| | | | | | | | | | | | | | | | | | | By default, PR_SET_DUMPABLE is 0 for zygote spawned apps, except in the following circumstances: 1. ro.debuggable=1 (global debuggable enabled, i.e., userdebug or eng builds). 2. android:debuggable="true" in the manifest for an individual application. 3. An app which explicitly calls prctl(PR_SET_DUMPABLE, 1). 4. GraphicsEnv calls prctl(PR_SET_DUMPABLE, 1) in the presence of <meta-data android:name="com.android.graphics.injectLayers.enable" android:value="true"/> in the application manifest. So checking both ro.debuggable=1 and PR_GET_DUMPABLE is redundant. Bug: 144186877 Test: CtsAngleIntegrationHostTestCases Test: CtsRootlessGpuDebugHostTest Change-Id: Ica49254df2c7c090808411935cdeb8efd4e3cb51
* Allow injecting layers by manifest metadataAdam Bodnar2019-10-081-19/+37
| | | | | | | | | | Bug: 138204026 Test: Add <meta-data android:name="com.android.graphics.injectLayers.enable" android:value="true" /> to the <application> xml in the manifest of the RELEASE build of a GL/Vk app. Add layer(s) using the method described here: https://developer.android.com/ndk/guides/graphics/validation-layer Change-Id: If4809c139f4a667ddf125358274a6d1d030a57d8
* Add manifest flag to enable prerelease driver.Peiyong Lin2019-08-221-5/+21
| | | | | | | | | | Add manifest flag to prevent applications from using prerelease driver accidentally. In this patch we also allow any debuggable device build to load prerelease driver for all non-system and non-privileged applications. BUG: 138132808 Test: Verified with prerelease driver. Change-Id: If0abc89f709c8e34bd83a5c09c3c2047300b5ef2
* Merge "Game Driver: Process sphal libraries in GraphicsEnvironment" into qt-devTreeHugger Robot2019-06-141-4/+27
|\
| * Game Driver: Process sphal libraries in GraphicsEnvironmentYiwei Zhang2019-06-131-4/+27
| | | | | | | | | | | | | | | | | | | | | | Previously, there's only one Game Driver existed in the system, so we process sphal libraries in GPU service to save the launch time for loading Game Driver. Now we need to support a separate prerelease driver, so we have to move the processing back to app launch time. Bug: 134881329 Test: Manual test with prerelease driver and Settings UI. Change-Id: Ic1bb412a6a026c68f55243c906bd56fe1fee44c3
* | Game Driver: add support to apply prerelease driver for all appsYiwei Zhang2019-06-121-12/+18
| | | | | | | | | | | | Bug: 134881329 Test: Manual test with prerelease driver and Settings UI. Change-Id: I5f198b0845e9e6431066d44ef623f62e1f5c588a
* | Game Driver: Add support for prerelease channelYiwei Zhang2019-06-121-65/+89
|/ | | | | | Bug: 134881329 Test: Manual test with prerelease driver. Change-Id: I4865bbf0126df9c470aa7f1c163910eb58fb1a8b
* GraphicsEnvironment: No debug ANGLE packages for profileable appsCody Northrop2019-05-281-2/+1
| | | | | | | | | An app opting in to "profileable" does not mean we should allow it to load ANGLE libraries from the debug package. Bug: 128637647 Test: atest CtsGpuToolsHostTestCases Change-Id: I5c6ea33a1e1624e006bc4865bc0a06ea92d9d806
* Revert "GraphicsEnvironment: Allow profileable apps to load layers"Cody Northrop2019-05-281-9/+2
| | | | | | | | | | | | | This reverts commit 3832aa99061e737ed8bd91b5a0b7388a0ec855b3. Loading layers for apps that have opted for "profileable" breaks the Android security model. They have only consented to exposing profiling information, not exposing data under its control. Layers have access to everything in the API calls. Bug: 128637647 Test: atest CtsGpuToolsHostTestCases Change-Id: I5aed181c3cec616c3ce98a1a30287b30f190ba9b
* Merge "GpuStats: send a hint of activity launch to GraphicsEnvironment" into ↵Yiwei Zhang2019-05-091-0/+6
|\ | | | | | | qt-dev
| * GpuStats: send a hint of activity launch to GraphicsEnvironmentYiwei Zhang2019-05-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USAP preloads the driver in usap pool, and those processes in the pool are not bound with any applications. Previously we send GpuStats based on the completion of driver loading. So with usap enabled, we won't be able to receive stats for system built-in driver. If we send the stats when all the existing stats fields are filled, there will be tons of selinux violations, because those non app processes are trying to send the stats as well. So we end up sending the stats based on the hint of activity launch. Bug: 131866357 Test: dumpsys gpu with enable/disable usap and check the selinux Change-Id: I32fcc15aeba2f2e89ba6dd9deae2c27187d2071e
* | Merge "ANGLE: Reorder debug package check" into qt-devTreeHugger Robot2019-05-081-17/+25
|\ \ | |/ |/|
| * ANGLE: Reorder debug package checkCody Northrop2019-05-061-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As originally coded, debug ANGLE packages could only be used if ANGLE was properly installed, such that a single answer was received from ANGLE_FOR_ANDROID. Since ANGLE is only required on new Q devices, debug packages could not be loaded on devices that upgraded from P. This CL changes the ordering such that debug packages are detected before checking for propertly installed ANGLE package. Bug: 132076614 Test: Manually test app with and without debug package Test: atest CtsAngleIntegrationHostTestCases Change-Id: I88f0417c7e74c2c20d087f2137eeb78879143ce5
* | GpuStats: Plumb Vulkan api versionYiwei Zhang2019-05-061-3/+20
|/ | | | | | | | | | This change plumbs the advertised Vulkan api version into GraphicsEnv. GLES api version and CPU Vulkan api version will be appended when statd pulls GpuStatsGlobalInfo from GpuStats to save app launch overhead. Bug: 131866357 Test: build, flash and boot Change-Id: I7faa924eccc81499cd4f1fd54803e3a62bd3153a
* Verify Bundle is not null before using itTim Van Patten2019-04-191-3/+11
| | | | | | | | | | | | | It's possible the Bundle has not been initialized when determining if the ANGLE dialog box should be shown, due to how early that check is performed. This change will verify the Bundle is not null before using it and fall back to using the Context if it is. Bug: 130185493 Test: atest CtsAngleIntegrationHostTestCases Test: Enable Toast Message and then atest CtsAngleIntegrationHostTestCases Change-Id: I39f48bdf20616298c66b2bb36082149cb24e908c (cherry picked from commit 5da6a95eab7e80c510cd211e0117d5327ebae55a)
* GraphicsEnvironment: Expose query to determine ANGLE useCody Northrop2019-04-161-36/+51
| | | | | | | | | | | Move the early logic that decides whether ANGLE should be used to a static public function that can be queried elsewhere without setting up the environment further. Bug: 130029351 Test: atest CtsAngleIntegrationHostTestCases Change-Id: I908233d46631ec91dca714bff3f8fd9341160c9e
* Merge "[GraphicsEnvironment] Expose API to query whether an app should use ↵Peiyong Lin2019-04-111-50/+68
|\ | | | | | | game driver." into qt-dev
| * [GraphicsEnvironment] Expose API to query whether an app should use game driver.Peiyong Lin2019-04-101-50/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | Game Driver and ANGLE require to disable graphics driver preloading, which results in app launch time regression. Given that in early stage, only a few applications will use them, we would like to make sure Zygote prefork comes with a preloaded graphics driver, such that applications that don't go through ANGLE or Game Driver can directly use Zygote prefork without having to load the driver. BUG: 130029351 Test: Verify with testing applications. Change-Id: I8097f0f7a908be9967b08afb01dc0ce5ff7b3413
* | GPU Debug Layers: Allow multiple layer appsCody Northrop2019-04-101-5/+10
|/ | | | | | | | | | | | | | This allows applications to specify both a GLES layer app and a Vulkan layer app, so both APIs can be debugged at the same time. To specify multiple debug layer apps, colon separate them just like the layers: adb shell settings put global gpu_debug_layer_app app1:app2:appN Bug: 110883880 Test: atest CtsGpuToolsHostTestCases Change-Id: I5f721b7d9de59577adb6cc03e909ff99ca79d75e
* ANGLE: Allow libs from debug packageCody Northrop2019-03-291-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | Add a new setting that allows a developer to specify where to load ANGLE libraries from, rather than the default location. This is only allowed for apps that are dumpable, i.e. can have libraries injected. That includes debuggable, profileable, and root. To use the new setting: adb shell settings put global angle_debug_package <package> This allows a developer to build an APK directly from Chromium and use it with a production build of Android. It will override pre-installed system packages and updates. Note: Use of ANGLE Developer Options UI will cease to function until the debug package is uninstalled. Bug: 80239516 Test: Apply setting, see new ANGLE used Test: cts-tradefed run singleCommand cts -m CtsAngleIntegrationHostTestCases Change-Id: Ib3b1fb52c0eb669e7ea931959a73aba2bd15bedf
* GraphicsEnvironment: Allow profileable apps to load layersCody Northrop2019-03-261-2/+9
| | | | | | | | | | | | | | | | | | | Apps that allow themselves to be profiled locally are also eligible to load layers, since they are set dumpable. They can opt in by setting the following in AndroidManifest.xml: <!-- App opts-in to being profiled by the shell --> <application> ... <profileable shell=”true”/> </application> Bug: 128637647 Test: atest CtsGpuToolsHostTestCases Test: Modify CtsGpuToolsHostTestCases to use profileable="true" and ensure loading from external works. Change-Id: Ib072d07408c2abd8fee7179fec3a0d28d72d6398
* Game Driver Metrics: update meta data naming for driver build timeYiwei Zhang2019-03-211-2/+2
| | | | | | Bug: 123529932 Test: build, flash and boot. Change-Id: I74719b748d90c6b6a209647e445a082e85629a82
* Add trace points for GraphicsEnvironment setupYiwei Zhang2019-03-181-0/+6
| | | | | | Bug: 126775624 Test: build, flash and boot. Take systrace to verify. Change-Id: I190f84878fb714acb2cf25dfc5d8b546b3bbd67a
* Make the ANGLE Toast Message Updatable via ANGLE APKTim Van Patten2019-03-071-3/+19
| | | | | | | | | | | This change creates an intent that the ANGLE APK will respond to with a string that will be presented within a Toast message to the user when ANGLE is in use for an app. Bug: 127693688 Test: atest CtsAngleIntegrationHostTestCases Test: Verify Toast message contains the updated message. Change-Id: If2ecd4dba96bcfba5511e76d24a5aa5e64c2ea18
* Game Driver: process sphal libraries in GPU serviceYiwei Zhang2019-02-211-3/+10
| | | | | | | | | | | | | This change adds the sphal libraries text file parsing to the GPU service. As the result, when the Game Driver apk is updated, the sphal library list will be read out to the GAME_DRIVER_SPHAL_LIBRARIES settings global property to be used in the graphics environment to extend the current linker namespace. Bug: 124448366 Test: Build, flash and boot. Install the apk to verify settings global. Change-Id: Ifb4007a1fe7269e0a2857fe7badc8642342b1449
* Game Driver: update the format of driver build dateYiwei Zhang2019-02-201-8/+15
| | | | | | | | | | | The string based driver build date has been updated to Unix epoch timestamp based driver build time. This change updates the corresponding apis and throw exceptions when the meta-data timestamp in the game driver apk is not set properly. Bug: 123156461 Test: Build, flash and boot. Verify the GpuService receiver side. Change-Id: Id4fb3ade31fa5944dcb32fedf5ca926b497e82dc
* Start RenderThread earlier to preload Vulkan/EGL driversStan Iliev2019-02-201-20/+0
| | | | | | | | | | | | | This CL should fix application startup regression for Vulkan detected by "Hermetic Startup: EmptyActivity" test. EGL drivers are loaded in a temp thread to leave more time in RenderThread for other work. Loading EGL drivers on the RenderThread may cause a perf regression. Test: Ran cold-dropcache-test test. Bug: 122659224 Bug: 123361175 Change-Id: I8ca818e98fac196a41d079be15594caca5cb1bab
* Game Driver: get driver build date info from Game Driver apkYiwei Zhang2019-02-151-7/+12
| | | | | | | | | | Get the driver build date info from read-only system property ro.gfx.driver.build_date for apps using system built-in driver, while getting the Game Driver build date info from the apk's meta-data. Bug: 123156461 Test: Build, flash and boot. Verify the GpuService receiver side. Change-Id: Ie4acb658c9b1776179e2bb72d0b434dcf0a9a856