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