18b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey/*
28b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * Copyright (C) 2012 The Android Open Source Project
38b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey *
48b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * Licensed under the Apache License, Version 2.0 (the "License");
58b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * you may not use this file except in compliance with the License.
68b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * You may obtain a copy of the License at
78b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey *
88b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey *      http://www.apache.org/licenses/LICENSE-2.0
98b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey *
108b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * Unless required by applicable law or agreed to in writing, software
118b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * distributed under the License is distributed on an "AS IS" BASIS,
128b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * See the License for the specific language governing permissions and
148b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * limitations under the License.
158b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey */
168b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey
178b2c3a14603d163d7564e6f60286995079687690Jeff Sharkeypackage com.android.internal.annotations;
188b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey
198b2c3a14603d163d7564e6f60286995079687690Jeff Sharkeyimport java.lang.annotation.Retention;
208b2c3a14603d163d7564e6f60286995079687690Jeff Sharkeyimport java.lang.annotation.RetentionPolicy;
218b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey
228b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey/**
238b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * Denotes that the class, method or field has its visibility relaxed so
248b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * that unit tests can access it.
258b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * <p/>
268b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * The <code>visibility</code> argument can be used to specific what the original
278b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * visibility should have been if it had not been made public or package-private for testing.
288b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey * The default is to consider the element private.
298b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey */
308b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey@Retention(RetentionPolicy.SOURCE)
318b2c3a14603d163d7564e6f60286995079687690Jeff Sharkeypublic @interface VisibleForTesting {
328b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey    /**
338b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey     * Intended visibility if the element had not been made public or package-private for
348b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey     * testing.
358b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey     */
368b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey    enum Visibility {
378b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey        /** The element should be considered protected. */
388b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey        PROTECTED,
398b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey        /** The element should be considered package-private. */
408b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey        PACKAGE,
418b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey        /** The element should be considered private. */
428b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey        PRIVATE
438b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey    }
448b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey
458b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey    /**
468b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey     * Intended visibility if the element had not been made public or package-private for testing.
478b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey     * If not specified, one should assume the element originally intended to be private.
488b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey     */
498b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey    Visibility visibility() default Visibility.PRIVATE;
508b2c3a14603d163d7564e6f60286995079687690Jeff Sharkey}
51