Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base-old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Farzin Kazemzadeh
platform_frameworks_base-old
Commits
82b08385
Commit
82b08385
authored
1 year ago
by
Jean-François Geyelin
Committed by
Gerrit Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "Throw when ScriptC is used on unsupported ABIs" into main
parents
095f7f73
4f585f7c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rs/java/android/renderscript/ScriptC.java
+15
-3
15 additions, 3 deletions
rs/java/android/renderscript/ScriptC.java
with
15 additions
and
3 deletions
rs/java/android/renderscript/ScriptC.java
+
15
−
3
View file @
82b08385
...
...
@@ -101,7 +101,19 @@ public class ScriptC extends Script {
setID
(
id
);
}
private
static
void
throwExceptionIfSDKTooHigh
()
{
private
static
void
throwExceptionIfScriptCUnsupported
()
{
// Checks that this device actually does have an ABI that supports ScriptC.
//
// For an explanation as to why `System.loadLibrary` is used, see discussion at
// https://android-review.googlesource.com/c/platform/frameworks/base/+/2957974/comment/2f908b80_a05292ee
try
{
System
.
loadLibrary
(
"RS"
);
}
catch
(
UnsatisfiedLinkError
e
)
{
String
s
=
"This device does not have an ABI that supports ScriptC."
;
throw
new
UnsupportedOperationException
(
s
);
}
// Throw an exception if the target API is 35 or above
String
message
=
"ScriptC scripts are not supported when targeting an API Level >= 35. Please refer "
+
"to https://developer.android.com/guide/topics/renderscript/migration-guide "
...
...
@@ -113,7 +125,7 @@ public class ScriptC extends Script {
}
private
static
synchronized
long
internalCreate
(
RenderScript
rs
,
Resources
resources
,
int
resourceID
)
{
throwExceptionIfS
DKTooHigh
();
throwExceptionIfS
criptCUnsupported
();
byte
[]
pgm
;
int
pgmLength
;
InputStream
is
=
resources
.
openRawResource
(
resourceID
);
...
...
@@ -150,7 +162,7 @@ public class ScriptC extends Script {
private
static
synchronized
long
internalStringCreate
(
RenderScript
rs
,
String
resName
,
byte
[]
bitcode
)
{
// Log.v(TAG, "Create script for resource = " + resName);
throwExceptionIfS
DKTooHigh
();
throwExceptionIfS
criptCUnsupported
();
return
rs
.
nScriptCCreate
(
resName
,
RenderScript
.
getCachePath
(),
bitcode
,
bitcode
.
length
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment