DrmErrorEvent.java revision dc549d60f98d809f626c99de614960409a847054
1dc549d60f98d809f626c99de614960409a847054Takeshi Aimi/*
2dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * Copyright (C) 2010 The Android Open Source Project
3dc549d60f98d809f626c99de614960409a847054Takeshi Aimi *
4dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * Licensed under the Apache License, Version 2.0 (the "License");
5dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * you may not use this file except in compliance with the License.
6dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * You may obtain a copy of the License at
7dc549d60f98d809f626c99de614960409a847054Takeshi Aimi *
8dc549d60f98d809f626c99de614960409a847054Takeshi Aimi *      http://www.apache.org/licenses/LICENSE-2.0
9dc549d60f98d809f626c99de614960409a847054Takeshi Aimi *
10dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * Unless required by applicable law or agreed to in writing, software
11dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * distributed under the License is distributed on an "AS IS" BASIS,
12dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * See the License for the specific language governing permissions and
14dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * limitations under the License.
15dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */
16dc549d60f98d809f626c99de614960409a847054Takeshi Aimi
17dc549d60f98d809f626c99de614960409a847054Takeshi Aimipackage android.drm;
18dc549d60f98d809f626c99de614960409a847054Takeshi Aimi
19dc549d60f98d809f626c99de614960409a847054Takeshi Aimi/**
20dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * This is an entity class which would be passed to caller in
21dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * {@link DrmManagerClient.OnErrorListener#onError(DrmManagerClient, DrmErrorEvent)}
22dc549d60f98d809f626c99de614960409a847054Takeshi Aimi *
23dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */
24dc549d60f98d809f626c99de614960409a847054Takeshi Aimipublic class DrmErrorEvent extends DrmEvent {
25dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
26dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_RIGHTS_NOT_INSTALLED, when something went wrong installing the rights.
27dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
28dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_RIGHTS_NOT_INSTALLED = 2001;
29dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
30dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_RIGHTS_RENEWAL_NOT_ALLOWED, when the server rejects renewal of rights.
31dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
32dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_RIGHTS_RENEWAL_NOT_ALLOWED = 2002;
33dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
34dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_NOT_SUPPORTED, when answer from server can not be handled by the native agent.
35dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
36dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_NOT_SUPPORTED = 2003;
37dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
38dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_OUT_OF_MEMORY, when memory allocation fail during renewal.
39dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * Can in the future perhaps be used to trigger garbage collector.
40dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
41dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_OUT_OF_MEMORY = 2004;
42dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
43dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_NO_INTERNET_CONNECTION, when the Internet connection is missing and no attempt
44dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * can be made to renew rights.
45dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
46dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_NO_INTERNET_CONNECTION = 2005;
47dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
48dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_REGISTRATION_FAILED, when failed to register with the service.
49dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
50dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_REGISTRATION_FAILED = 2006;
51dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
52dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_UNREGISTRATION_FAILED, when failed to unregister with the service.
53dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
54dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_UNREGISTRATION_FAILED = 2007;
55dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
56dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_RIGHTS_ACQUISITION_FAILED, when failed to acquire the rights information required.
57dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
58dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_RIGHTS_ACQUISITION_FAILED = 2008;
59dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
60dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_INITIALIZE_FAILED, when failed to load and initialize the available plugins.
61dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
62dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_INITIALIZE_FAILED = 2009;
63dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
64dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_FINALIZE_FAILED, when failed to unload and finalize the loaded plugins.
65dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
66dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_FINALIZE_FAILED = 2010;
67dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
68dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_REMOVE_ALL_RIGHTS_FAILED, when failed to remove all the rights objects
69dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * associated with all DRM schemes.
70dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
71dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_REMOVE_ALL_RIGHTS_FAILED = 2011;
72dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
73dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * TYPE_DRM_INFO_ACQUISITION_FAILED, when failed to get the required information to
74dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * communicate with the service.
75dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
76dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public static final int TYPE_DRM_INFO_ACQUISITION_FAILED = 2012;
77dc549d60f98d809f626c99de614960409a847054Takeshi Aimi
78dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    /**
79dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * constructor to create DrmErrorEvent object with given parameters
80dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     *
81dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * @param uniqueId Unique session identifier
82dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * @param type Type of information
83dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     * @param message Message description
84dc549d60f98d809f626c99de614960409a847054Takeshi Aimi     */
85dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    public DrmErrorEvent(int uniqueId, int type, String message) {
86dc549d60f98d809f626c99de614960409a847054Takeshi Aimi        super(uniqueId, type, message);
87dc549d60f98d809f626c99de614960409a847054Takeshi Aimi    }
88dc549d60f98d809f626c99de614960409a847054Takeshi Aimi}
89dc549d60f98d809f626c99de614960409a847054Takeshi Aimi
90