1 /*
2  * Copyright (C) 2011-2013 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 
18 package com.android.internal.telephony.cdma;
19 
20 /**
21  * CdmaSmsBroadcastConfigInfo defines one configuration of Cdma Broadcast
22  * Message to be received by the ME
23  *
24  * serviceCategory defines a Broadcast message identifier
25  * whose value is 0x0000 - 0xFFFF as defined in C.R1001G 9.3.1 and 9.3.2.
26  * All other values can be treated as empty message ID.
27  *
28  * language defines a language code of Broadcast Message
29  * whose value is 0x00 - 0x07 as defined in C.R1001G 9.2.
30  * All other values can be treated as empty language code.
31  *
32  * selected false means message types specified in serviceCategory
33  * are not accepted, while true means accepted.
34  *
35  */
36 public class CdmaSmsBroadcastConfigInfo {
37     private int mFromServiceCategory;
38     private int mToServiceCategory;
39     private int mLanguage;
40     private boolean mSelected;
41 
42     /**
43      * Initialize the object from rssi and cid.
44      */
CdmaSmsBroadcastConfigInfo(int fromServiceCategory, int toServiceCategory, int language, boolean selected)45     public CdmaSmsBroadcastConfigInfo(int fromServiceCategory, int toServiceCategory,
46             int language, boolean selected) {
47         mFromServiceCategory = fromServiceCategory;
48         mToServiceCategory = toServiceCategory;
49         mLanguage = language;
50         mSelected = selected;
51     }
52 
53     /**
54      * @return the mFromServiceCategory
55      */
getFromServiceCategory()56     public int getFromServiceCategory() {
57         return mFromServiceCategory;
58     }
59 
60     /**
61      * @return the mToServiceCategory
62      */
getToServiceCategory()63     public int getToServiceCategory() {
64         return mToServiceCategory;
65     }
66 
67     /**
68      * @return the mLanguage
69      */
getLanguage()70     public int getLanguage() {
71         return mLanguage;
72     }
73 
74     /**
75      * @return the selected
76      */
isSelected()77     public boolean isSelected() {
78         return mSelected;
79     }
80 
81     @Override
toString()82     public String toString() {
83         return "CdmaSmsBroadcastConfigInfo: Id [" +
84             mFromServiceCategory + ", " + mToServiceCategory + "] " +
85             (isSelected() ? "ENABLED" : "DISABLED");
86     }
87 }
88