DrmInfoEvent.java revision f8bf3c46f524b1252bf466a351daaef61afdcecb
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
19import java.util.HashMap;
20
21/**
22 * This is an entity class which would be passed to caller in
23 * {@link DrmManagerClient.OnInfoListener#onInfo(DrmManagerClient, DrmInfoEvent)}
24 *
25 */
26public class DrmInfoEvent extends DrmEvent {
27    /**
28     * TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT, when registration has been already done
29     * by another account ID.
30     */
31    public static final int TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT = 1;
32    /**
33     * TYPE_REMOVE_RIGHTS, when the rights needs to be removed completely.
34     */
35    public static final int TYPE_REMOVE_RIGHTS = 2;
36    /**
37     * TYPE_RIGHTS_INSTALLED, when the rights are downloaded and installed ok.
38     */
39    public static final int TYPE_RIGHTS_INSTALLED = 3;
40    /**
41     * TYPE_WAIT_FOR_RIGHTS, rights object is on it's way to phone,
42     * wait before calling checkRights again.
43     */
44    public static final int TYPE_WAIT_FOR_RIGHTS = 4;
45    /**
46     * TYPE_ACCOUNT_ALREADY_REGISTERED, when registration has been
47     * already done for the given account.
48     */
49    public static final int TYPE_ACCOUNT_ALREADY_REGISTERED = 5;
50    /**
51     * TYPE_RIGHTS_REMOVED, when the rights has been removed.
52     */
53    public static final int TYPE_RIGHTS_REMOVED = 6;
54
55    /**
56     * constructor to create DrmInfoEvent object with given parameters
57     *
58     * @param uniqueId Unique session identifier
59     * @param type Type of the event. It could be one of the types defined above
60     * @param message Message description
61     */
62    public DrmInfoEvent(int uniqueId, int type, String message) {
63        super(uniqueId, type, message);
64    }
65
66    /**
67     * constructor to create DrmInfoEvent object with given parameters
68     *
69     * @param uniqueId Unique session identifier
70     * @param type Type of the event. It could be one of the types defined above
71     * @param message Message description
72     * @param attributes Attributes for extensible information. Could be any
73     * information provided by the plugin
74     */
75    public DrmInfoEvent(int uniqueId, int type, String message,
76                            HashMap<String, Object> attributes) {
77        super(uniqueId, type, message, attributes);
78    }
79}
80
81