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 
17 package android.drm;
18 
19 /**
20  * An entity class that wraps the result of a
21  * {@link DrmManagerClient#processDrmInfo(DrmInfo) processDrmInfo()}
22  * transaction between a device and a DRM server.
23  *
24  * In a license acquisition scenario this class holds the rights information in binary form.
25  *
26  */
27 public class ProcessedData {
28     private final byte[] mData;
29     private String mAccountId = "_NO_USER";
30     private String mSubscriptionId = "";
31 
32     /**
33      * Creates a <code>ProcessedData</code> object with the given parameters.
34      *
35      * @param data Rights data.
36      * @param accountId Account ID of the user.
37      */
ProcessedData(byte[] data, String accountId)38     /* package */ ProcessedData(byte[] data, String accountId) {
39         mData = data;
40         mAccountId = accountId;
41     }
42 
43     /**
44      * Creates a <code>ProcessedData</code> object with the given parameters.
45      *
46      * @param data Rights data.
47      * @param accountId Account ID of the user.
48      * @param subscriptionId Subscription ID of the user.
49      */
ProcessedData(byte[] data, String accountId, String subscriptionId)50     /* package */ ProcessedData(byte[] data, String accountId, String subscriptionId) {
51         mData = data;
52         mAccountId = accountId;
53         mSubscriptionId = subscriptionId;
54     }
55 
56     /**
57      * Retrieves the processed data.
58      *
59      * @return The rights data.
60      */
getData()61     public byte[] getData() {
62         return mData;
63     }
64 
65     /**
66      * Retrieves the account ID associated with this object.
67      *
68      * @return The account ID of the user.
69      */
getAccountId()70     public String getAccountId() {
71         return mAccountId;
72     }
73 
74     /**
75      * Returns the subscription ID associated with this object.
76      *
77      * @return The subscription ID of the user.
78      */
getSubscriptionId()79     public String getSubscriptionId() {
80         return mSubscriptionId;
81     }
82 }
83 
84