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.content.pm.PackageManager;
23import android.os.Binder;
24import android.os.ServiceManager;
25
26
27public class PhoneSubInfoProxy extends IPhoneSubInfo.Stub {
28    private PhoneSubInfo mPhoneSubInfo;
29
30    public PhoneSubInfoProxy(PhoneSubInfo phoneSubInfo) {
31        mPhoneSubInfo = phoneSubInfo;
32        if(ServiceManager.getService("iphonesubinfo") == null) {
33            ServiceManager.addService("iphonesubinfo", this);
34        }
35    }
36
37    public void setmPhoneSubInfo(PhoneSubInfo phoneSubInfo) {
38        this.mPhoneSubInfo = phoneSubInfo;
39    }
40
41    public String getDeviceId() {
42        return mPhoneSubInfo.getDeviceId();
43    }
44
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    public String getSubscriberId() {
53        return mPhoneSubInfo.getSubscriberId();
54    }
55
56    /**
57     * Retrieves the serial number of the ICC, if applicable.
58     */
59    public String getIccSerialNumber() {
60        return mPhoneSubInfo.getIccSerialNumber();
61    }
62
63    /**
64     * Retrieves the phone number string for line 1.
65     */
66    public String getLine1Number() {
67        return mPhoneSubInfo.getLine1Number();
68    }
69
70    /**
71     * Retrieves the alpha identifier for line 1.
72     */
73    public String getLine1AlphaTag() {
74        return mPhoneSubInfo.getLine1AlphaTag();
75    }
76
77    /**
78     * Retrieves the MSISDN Number.
79     */
80    public String getMsisdn() {
81        return mPhoneSubInfo.getMsisdn();
82    }
83
84    /**
85     * Retrieves the voice mail number.
86     */
87    public String getVoiceMailNumber() {
88        return mPhoneSubInfo.getVoiceMailNumber();
89    }
90
91    /**
92     * Retrieves the complete voice mail number.
93     */
94    public String getCompleteVoiceMailNumber() {
95        return mPhoneSubInfo.getCompleteVoiceMailNumber();
96    }
97
98    /**
99     * Retrieves the alpha identifier associated with the voice mail number.
100     */
101    public String getVoiceMailAlphaTag() {
102        return mPhoneSubInfo.getVoiceMailAlphaTag();
103    }
104
105    /**
106     * Returns the IMS private user identity (IMPI) that was loaded from the ISIM.
107     * @return the IMPI, or null if not present or not loaded
108     */
109    public String getIsimImpi() {
110        return mPhoneSubInfo.getIsimImpi();
111    }
112
113    /**
114     * Returns the IMS home network domain name that was loaded from the ISIM.
115     * @return the IMS domain name, or null if not present or not loaded
116     */
117    public String getIsimDomain() {
118        return mPhoneSubInfo.getIsimDomain();
119    }
120
121    /**
122     * Returns the IMS public user identities (IMPU) that were loaded from the ISIM.
123     * @return an array of IMPU strings, with one IMPU per string, or null if
124     *      not present or not loaded
125     */
126    public String[] getIsimImpu() {
127        return mPhoneSubInfo.getIsimImpu();
128    }
129
130    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
131        mPhoneSubInfo.dump(fd, pw, args);
132    }
133}
134