diff options
author | Yang Ni <yangni@google.com> | 2015-04-07 19:54:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-07 19:54:31 +0000 |
commit | 922346c0b2b5649c8a3d5798183753ae38406695 (patch) | |
tree | 0d63289505037ddad2743945a987b245bd052c7b /rs/java/android/renderscript | |
parent | b4140e4251d41dde7faac1f3de9baad73feacee5 (diff) | |
parent | 1709856238c61a2103a4827df1786f1d63fcd744 (diff) | |
download | frameworks_base-922346c0b2b5649c8a3d5798183753ae38406695.zip frameworks_base-922346c0b2b5649c8a3d5798183753ae38406695.tar.gz frameworks_base-922346c0b2b5649c8a3d5798183753ae38406695.tar.bz2 |
Merge "Add a name to ScriptGroup2.Builder.create method"
Diffstat (limited to 'rs/java/android/renderscript')
-rw-r--r-- | rs/java/android/renderscript/ScriptGroup2.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rs/java/android/renderscript/ScriptGroup2.java b/rs/java/android/renderscript/ScriptGroup2.java index 8b9f73e..858a957 100644 --- a/rs/java/android/renderscript/ScriptGroup2.java +++ b/rs/java/android/renderscript/ScriptGroup2.java @@ -549,11 +549,17 @@ public class ScriptGroup2 extends BaseObj { /** * Creates a script group * + * @param name name for the script group. Legal names can only contain letters, digits, + * '-', or '_'. The name can be no longer than 100 characters. * @param outputs futures intended as outputs of the script group * @return a script group */ - 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; } |