DrmEvent.java revision d074e30ce44b9e33da43b67a4515b8986ca72b26
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    private final int mUniqueId;
26    private final int mType;
27    private String mMessage = "";
28
29    /**
30     * constructor for DrmEvent class
31     *
32     * @param uniqueId Unique session identifier
33     * @param type Type of information
34     * @param message Message description
35     */
36    protected DrmEvent(int uniqueId, int type, String message) {
37        mUniqueId = uniqueId;
38        mType = type;
39
40        if (null != message) {
41            mMessage = message;
42        }
43    }
44
45    /**
46     * Returns the Unique Id associated with this object
47     *
48     * @return Unique Id
49     */
50    public int getUniqueId() {
51        return mUniqueId;
52    }
53
54    /**
55     * Returns the Type of information associated with this object
56     *
57     * @return Type of information
58     */
59    public int getType() {
60        return mType;
61    }
62
63    /**
64     * Returns the message description associated with this object
65     *
66     * @return message description
67     */
68    public String getMessage() {
69        return mMessage;
70    }
71}
72
73