diff options
author | Yang Ni <yangni@google.com> | 2015-04-13 23:10:58 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-13 23:10:58 +0000 |
commit | 7591574d8490e0c985a73372607addccb2b0282f (patch) | |
tree | 871f168487bccaf6eb2905ecafd4796deea10da9 | |
parent | f265bdbfc70411c08b4aa7d17125cf1b5e9b14e8 (diff) | |
parent | 07cd641b6f832f939d5cccfe8604c230ddad4257 (diff) | |
download | frameworks_base-7591574d8490e0c985a73372607addccb2b0282f.zip frameworks_base-7591574d8490e0c985a73372607addccb2b0282f.tar.gz frameworks_base-7591574d8490e0c985a73372607addccb2b0282f.tar.bz2 |
am 07cd641b: Merge "Add a name to ScriptGroup2.Builder.create method"
* commit '07cd641b6f832f939d5cccfe8604c230ddad4257':
Add a name to ScriptGroup2.Builder.create method
-rw-r--r-- | rs/java/android/renderscript/ScriptGroup2.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rs/java/android/renderscript/ScriptGroup2.java b/rs/java/android/renderscript/ScriptGroup2.java index 857e9fb..9b92611 100644 --- a/rs/java/android/renderscript/ScriptGroup2.java +++ b/rs/java/android/renderscript/ScriptGroup2.java @@ -412,7 +412,11 @@ public class ScriptGroup2 extends BaseObj { return addInvoke(invoke, args.toArray(), bindingMap); } - public ScriptGroup2 create(Future... outputs) { + public ScriptGroup2 create(String name, Future... outputs) { + if (name == null || name.isEmpty() || name.length() > 100 || + !name.equals(name.replaceAll("[^a-zA-Z0-9-]", "_"))) { + throw new RSIllegalArgumentException("invalid script group name"); + } ScriptGroup2 ret = new ScriptGroup2(mRS, mClosures, mInputs, outputs); return ret; } |