• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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.apksig.apk;
18 
19 /**
20  * Indicates that there was an issue determining the minimum Android platform version supported by
21  * an APK because the version is specified as a codename, rather than as API Level number, and the
22  * codename is in an unexpected format.
23  */
24 public class CodenameMinSdkVersionException extends MinSdkVersionException {
25 
26     private static final long serialVersionUID = 1L;
27 
28     /** Encountered codename. */
29     private final String mCodename;
30 
31     /**
32      * Constructs a new {@code MinSdkVersionCodenameException} with the provided message and
33      * codename.
34      */
CodenameMinSdkVersionException(String message, String codename)35     public CodenameMinSdkVersionException(String message, String codename) {
36         super(message);
37         mCodename = codename;
38     }
39 
40     /**
41      * Returns the codename.
42      */
getCodename()43     public String getCodename() {
44         return mCodename;
45     }
46 }
47