2 ** Copyright 2007, The Android Open Source Project
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
8 ** http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.android.internal.telephony.cdma;
19 import android.os.Message;
20 import android.util.Log;
22 import com.android.internal.telephony.IccPhoneBookInterfaceManager;
25 * RuimPhoneBookInterfaceManager to provide an inter-process communication to
26 * access ADN-like SIM records.
30 public class RuimPhoneBookInterfaceManager extends IccPhoneBookInterfaceManager {
31 static final String LOG_TAG = "CDMA";
33 public RuimPhoneBookInterfaceManager(CDMAPhone phone) {
35 adnCache = phone.mRuimRecords.getAdnCache();
36 //NOTE service "simphonebook" added by IccSmsInterfaceManagerProxy
39 public void dispose() {
43 protected void finalize() {
46 } catch (Throwable throwable) {
47 Log.e(LOG_TAG, "Error while finalizing:", throwable);
49 if(DBG) Log.d(LOG_TAG, "RuimPhoneBookInterfaceManager finalized");
52 public int[] getAdnRecordsSize(int efid) {
53 if (DBG) logd("getAdnRecordsSize: efid=" + efid);
56 recordSize = new int[3];
58 //Using mBaseHandler, no difference in EVENT_GET_SIZE_DONE handling
59 Message response = mBaseHandler.obtainMessage(EVENT_GET_SIZE_DONE);
61 phone.getIccFileHandler().getEFLinearRecordSize(efid, response);
64 } catch (InterruptedException e) {
65 logd("interrupted while trying to load from the RUIM");
72 protected void logd(String msg) {
73 Log.d(LOG_TAG, "[RuimPbInterfaceManager] " + msg);
76 protected void loge(String msg) {
77 Log.e(LOG_TAG, "[RuimPbInterfaceManager] " + msg);