DrmInfoEvent.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 an entity class which would be passed to caller in
21 * {@link DrmManagerClient.OnInfoListener#onInfo(DrmManagerClient, DrmInfoEvent)}
22 *
23 */
24public class DrmInfoEvent extends DrmEvent {
25    /**
26     * TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT, when registration has been already done
27     * by another account ID.
28     */
29    public static final int TYPE_ALREADY_REGISTERED_BY_ANOTHER_ACCOUNT = 0x0000001;
30    /**
31     * TYPE_REMOVE_RIGHTS, when the rights needs to be removed completely.
32     */
33    public static final int TYPE_REMOVE_RIGHTS = 0x0000002;
34    /**
35     * TYPE_RIGHTS_INSTALLED, when the rights are downloaded and installed ok.
36     */
37    public static final int TYPE_RIGHTS_INSTALLED = 0x0000003;
38    /**
39     * TYPE_RIGHTS_NOT_INSTALLED, when something went wrong installing the rights.
40     */
41    public static final int TYPE_RIGHTS_NOT_INSTALLED = 0x0000004;
42    /**
43     * TYPE_RIGHTS_RENEWAL_NOT_ALLOWED, when the server rejects renewal of rights.
44     */
45    public static final int TYPE_RIGHTS_RENEWAL_NOT_ALLOWED = 0x0000005;
46    /**
47     * TYPE_NOT_SUPPORTED, when answer from server can not be handled by the native agent.
48     */
49    public static final int TYPE_NOT_SUPPORTED = 0x0000006;
50    /**
51     * TYPE_WAIT_FOR_RIGHTS, rights object is on it's way to phone,
52     * wait before calling checkRights again.
53     */
54    public static final int TYPE_WAIT_FOR_RIGHTS = 0x0000007;
55    /**
56     * TYPE_OUT_OF_MEMORY, when memory allocation fail during renewal.
57     * Can in the future perhaps be used to trigger garbage collector.
58     */
59    public static final int TYPE_OUT_OF_MEMORY = 0x0000008;
60    /**
61     * TYPE_NO_INTERNET_CONNECTION, when the Internet connection is missing and no attempt
62     * can be made to renew rights.
63     */
64    public static final int TYPE_NO_INTERNET_CONNECTION = 0x0000009;
65
66    /**
67     * constructor to create DrmInfoEvent object with given parameters
68     *
69     * @param uniqueId Unique session identifier
70     * @param type Type of information
71     * @param message Message description
72     */
73    public DrmInfoEvent(int uniqueId, int type, String message) {
74        super(uniqueId, type, message);
75    }
76}
77
78