• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.sdklib.internal.repository.packages;
18 
19 import com.android.sdklib.repository.RepoConstants;
20 
21 /**
22  * Interface used to decorate a {@link Package} that has a dependency
23  * on a specific API level, e.g. which XML has a {@code <api-level>} element.
24  * <p/>
25  * For example an add-on package requires a platform with an exact API level to be installed
26  * at the same time.
27  * This is not the same as {@link IMinApiLevelDependency} which requests that a platform with at
28  * least the requested API level be present or installed at the same time.
29  * <p/>
30  * Such package requires the {@code <api-level>} element. It is not an optional
31  * property, however it can be invalid.
32  */
33 public interface IExactApiLevelDependency {
34 
35     /**
36      * The value of {@link #getExactApiLevel()} when the {@link RepoConstants#NODE_API_LEVEL}
37      * was not specified in the XML source.
38      */
39     public static final int API_LEVEL_INVALID = 0;
40 
41     /**
42      * Returns the exact API level required by this package, if > 0,
43      * or {@link #API_LEVEL_INVALID} if the value was missing.
44      * <p/>
45      * This attribute is mandatory and should not be normally missing.
46      * It can only happen when dealing with an invalid repository XML.
47      */
getExactApiLevel()48     public abstract int getExactApiLevel();
49 }
50