1a63f55cf17629426d976830429a7612387532195Rika Brooks/*
2a63f55cf17629426d976830429a7612387532195Rika Brooks * Copyright (C) 2011-2013 The Android Open Source Project
3a63f55cf17629426d976830429a7612387532195Rika Brooks *
4a63f55cf17629426d976830429a7612387532195Rika Brooks * Licensed under the Apache License, Version 2.0 (the "License");
5a63f55cf17629426d976830429a7612387532195Rika Brooks * you may not use this file except in compliance with the License.
6a63f55cf17629426d976830429a7612387532195Rika Brooks * You may obtain a copy of the License at
7a63f55cf17629426d976830429a7612387532195Rika Brooks *
8a63f55cf17629426d976830429a7612387532195Rika Brooks *      http://www.apache.org/licenses/LICENSE-2.0
9a63f55cf17629426d976830429a7612387532195Rika Brooks *
10a63f55cf17629426d976830429a7612387532195Rika Brooks * Unless required by applicable law or agreed to in writing, software
11a63f55cf17629426d976830429a7612387532195Rika Brooks * distributed under the License is distributed on an "AS IS" BASIS,
12a63f55cf17629426d976830429a7612387532195Rika Brooks * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13a63f55cf17629426d976830429a7612387532195Rika Brooks * See the License for the specific language governing permissions and
14a63f55cf17629426d976830429a7612387532195Rika Brooks * limitations under the License.
15a63f55cf17629426d976830429a7612387532195Rika Brooks *
16a63f55cf17629426d976830429a7612387532195Rika Brooks */
17a63f55cf17629426d976830429a7612387532195Rika Brooks
18a63f55cf17629426d976830429a7612387532195Rika Brookspackage com.android.internal.telephony.cdma;
19a63f55cf17629426d976830429a7612387532195Rika Brooks
20a63f55cf17629426d976830429a7612387532195Rika Brooks/**
21a63f55cf17629426d976830429a7612387532195Rika Brooks * CdmaSmsBroadcastConfigInfo defines one configuration of Cdma Broadcast
22a63f55cf17629426d976830429a7612387532195Rika Brooks * Message to be received by the ME
23a63f55cf17629426d976830429a7612387532195Rika Brooks *
24a63f55cf17629426d976830429a7612387532195Rika Brooks * serviceCategory defines a Broadcast message identifier
25a63f55cf17629426d976830429a7612387532195Rika Brooks * whose value is 0x0000 - 0xFFFF as defined in C.R1001G 9.3.1 and 9.3.2.
26a63f55cf17629426d976830429a7612387532195Rika Brooks * All other values can be treated as empty message ID.
27a63f55cf17629426d976830429a7612387532195Rika Brooks *
28a63f55cf17629426d976830429a7612387532195Rika Brooks * language defines a language code of Broadcast Message
29a63f55cf17629426d976830429a7612387532195Rika Brooks * whose value is 0x00 - 0x07 as defined in C.R1001G 9.2.
30a63f55cf17629426d976830429a7612387532195Rika Brooks * All other values can be treated as empty language code.
31a63f55cf17629426d976830429a7612387532195Rika Brooks *
32a63f55cf17629426d976830429a7612387532195Rika Brooks * selected false means message types specified in serviceCategory
33a63f55cf17629426d976830429a7612387532195Rika Brooks * are not accepted, while true means accepted.
34a63f55cf17629426d976830429a7612387532195Rika Brooks *
35a63f55cf17629426d976830429a7612387532195Rika Brooks */
36a63f55cf17629426d976830429a7612387532195Rika Brookspublic class CdmaSmsBroadcastConfigInfo {
37a63f55cf17629426d976830429a7612387532195Rika Brooks    private int mFromServiceCategory;
38a63f55cf17629426d976830429a7612387532195Rika Brooks    private int mToServiceCategory;
39a63f55cf17629426d976830429a7612387532195Rika Brooks    private int mLanguage;
40a63f55cf17629426d976830429a7612387532195Rika Brooks    private boolean mSelected;
41a63f55cf17629426d976830429a7612387532195Rika Brooks
42a63f55cf17629426d976830429a7612387532195Rika Brooks    /**
43a63f55cf17629426d976830429a7612387532195Rika Brooks     * Initialize the object from rssi and cid.
44a63f55cf17629426d976830429a7612387532195Rika Brooks     */
45a63f55cf17629426d976830429a7612387532195Rika Brooks    public CdmaSmsBroadcastConfigInfo(int fromServiceCategory, int toServiceCategory,
46a63f55cf17629426d976830429a7612387532195Rika Brooks            int language, boolean selected) {
47a63f55cf17629426d976830429a7612387532195Rika Brooks        mFromServiceCategory = fromServiceCategory;
48a63f55cf17629426d976830429a7612387532195Rika Brooks        mToServiceCategory = toServiceCategory;
49a63f55cf17629426d976830429a7612387532195Rika Brooks        mLanguage = language;
50a63f55cf17629426d976830429a7612387532195Rika Brooks        mSelected = selected;
51a63f55cf17629426d976830429a7612387532195Rika Brooks    }
52a63f55cf17629426d976830429a7612387532195Rika Brooks
53a63f55cf17629426d976830429a7612387532195Rika Brooks    /**
54a63f55cf17629426d976830429a7612387532195Rika Brooks     * @return the mFromServiceCategory
55a63f55cf17629426d976830429a7612387532195Rika Brooks     */
56a63f55cf17629426d976830429a7612387532195Rika Brooks    public int getFromServiceCategory() {
57a63f55cf17629426d976830429a7612387532195Rika Brooks        return mFromServiceCategory;
58a63f55cf17629426d976830429a7612387532195Rika Brooks    }
59a63f55cf17629426d976830429a7612387532195Rika Brooks
60a63f55cf17629426d976830429a7612387532195Rika Brooks    /**
61a63f55cf17629426d976830429a7612387532195Rika Brooks     * @return the mToServiceCategory
62a63f55cf17629426d976830429a7612387532195Rika Brooks     */
63a63f55cf17629426d976830429a7612387532195Rika Brooks    public int getToServiceCategory() {
64a63f55cf17629426d976830429a7612387532195Rika Brooks        return mToServiceCategory;
65a63f55cf17629426d976830429a7612387532195Rika Brooks    }
66a63f55cf17629426d976830429a7612387532195Rika Brooks
67a63f55cf17629426d976830429a7612387532195Rika Brooks    /**
68a63f55cf17629426d976830429a7612387532195Rika Brooks     * @return the mLanguage
69a63f55cf17629426d976830429a7612387532195Rika Brooks     */
70a63f55cf17629426d976830429a7612387532195Rika Brooks    public int getLanguage() {
71a63f55cf17629426d976830429a7612387532195Rika Brooks        return mLanguage;
72a63f55cf17629426d976830429a7612387532195Rika Brooks    }
73a63f55cf17629426d976830429a7612387532195Rika Brooks
74a63f55cf17629426d976830429a7612387532195Rika Brooks    /**
75a63f55cf17629426d976830429a7612387532195Rika Brooks     * @return the selected
76a63f55cf17629426d976830429a7612387532195Rika Brooks     */
77a63f55cf17629426d976830429a7612387532195Rika Brooks    public boolean isSelected() {
78a63f55cf17629426d976830429a7612387532195Rika Brooks        return mSelected;
79a63f55cf17629426d976830429a7612387532195Rika Brooks    }
80a63f55cf17629426d976830429a7612387532195Rika Brooks
81a63f55cf17629426d976830429a7612387532195Rika Brooks    @Override
82a63f55cf17629426d976830429a7612387532195Rika Brooks    public String toString() {
83a63f55cf17629426d976830429a7612387532195Rika Brooks        return "CdmaSmsBroadcastConfigInfo: Id [" +
84a63f55cf17629426d976830429a7612387532195Rika Brooks            mFromServiceCategory + ", " + mToServiceCategory + "] " +
85a63f55cf17629426d976830429a7612387532195Rika Brooks            (isSelected() ? "ENABLED" : "DISABLED");
86a63f55cf17629426d976830429a7612387532195Rika Brooks    }
87a63f55cf17629426d976830429a7612387532195Rika Brooks}
88