summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang Ni <yangni@google.com>2015-04-13 23:10:58 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-13 23:10:58 +0000
commit7591574d8490e0c985a73372607addccb2b0282f (patch)
tree871f168487bccaf6eb2905ecafd4796deea10da9
parentf265bdbfc70411c08b4aa7d17125cf1b5e9b14e8 (diff)
parent07cd641b6f832f939d5cccfe8604c230ddad4257 (diff)
downloadframeworks_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.java6
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;
}