1 /*
2  * Copyright (C) 2013 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 android.media;
18 
19 /**
20  * Base class for MediaDrm exceptions
21  */
22 public class MediaDrmException extends Exception implements MediaDrmThrowable {
MediaDrmException(String detailMessage)23     public MediaDrmException(String detailMessage) {
24         this(detailMessage, 0, 0, 0);
25     }
26 
27     /**
28      * @hide
29      */
MediaDrmException(String message, int vendorError, int oemError, int errorContext)30     public MediaDrmException(String message, int vendorError, int oemError, int errorContext) {
31         super(message);
32         mVendorError = vendorError;
33         mOemError = oemError;
34         mErrorContext = errorContext;
35     }
36 
37     @Override
getVendorError()38     public int getVendorError() {
39         return mVendorError;
40     }
41 
42     @Override
getOemError()43     public int getOemError() {
44         return mOemError;
45     }
46 
47     @Override
getErrorContext()48     public int getErrorContext() {
49         return mErrorContext;
50     }
51 
52     private final int mVendorError, mOemError, mErrorContext;
53 }
54