1774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye/*
2774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * Copyright (C) 2015 The Android Open Source Project
3774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye *
4774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * Licensed under the Apache License, Version 2.0 (the "License");
5774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * you may not use this file except in compliance with the License.
6774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * You may obtain a copy of the License at
7774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye *
8774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye *      http://www.apache.org/licenses/LICENSE-2.0
9774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye *
10774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * Unless required by applicable law or agreed to in writing, software
11774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * distributed under the License is distributed on an "AS IS" BASIS,
12774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * See the License for the specific language governing permissions and
14774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * limitations under the License.
15774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye */
16774c065affaddf66d4bec1126183435f7c663ab0Tor Norbyepackage android.support.annotation;
17774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye
18774c065affaddf66d4bec1126183435f7c663ab0Tor Norbyeimport static java.lang.annotation.ElementType.CONSTRUCTOR;
19774c065affaddf66d4bec1126183435f7c663ab0Tor Norbyeimport static java.lang.annotation.ElementType.METHOD;
20774c065affaddf66d4bec1126183435f7c663ab0Tor Norbyeimport static java.lang.annotation.ElementType.TYPE;
21774c065affaddf66d4bec1126183435f7c663ab0Tor Norbyeimport static java.lang.annotation.RetentionPolicy.CLASS;
22774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye
23bf4b77f1b6bfa3ccf6c4fc8c89f1a1fb563b7a65Aurimas Liutikasimport java.lang.annotation.Documented;
24bf4b77f1b6bfa3ccf6c4fc8c89f1a1fb563b7a65Aurimas Liutikasimport java.lang.annotation.Retention;
25bf4b77f1b6bfa3ccf6c4fc8c89f1a1fb563b7a65Aurimas Liutikasimport java.lang.annotation.Target;
26bf4b77f1b6bfa3ccf6c4fc8c89f1a1fb563b7a65Aurimas Liutikas
27774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye/**
28774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * Denotes that the annotated method should only be called on the binder thread.
29774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * If the annotated element is a class, then all methods in the class should be called
30774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * on the binder thread.
31774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * <p>
32774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye * Example:
33385cccb8927b54284505b0bfdadb95e157cbdfd2Neil Fuller * <pre><code>
34385cccb8927b54284505b0bfdadb95e157cbdfd2Neil Fuller *  &#64;BinderThread
35774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye *  public BeamShareData createBeamShareData() { ... }
36385cccb8927b54284505b0bfdadb95e157cbdfd2Neil Fuller * </code></pre>
37774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye */
38c8d78f1623ec828ad2e0bce452e45d207f029d08Tor Norbye@Documented
39774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye@Retention(CLASS)
40774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye@Target({METHOD,CONSTRUCTOR,TYPE})
41774c065affaddf66d4bec1126183435f7c663ab0Tor Norbyepublic @interface BinderThread {
42774c065affaddf66d4bec1126183435f7c663ab0Tor Norbye}