PhoneSubInfoProxy.java revision 0e4abef0d7e978d4c3dea5199f451a1c69158d03
1/*
2 * Copyright (C) 2006 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 java.io.FileDescriptor;
20import java.io.PrintWriter;
21
22import android.os.ServiceManager;
23
24
25public class PhoneSubInfoProxy extends IPhoneSubInfo.Stub {
26    private PhoneSubInfo mPhoneSubInfo;
27
28    public PhoneSubInfoProxy(PhoneSubInfo phoneSubInfo) {
29        mPhoneSubInfo = phoneSubInfo;
30        if(ServiceManager.getService("iphonesubinfo") == null) {
31            ServiceManager.addService("iphonesubinfo", this);
32        }
33    }
34
35    public void setmPhoneSubInfo(PhoneSubInfo phoneSubInfo) {
36        mPhoneSubInfo = phoneSubInfo;
37    }
38
39    @Override
40    public String getDeviceId() {
41        return mPhoneSubInfo.getDeviceId();
42    }
43
44    @Override
45    public String getDeviceSvn() {
46        return mPhoneSubInfo.getDeviceSvn();
47    }
48
49    /**
50     * Retrieves the unique subscriber ID, e.g., IMSI for GSM phones.
51     */
52    @Override
53    public String getSubscriberId() {
54        return mPhoneSubInfo.getSubscriberId();
55    }
56
57    /**
58     * Retrieves the Group Identifier Level1 for GSM phones.
59     */
60    public String getGroupIdLevel1() {
61        return mPhoneSubInfo.getGroupIdLevel1();
62    }
63
64    /**
65     * Retrieves the serial number of the ICC, if applicable.
66     */
67    @Override
68    public String getIccSerialNumber() {
69        return mPhoneSubInfo.getIccSerialNumber();
70    }
71
72    /**
73     * Retrieves the phone number string for line 1.
74     */
75    @Override
76    public String getLine1Number() {
77        return mPhoneSubInfo.getLine1Number();
78    }
79
80    /**
81     * Retrieves the alpha identifier for line 1.
82     */
83    @Override
84    public String getLine1AlphaTag() {
85        return mPhoneSubInfo.getLine1AlphaTag();
86    }
87
88    /**
89     * Retrieves the MSISDN Number.
90     */
91    @Override
92    public String getMsisdn() {
93        return mPhoneSubInfo.getMsisdn();
94    }
95
96    /**
97     * Retrieves the voice mail number.
98     */
99    @Override
100    public String getVoiceMailNumber() {
101        return mPhoneSubInfo.getVoiceMailNumber();
102    }
103
104    /**
105     * Retrieves the complete voice mail number.
106     */
107    @Override
108    public String getCompleteVoiceMailNumber() {
109        return mPhoneSubInfo.getCompleteVoiceMailNumber();
110    }
111
112    /**
113     * Retrieves the alpha identifier associated with the voice mail number.
114     */
115    @Override
116    public String getVoiceMailAlphaTag() {
117        return mPhoneSubInfo.getVoiceMailAlphaTag();
118    }
119
120    /**
121     * Returns the IMS private user identity (IMPI) that was loaded from the ISIM.
122     * @return the IMPI, or null if not present or not loaded
123     */
124    @Override
125    public String getIsimImpi() {
126        return mPhoneSubInfo.getIsimImpi();
127    }
128
129    /**
130     * Returns the IMS home network domain name that was loaded from the ISIM.
131     * @return the IMS domain name, or null if not present or not loaded
132     */
133    @Override
134    public String getIsimDomain() {
135        return mPhoneSubInfo.getIsimDomain();
136    }
137
138    /**
139     * Returns the IMS public user identities (IMPU) that were loaded from the ISIM.
140     * @return an array of IMPU strings, with one IMPU per string, or null if
141     *      not present or not loaded
142     */
143    @Override
144    public String[] getIsimImpu() {
145        return mPhoneSubInfo.getIsimImpu();
146    }
147
148    @Override
149    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
150        mPhoneSubInfo.dump(fd, pw, args);
151    }
152}
153