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.app.PendingIntent; 20 import android.os.ServiceManager; 21 22 import java.util.List; 23 24 public class IccSmsInterfaceManagerProxy extends ISms.Stub { 25 private IccSmsInterfaceManager mIccSmsInterfaceManager; 26 27 public IccSmsInterfaceManagerProxy(IccSmsInterfaceManager 28 iccSmsInterfaceManager) { 29 mIccSmsInterfaceManager = iccSmsInterfaceManager; 30 if(ServiceManager.getService("isms") == null) { 31 ServiceManager.addService("isms", this); 32 } 33 } 34 35 public void setmIccSmsInterfaceManager(IccSmsInterfaceManager iccSmsInterfaceManager) { 36 mIccSmsInterfaceManager = iccSmsInterfaceManager; 37 } 38 39 @Override 40 public boolean 41 updateMessageOnIccEf(String callingPackage, int index, int status, byte[] pdu) { 42 return mIccSmsInterfaceManager.updateMessageOnIccEf(callingPackage, index, status, pdu); 43 } 44 45 @Override 46 public boolean copyMessageToIccEf(String callingPackage, int status, byte[] pdu, 47 byte[] smsc) { 48 return mIccSmsInterfaceManager.copyMessageToIccEf(callingPackage, status, pdu, smsc); 49 } 50 51 @Override 52 public List<SmsRawData> getAllMessagesFromIccEf(String callingPackage) { 53 return mIccSmsInterfaceManager.getAllMessagesFromIccEf(callingPackage); 54 } 55 56 @Override 57 public void sendData(String callingPackage, String destAddr, String scAddr, int destPort, 58 byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent) { 59 mIccSmsInterfaceManager.sendData(callingPackage, destAddr, scAddr, destPort, data, 60 sentIntent, deliveryIntent); 61 } 62 63 @Override 64 public void sendText(String callingPackage, String destAddr, String scAddr, 65 String text, PendingIntent sentIntent, PendingIntent deliveryIntent) { 66 mIccSmsInterfaceManager.sendText(callingPackage, destAddr, scAddr, text, sentIntent, 67 deliveryIntent); 68 } 69 70 @Override 71 public void sendMultipartText(String callingPackage, String destAddr, String scAddr, 72 List<String> parts, List<PendingIntent> sentIntents, 73 List<PendingIntent> deliveryIntents) { 74 mIccSmsInterfaceManager.sendMultipartText(callingPackage, destAddr, scAddr, 75 parts, sentIntents, deliveryIntents); 76 } 77 78 @Override 79 public boolean enableCellBroadcast(int messageIdentifier) throws android.os.RemoteException { 80 return mIccSmsInterfaceManager.enableCellBroadcast(messageIdentifier); 81 } 82 83 @Override 84 public boolean disableCellBroadcast(int messageIdentifier) throws android.os.RemoteException { 85 return mIccSmsInterfaceManager.disableCellBroadcast(messageIdentifier); 86 } 87 88 @Override 89 public boolean enableCellBroadcastRange(int startMessageId, int endMessageId) 90 throws android.os.RemoteException { 91 return mIccSmsInterfaceManager.enableCellBroadcastRange(startMessageId, endMessageId); 92 } 93 94 @Override 95 public boolean disableCellBroadcastRange(int startMessageId, int endMessageId) 96 throws android.os.RemoteException { 97 return mIccSmsInterfaceManager.disableCellBroadcastRange(startMessageId, endMessageId); 98 } 99 100 @Override 101 public int getPremiumSmsPermission(String packageName) { 102 return mIccSmsInterfaceManager.getPremiumSmsPermission(packageName); 103 } 104 105 @Override 106 public void setPremiumSmsPermission(String packageName, int permission) { 107 mIccSmsInterfaceManager.setPremiumSmsPermission(packageName, permission); 108 } 109 } 110