1055b4925fb282a029e6058b2d670f4a416df205bTor Norbye/* 2055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * Copyright (C) 2015 The Android Open Source Project 3055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * 4055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * Licensed under the Apache License, Version 2.0 (the "License"); 5055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * you may not use this file except in compliance with the License. 6055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * You may obtain a copy of the License at 7055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * 8055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * http://www.apache.org/licenses/LICENSE-2.0 9055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * 10055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * Unless required by applicable law or agreed to in writing, software 11055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * distributed under the License is distributed on an "AS IS" BASIS, 12055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * See the License for the specific language governing permissions and 14055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * limitations under the License. 15055b4925fb282a029e6058b2d670f4a416df205bTor Norbye */ 16055b4925fb282a029e6058b2d670f4a416df205bTor Norbyepackage android.support.annotation; 17055b4925fb282a029e6058b2d670f4a416df205bTor Norbye 18055b4925fb282a029e6058b2d670f4a416df205bTor Norbyeimport java.lang.annotation.Retention; 19055b4925fb282a029e6058b2d670f4a416df205bTor Norbyeimport java.lang.annotation.Target; 20055b4925fb282a029e6058b2d670f4a416df205bTor Norbye 21055b4925fb282a029e6058b2d670f4a416df205bTor Norbyeimport static java.lang.annotation.ElementType.ANNOTATION_TYPE; 22055b4925fb282a029e6058b2d670f4a416df205bTor Norbyeimport static java.lang.annotation.ElementType.CONSTRUCTOR; 23055b4925fb282a029e6058b2d670f4a416df205bTor Norbyeimport static java.lang.annotation.ElementType.FIELD; 24055b4925fb282a029e6058b2d670f4a416df205bTor Norbyeimport static java.lang.annotation.ElementType.METHOD; 25055b4925fb282a029e6058b2d670f4a416df205bTor Norbyeimport static java.lang.annotation.ElementType.PACKAGE; 26055b4925fb282a029e6058b2d670f4a416df205bTor Norbyeimport static java.lang.annotation.ElementType.TYPE; 27055b4925fb282a029e6058b2d670f4a416df205bTor Norbyeimport static java.lang.annotation.RetentionPolicy.CLASS; 28055b4925fb282a029e6058b2d670f4a416df205bTor Norbye 29055b4925fb282a029e6058b2d670f4a416df205bTor Norbye/** 30055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * Denotes that the annotated element should not be removed when 31055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * the code is minified at build time. This is typically used 32055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * on methods and classes that are accessed only via reflection 33055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * so a compiler may think that the code is unused. 34055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * <p> 35055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * Example: 36055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * <pre>{@code 37055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * @Keep 38055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * public void foo() { 39055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * ... 40055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * } 41055b4925fb282a029e6058b2d670f4a416df205bTor Norbye * }</pre> 42055b4925fb282a029e6058b2d670f4a416df205bTor Norbye */ 43055b4925fb282a029e6058b2d670f4a416df205bTor Norbye@Retention(CLASS) 44055b4925fb282a029e6058b2d670f4a416df205bTor Norbye@Target({PACKAGE,TYPE,ANNOTATION_TYPE,CONSTRUCTOR,METHOD,FIELD}) 45055b4925fb282a029e6058b2d670f4a416df205bTor Norbyepublic @interface Keep { 46055b4925fb282a029e6058b2d670f4a416df205bTor Norbye} 47