ISub.aidl revision 8fec2e4414abfbc4e4e20d719e80ba99dc9ceb60
1/*
2 * Copyright (C) 2014 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 com.android.internal.telephony;
18
19import android.app.PendingIntent;
20import android.telephony.SubInfoRecord;
21
22interface ISub {
23    /**
24     * Get the SubInfoRecord according to an index
25     * @param subId The unique SubInfoRecord index in database
26     * @return SubInfoRecord, maybe null
27     */
28    SubInfoRecord getSubInfoUsingSubId(long subId);
29
30    /**
31     * Get the SubInfoRecord according to an IccId
32     * @param iccId the IccId of SIM card
33     * @return SubInfoRecord, maybe null
34     */
35    List<SubInfoRecord> getSubInfoUsingIccId(String iccId);
36
37    /**
38     * Get the SubInfoRecord according to slotId
39     * @param slotId the slot which the SIM is inserted
40     * @return SubInfoRecord, maybe null
41     */
42    List<SubInfoRecord> getSubInfoUsingSlotId(int slotId);
43
44    /**
45     * Get all the SubInfoRecord(s) in subinfo database
46     * @return Array list of all SubInfoRecords in database, include thsoe that were inserted before
47     */
48    List<SubInfoRecord> getAllSubInfoList();
49
50    /**
51     * Get the SubInfoRecord(s) of the currently inserted SIM(s)
52     * @return Array list of currently inserted SubInfoRecord(s)
53     */
54    List<SubInfoRecord> getActiveSubInfoList();
55
56    /**
57     * Get the SUB count of all SUB(s) in subinfo database
58     * @return all SIM count in database, include what was inserted before
59     */
60    int getAllSubInfoCount();
61
62    /**
63     * Get the count of active SUB(s)
64     * @return active SIM count
65     */
66    int getActiveSubInfoCount();
67
68    /**
69     * Add a new SubInfoRecord to subinfo database if needed
70     * @param iccId the IccId of the SIM card
71     * @param slotId the slot which the SIM is inserted
72     * @return the URL of the newly created row or the updated row
73     */
74    int addSubInfoRecord(String iccId, int slotId);
75
76    /**
77     * Set SIM color by simInfo index
78     * @param color the color of the SIM
79     * @param subId the unique SubInfoRecord index in database
80     * @return the number of records updated
81     */
82    int setColor(int color, long subId);
83
84    /**
85     * Set display name by simInfo index
86     * @param displayName the display name of SIM card
87     * @param subId the unique SubInfoRecord index in database
88     * @return the number of records updated
89     */
90    int setDisplayName(String displayName, long subId);
91
92    /**
93     * Set display name by simInfo index with name source
94     * @param displayName the display name of SIM card
95     * @param subId the unique SubInfoRecord index in database
96     * @param nameSource, 0: DEFAULT_SOURCE, 1: SIM_SOURCE, 2: USER_INPUT
97     * @return the number of records updated
98     */
99    int setDisplayNameUsingSrc(String displayName, long subId, long nameSource);
100
101    /**
102     * Set phone number by subId
103     * @param number the phone number of the SIM
104     * @param subId the unique SubInfoRecord index in database
105     * @return the number of records updated
106     */
107    int setDisplayNumber(String number, long subId);
108
109    /**
110     * Set number display format. 0: none, 1: the first four digits, 2: the last four digits
111     * @param format the display format of phone number
112     * @param subId the unique SubInfoRecord index in database
113     * @return the number of records updated
114     */
115    int setDisplayNumberFormat(int format, long subId);
116
117    /**
118     * Set data roaming by simInfo index
119     * @param roaming 0:Don't allow data when roaming, 1:Allow data when roaming
120     * @param subId the unique SubInfoRecord index in database
121     * @return the number of records updated
122     */
123    int setDataRoaming(int roaming, long subId);
124
125    int getSlotId(long subId);
126
127    long[] getSubId(int slotId);
128
129    long getDefaultSubId();
130
131    int clearSubInfo();
132
133    int getPhoneId(long subId);
134
135    /**
136     * Get the default data subscription
137     * @return Id of the data subscription
138     */
139    long getDefaultDataSubId();
140
141    void setDefaultDataSubId(long subId);
142
143    long getDefaultVoiceSubId();
144
145    void setDefaultVoiceSubId(long subId);
146
147    long getDefaultSmsSubId();
148
149    void setDefaultSmsSubId(long subId);
150
151    void clearDefaultsForInactiveSubIds();
152
153    long[] getActiveSubIdList();
154}
155