DrmErrorEvent.java revision f8bf3c46f524b1252bf466a351daaef61afdcecb
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 19f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wangimport java.util.HashMap; 20f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang 21dc549d60f98d809f626c99de614960409a847054Takeshi Aimi/** 22dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * This is an entity class which would be passed to caller in 23dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * {@link DrmManagerClient.OnErrorListener#onError(DrmManagerClient, DrmErrorEvent)} 24dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * 25dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */ 26dc549d60f98d809f626c99de614960409a847054Takeshi Aimipublic class DrmErrorEvent extends DrmEvent { 27dc549d60f98d809f626c99de614960409a847054Takeshi Aimi /** 28dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * TYPE_RIGHTS_NOT_INSTALLED, when something went wrong installing the rights. 29dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */ 30dc549d60f98d809f626c99de614960409a847054Takeshi Aimi public static final int TYPE_RIGHTS_NOT_INSTALLED = 2001; 31dc549d60f98d809f626c99de614960409a847054Takeshi Aimi /** 32dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * TYPE_RIGHTS_RENEWAL_NOT_ALLOWED, when the server rejects renewal of rights. 33dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */ 34dc549d60f98d809f626c99de614960409a847054Takeshi Aimi public static final int TYPE_RIGHTS_RENEWAL_NOT_ALLOWED = 2002; 35dc549d60f98d809f626c99de614960409a847054Takeshi Aimi /** 36dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * TYPE_NOT_SUPPORTED, when answer from server can not be handled by the native agent. 37dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */ 38dc549d60f98d809f626c99de614960409a847054Takeshi Aimi public static final int TYPE_NOT_SUPPORTED = 2003; 39dc549d60f98d809f626c99de614960409a847054Takeshi Aimi /** 40dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * TYPE_OUT_OF_MEMORY, when memory allocation fail during renewal. 41dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * Can in the future perhaps be used to trigger garbage collector. 42dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */ 43dc549d60f98d809f626c99de614960409a847054Takeshi Aimi public static final int TYPE_OUT_OF_MEMORY = 2004; 44dc549d60f98d809f626c99de614960409a847054Takeshi Aimi /** 45dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * TYPE_NO_INTERNET_CONNECTION, when the Internet connection is missing and no attempt 46dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * can be made to renew rights. 47dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */ 48dc549d60f98d809f626c99de614960409a847054Takeshi Aimi public static final int TYPE_NO_INTERNET_CONNECTION = 2005; 49dc549d60f98d809f626c99de614960409a847054Takeshi Aimi /** 50c7b3ccc564448cb4b918728421f9402bc18278c5Takeshi Aimi * TYPE_PROCESS_DRM_INFO_FAILED, when failed to process DrmInfo. 51dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */ 52c7b3ccc564448cb4b918728421f9402bc18278c5Takeshi Aimi public static final int TYPE_PROCESS_DRM_INFO_FAILED = 2006; 53dc549d60f98d809f626c99de614960409a847054Takeshi Aimi /** 54dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * TYPE_REMOVE_ALL_RIGHTS_FAILED, when failed to remove all the rights objects 55dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * associated with all DRM schemes. 56dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */ 57c7b3ccc564448cb4b918728421f9402bc18278c5Takeshi Aimi public static final int TYPE_REMOVE_ALL_RIGHTS_FAILED = 2007; 5827b277779c89251f2aafcc7a56db95d264900c9dGloria Wang /** 5927b277779c89251f2aafcc7a56db95d264900c9dGloria Wang * TYPE_ACQUIRE_DRM_INFO_FAILED, when failed to acquire DrmInfo. 6027b277779c89251f2aafcc7a56db95d264900c9dGloria Wang */ 6127b277779c89251f2aafcc7a56db95d264900c9dGloria Wang public static final int TYPE_ACQUIRE_DRM_INFO_FAILED = 2008; 62dc549d60f98d809f626c99de614960409a847054Takeshi Aimi 63dc549d60f98d809f626c99de614960409a847054Takeshi Aimi /** 64dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * constructor to create DrmErrorEvent object with given parameters 65dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * 66dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * @param uniqueId Unique session identifier 67f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang * @param type Type of the event. It could be one of the types defined above 68dc549d60f98d809f626c99de614960409a847054Takeshi Aimi * @param message Message description 69dc549d60f98d809f626c99de614960409a847054Takeshi Aimi */ 70dc549d60f98d809f626c99de614960409a847054Takeshi Aimi public DrmErrorEvent(int uniqueId, int type, String message) { 71dc549d60f98d809f626c99de614960409a847054Takeshi Aimi super(uniqueId, type, message); 72dc549d60f98d809f626c99de614960409a847054Takeshi Aimi } 73f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang 74f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang /** 75f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang * constructor to create DrmErrorEvent object with given parameters 76f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang * 77f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang * @param uniqueId Unique session identifier 78f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang * @param type Type of the event. It could be one of the types defined above 79f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang * @param message Message description 80f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang * @param attributes Attributes for extensible information. Could be any 81f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang * information provided by the plugin 82f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang */ 83f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang public DrmErrorEvent(int uniqueId, int type, String message, 84f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang HashMap<String, Object> attributes) { 85f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang super(uniqueId, type, message, attributes); 86f8bf3c46f524b1252bf466a351daaef61afdcecbGloria Wang } 87dc549d60f98d809f626c99de614960409a847054Takeshi Aimi} 88dc549d60f98d809f626c99de614960409a847054Takeshi Aimi 89