Home | History | Annotate | Download | only in telephony
      1 /*
      2  * Copyright (C) 2008 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 android.content.pm.PackageManager;
     20 import android.os.AsyncResult;
     21 import android.os.Handler;
     22 import android.os.Looper;
     23 import android.os.Message;
     24 import android.os.ServiceManager;
     25 import android.telephony.PhoneNumberUtils;
     26 import android.util.Log;
     27 
     28 import java.util.ArrayList;
     29 import java.util.List;
     30 
     31 
     32 /**
     33  * SimPhoneBookInterfaceManager to provide an inter-process communication to
     34  * access ADN-like SIM records.
     35  */
     36 public class IccPhoneBookInterfaceManagerProxy extends IIccPhoneBook.Stub {
     37     private IccPhoneBookInterfaceManager mIccPhoneBookInterfaceManager;
     38 
     39     public IccPhoneBookInterfaceManagerProxy(IccPhoneBookInterfaceManager
     40             iccPhoneBookInterfaceManager) {
     41         mIccPhoneBookInterfaceManager = iccPhoneBookInterfaceManager;
     42         if(ServiceManager.getService("simphonebook") == null) {
     43             ServiceManager.addService("simphonebook", this);
     44         }
     45     }
     46 
     47     public void setmIccPhoneBookInterfaceManager(
     48             IccPhoneBookInterfaceManager iccPhoneBookInterfaceManager) {
     49         this.mIccPhoneBookInterfaceManager = iccPhoneBookInterfaceManager;
     50     }
     51 
     52     public boolean
     53     updateAdnRecordsInEfBySearch (int efid,
     54             String oldTag, String oldPhoneNumber,
     55             String newTag, String newPhoneNumber,
     56             String pin2) throws android.os.RemoteException {
     57         return mIccPhoneBookInterfaceManager.updateAdnRecordsInEfBySearch(
     58                 efid, oldTag, oldPhoneNumber, newTag, newPhoneNumber, pin2);
     59     }
     60 
     61     public boolean
     62     updateAdnRecordsInEfByIndex(int efid, String newTag,
     63             String newPhoneNumber, int index, String pin2) throws android.os.RemoteException {
     64         return mIccPhoneBookInterfaceManager.updateAdnRecordsInEfByIndex(efid,
     65                 newTag, newPhoneNumber, index, pin2);
     66     }
     67 
     68     public int[] getAdnRecordsSize(int efid) throws android.os.RemoteException {
     69         return mIccPhoneBookInterfaceManager.getAdnRecordsSize(efid);
     70     }
     71 
     72     public List<AdnRecord> getAdnRecordsInEf(int efid) throws android.os.RemoteException {
     73         return mIccPhoneBookInterfaceManager.getAdnRecordsInEf(efid);
     74     }
     75 }
     76