DrmErrorEvent.java revision 27b277779c89251f2aafcc7a56db95d264900c9d
1/*
2 * Copyright (C) 2010 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
17package android.drm;
18
19/**
20 * This is an entity class which would be passed to caller in
21 * {@link DrmManagerClient.OnErrorListener#onError(DrmManagerClient, DrmErrorEvent)}
22 *
23 */
24public class DrmErrorEvent extends DrmEvent {
25    /**
26     * TYPE_RIGHTS_NOT_INSTALLED, when something went wrong installing the rights.
27     */
28    public static final int TYPE_RIGHTS_NOT_INSTALLED = 2001;
29    /**
30     * TYPE_RIGHTS_RENEWAL_NOT_ALLOWED, when the server rejects renewal of rights.
31     */
32    public static final int TYPE_RIGHTS_RENEWAL_NOT_ALLOWED = 2002;
33    /**
34     * TYPE_NOT_SUPPORTED, when answer from server can not be handled by the native agent.
35     */
36    public static final int TYPE_NOT_SUPPORTED = 2003;
37    /**
38     * TYPE_OUT_OF_MEMORY, when memory allocation fail during renewal.
39     * Can in the future perhaps be used to trigger garbage collector.
40     */
41    public static final int TYPE_OUT_OF_MEMORY = 2004;
42    /**
43     * TYPE_NO_INTERNET_CONNECTION, when the Internet connection is missing and no attempt
44     * can be made to renew rights.
45     */
46    public static final int TYPE_NO_INTERNET_CONNECTION = 2005;
47    /**
48     * TYPE_PROCESS_DRM_INFO_FAILED, when failed to process DrmInfo.
49     */
50    public static final int TYPE_PROCESS_DRM_INFO_FAILED = 2006;
51    /**
52     * TYPE_REMOVE_ALL_RIGHTS_FAILED, when failed to remove all the rights objects
53     * associated with all DRM schemes.
54     */
55    public static final int TYPE_REMOVE_ALL_RIGHTS_FAILED = 2007;
56    /**
57     * TYPE_ACQUIRE_DRM_INFO_FAILED, when failed to acquire DrmInfo.
58     */
59    public static final int TYPE_ACQUIRE_DRM_INFO_FAILED = 2008;
60
61    /**
62     * constructor to create DrmErrorEvent object with given parameters
63     *
64     * @param uniqueId Unique session identifier
65     * @param type Type of information
66     * @param message Message description
67     */
68    public DrmErrorEvent(int uniqueId, int type, String message) {
69        super(uniqueId, type, message);
70    }
71}
72
73