DrmEvent.java revision c7b3ccc564448cb4b918728421f9402bc18278c5
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 the base class which would be used to notify the caller 21 * about any event occurred in DRM framework. 22 * 23 */ 24public class DrmEvent { 25 /** 26 * Constant field signifies that all the rights information associated with 27 * all DRM schemes are removed successfully 28 */ 29 public static final int TYPE_ALL_RIGHTS_REMOVED = 1001; 30 /** 31 * Constant field signifies that given information is processed successfully 32 */ 33 public static final int TYPE_DRM_INFO_PROCESSED = 1002; 34 /** 35 * Constant field signifies that the required information to communicate with 36 * the service is acquired sucessfully 37 */ 38 public static final int TYPE_DRM_INFO_ACQUIRED = 1003; 39 40 public static final String DRM_INFO_STATUS_OBJECT = "drm_info_status_object"; 41 public static final String DRM_INFO_OBJECT = "drm_info_object"; 42 43 private final int mUniqueId; 44 private final int mType; 45 private String mMessage = ""; 46 47 /** 48 * constructor for DrmEvent class 49 * 50 * @param uniqueId Unique session identifier 51 * @param type Type of information 52 * @param message Message description 53 */ 54 protected DrmEvent(int uniqueId, int type, String message) { 55 mUniqueId = uniqueId; 56 mType = type; 57 58 if (null != message) { 59 mMessage = message; 60 } 61 } 62 63 /** 64 * Returns the Unique Id associated with this object 65 * 66 * @return Unique Id 67 */ 68 public int getUniqueId() { 69 return mUniqueId; 70 } 71 72 /** 73 * Returns the Type of information associated with this object 74 * 75 * @return Type of information 76 */ 77 public int getType() { 78 return mType; 79 } 80 81 /** 82 * Returns the message description associated with this object 83 * 84 * @return message description 85 */ 86 public String getMessage() { 87 return mMessage; 88 } 89} 90 91