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 sbuscriber 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 voice mail number.
79     */
80    public String getVoiceMailNumber() {
81        return mPhoneSubInfo.getVoiceMailNumber();
82    }
83
84    /**
85     * Retrieves the complete voice mail number.
86     */
87    public String getCompleteVoiceMailNumber() {
88        return mPhoneSubInfo.getCompleteVoiceMailNumber();
89    }
90
91    /**
92     * Retrieves the alpha identifier associated with the voice mail number.
93     */
94    public String getVoiceMailAlphaTag() {
95        return mPhoneSubInfo.getVoiceMailAlphaTag();
96    }
97
98    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
99        mPhoneSubInfo.dump(fd, pw, args);
100    }
101}
102