DrmErrorEvent.java revision dc549d60f98d809f626c99de614960409a847054
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_REGISTRATION_FAILED, when failed to register with the service. 49 */ 50 public static final int TYPE_REGISTRATION_FAILED = 2006; 51 /** 52 * TYPE_UNREGISTRATION_FAILED, when failed to unregister with the service. 53 */ 54 public static final int TYPE_UNREGISTRATION_FAILED = 2007; 55 /** 56 * TYPE_RIGHTS_ACQUISITION_FAILED, when failed to acquire the rights information required. 57 */ 58 public static final int TYPE_RIGHTS_ACQUISITION_FAILED = 2008; 59 /** 60 * TYPE_INITIALIZE_FAILED, when failed to load and initialize the available plugins. 61 */ 62 public static final int TYPE_INITIALIZE_FAILED = 2009; 63 /** 64 * TYPE_FINALIZE_FAILED, when failed to unload and finalize the loaded plugins. 65 */ 66 public static final int TYPE_FINALIZE_FAILED = 2010; 67 /** 68 * TYPE_REMOVE_ALL_RIGHTS_FAILED, when failed to remove all the rights objects 69 * associated with all DRM schemes. 70 */ 71 public static final int TYPE_REMOVE_ALL_RIGHTS_FAILED = 2011; 72 /** 73 * TYPE_DRM_INFO_ACQUISITION_FAILED, when failed to get the required information to 74 * communicate with the service. 75 */ 76 public static final int TYPE_DRM_INFO_ACQUISITION_FAILED = 2012; 77 78 /** 79 * constructor to create DrmErrorEvent object with given parameters 80 * 81 * @param uniqueId Unique session identifier 82 * @param type Type of information 83 * @param message Message description 84 */ 85 public DrmErrorEvent(int uniqueId, int type, String message) { 86 super(uniqueId, type, message); 87 } 88} 89 90