• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package com.android.internal.telephony;
18 
19 import java.io.FileDescriptor;
20 import java.io.PrintWriter;
21 
22 import android.content.pm.PackageManager;
23 import android.os.Binder;
24 import android.os.ServiceManager;
25 
26 
27 public class PhoneSubInfoProxy extends IPhoneSubInfo.Stub {
28     private PhoneSubInfo mPhoneSubInfo;
29 
PhoneSubInfoProxy(PhoneSubInfo phoneSubInfo)30     public PhoneSubInfoProxy(PhoneSubInfo phoneSubInfo) {
31         mPhoneSubInfo = phoneSubInfo;
32         if(ServiceManager.getService("iphonesubinfo") == null) {
33             ServiceManager.addService("iphonesubinfo", this);
34         }
35     }
36 
setmPhoneSubInfo(PhoneSubInfo phoneSubInfo)37     public void setmPhoneSubInfo(PhoneSubInfo phoneSubInfo) {
38         this.mPhoneSubInfo = phoneSubInfo;
39     }
40 
getDeviceId()41     public String getDeviceId() {
42         return mPhoneSubInfo.getDeviceId();
43     }
44 
getDeviceSvn()45     public String getDeviceSvn() {
46         return mPhoneSubInfo.getDeviceSvn();
47     }
48 
49     /**
50      * Retrieves the unique sbuscriber ID, e.g., IMSI for GSM phones.
51      */
getSubscriberId()52     public String getSubscriberId() {
53         return mPhoneSubInfo.getSubscriberId();
54     }
55 
56     /**
57      * Retrieves the serial number of the ICC, if applicable.
58      */
getIccSerialNumber()59     public String getIccSerialNumber() {
60         return mPhoneSubInfo.getIccSerialNumber();
61     }
62 
63     /**
64      * Retrieves the phone number string for line 1.
65      */
getLine1Number()66     public String getLine1Number() {
67         return mPhoneSubInfo.getLine1Number();
68     }
69 
70     /**
71      * Retrieves the alpha identifier for line 1.
72      */
getLine1AlphaTag()73     public String getLine1AlphaTag() {
74         return mPhoneSubInfo.getLine1AlphaTag();
75     }
76 
77     /**
78      * Retrieves the voice mail number.
79      */
getVoiceMailNumber()80     public String getVoiceMailNumber() {
81         return mPhoneSubInfo.getVoiceMailNumber();
82     }
83 
84     /**
85      * Retrieves the alpha identifier associated with the voice mail number.
86      */
getVoiceMailAlphaTag()87     public String getVoiceMailAlphaTag() {
88         return mPhoneSubInfo.getVoiceMailAlphaTag();
89     }
90 
dump(FileDescriptor fd, PrintWriter pw, String[] args)91     protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
92         mPhoneSubInfo.dump(fd, pw, args);
93     }
94 }
95