diff options
| author | Jesse Hall <jessehall@google.com> | 2017-05-08 11:28:01 -0700 |
|---|---|---|
| committer | Jesse Hall <jessehall@google.com> | 2017-05-15 14:08:57 -0700 |
| commit | 0e72f130abb5ac52b8cdafe32ab85c43ac3a3f71 (patch) | |
| tree | 84869b7a39415dd5ef82ca13c66e2df5d2d20ee6 /core/java/android/os/GraphicsEnvironment.java | |
| parent | ba4ac09d23d27f4d27d0c03a605ebfa1ed4b1858 (diff) | |
Require targetSdkVersion>=O for updated graphics driver packages
In O, graphics drivers are loaded into a new restricted linker
namespace. Drivers built for previous versions of the OS may not work
under those restrictions, so require an updated driver package to
declare compatibility by setting targetSdkVersion >= O.
Bug: 34228255
Test: manually construct packages with and without
targetSdkVersion >= O, confirm driver is used/not-used as
expected.
Change-Id: I4518360433a6de5c6e1e792a6eedddf8c6bf4394
Diffstat (limited to 'core/java/android/os/GraphicsEnvironment.java')
| -rw-r--r-- | core/java/android/os/GraphicsEnvironment.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index e4cdbce09796..f9eaba921cc1 100644 --- a/core/java/android/os/GraphicsEnvironment.java +++ b/core/java/android/os/GraphicsEnvironment.java @@ -20,6 +20,7 @@ import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.opengl.EGL14; +import android.os.Build; import android.os.SystemProperties; import android.util.Log; @@ -81,6 +82,12 @@ public final class GraphicsEnvironment { } return; } + if (driverInfo.targetSdkVersion < Build.VERSION_CODES.O) { + // O drivers are restricted to the sphal linker namespace, so don't try to use + // packages unless they declare they're compatible with that restriction. + Log.w(TAG, "updated driver package is not known to be compatible with O"); + return; + } StringBuilder sb = new StringBuilder(); sb.append(driverInfo.nativeLibraryDir) |
