Loading src/java/com/android/internal/telephony/IccSmsInterfaceManager.java +24 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,8 @@ import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; import com.android.internal.telephony.uicc.IccConstants; import com.android.internal.telephony.uicc.IccFileHandler; import com.android.internal.telephony.uicc.IccUtils; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.uicc.UiccProfile; import com.android.internal.util.HexDump; import java.io.FileDescriptor; Loading Loading @@ -1336,6 +1338,28 @@ public class IccSmsInterfaceManager { SMS_MESSAGE_PERIOD_NOT_SPECIFIED); } public int getSmsCapacityOnIcc() { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, "getSmsCapacityOnIcc"); int numberOnIcc = 0; if (mPhone.getIccRecordsLoaded()) { final UiccProfile uiccProfile = UiccController.getInstance() .getUiccProfileForPhone(mPhone.getPhoneId()); if(uiccProfile != null) { numberOnIcc = uiccProfile.getIccRecords().getSmsCapacityOnIcc(); } else { loge("uiccProfile is null"); } } else { loge("getSmsCapacityOnIcc - aborting, no icc card present."); } log("getSmsCapacityOnIcc().numberOnIcc = " + numberOnIcc); return numberOnIcc; } private boolean isFailedOrDraft(ContentResolver resolver, Uri messageUri) { // Clear the calling identity and query the database using the phone user id // Otherwise the AppOps check in TelephonyProvider would complain about mismatch Loading src/java/com/android/internal/telephony/SmsController.java +15 −0 Original line number Diff line number Diff line Loading @@ -625,4 +625,19 @@ public class SmsController extends ISmsImplBase { .getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE); return manager.getActiveSubscriptionInfo(subId); } /** * Get the capacity count of sms on Icc card. */ @Override public int getSmsCapacityOnIccForSubscriber(int subId) { IccSmsInterfaceManager iccSmsIntMgr = getIccSmsInterfaceManager(subId); if (iccSmsIntMgr != null ) { return iccSmsIntMgr.getSmsCapacityOnIcc(); } else { Rlog.e(LOG_TAG, "iccSmsIntMgr is null for " + " subId: " + subId); return 0; } } } src/java/com/android/internal/telephony/uicc/IccRecords.java +38 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,8 @@ public abstract class IccRecords extends Handler implements IccConstants { protected int mMncLength = UNINITIALIZED; protected int mMailboxIndex = 0; // 0 is no mailbox dailing number associated protected int mSmsCountOnIcc = 0; @UnsupportedAppUsage private String mSpn; Loading Loading @@ -215,6 +217,7 @@ public abstract class IccRecords extends Handler implements IccConstants { public static final int EVENT_GET_ICC_RECORD_DONE = 100; public static final int EVENT_REFRESH = 31; // ICC refresh occurred private static final int EVENT_AKA_AUTHENTICATE_DONE = 90; protected static final int EVENT_GET_SMS_RECORD_SIZE_DONE = 28; protected static final int SYSTEM_EVENT_BASE = 0x100; protected static final int EVENT_APP_READY = 1 + SYSTEM_EVENT_BASE; Loading Loading @@ -905,6 +908,33 @@ public abstract class IccRecords extends Handler implements IccConstants { break; case EVENT_GET_SMS_RECORD_SIZE_DONE: ar = (AsyncResult) msg.obj; if (ar.exception != null) { onRecordLoaded(); loge("Exception in EVENT_GET_SMS_RECORD_SIZE_DONE " + ar.exception); break; } int[] recordSize = (int[])ar.result; try { // recordSize[0] is the record length // recordSize[1] is the total length of the EF file // recordSize[2] is the number of records in the EF file mSmsCountOnIcc = recordSize[2]; log("EVENT_GET_SMS_RECORD_SIZE_DONE Size " + recordSize[0] + " total " + recordSize[1] + " record " + recordSize[2]); } catch (ArrayIndexOutOfBoundsException exc) { mSmsCountOnIcc = -1; loge("ArrayIndexOutOfBoundsException in EVENT_GET_SMS_RECORD_SIZE_DONE: " + exc.toString()); } finally { onRecordLoaded(); } break; default: super.handleMessage(msg); } Loading Loading @@ -1246,6 +1276,14 @@ public abstract class IccRecords extends Handler implements IccConstants { return carrierNameDisplayCondition; } /** * Get SMS capacity count on ICC card. */ public int getSmsCapacityOnIcc() { if (DBG) log("getSmsCapacityOnIcc: " + mSmsCountOnIcc); return mSmsCountOnIcc; } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("IccRecords: " + this); pw.println(" mDestroyed=" + mDestroyed); Loading src/java/com/android/internal/telephony/uicc/RuimRecords.java +2 −0 Original line number Diff line number Diff line Loading @@ -891,6 +891,8 @@ public class RuimRecords extends IccRecords { mFh.loadEFTransparent(EF_CSIM_MIPUPP, obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfCsimMipUppLoaded())); mRecordsToLoad++; mFh.getEFLinearRecordSize(EF_SMS, obtainMessage(EVENT_GET_SMS_RECORD_SIZE_DONE)); mRecordsToLoad++; if (DBG) log("fetchRuimRecords " + mRecordsToLoad + " requested: " + mRecordsRequested); // Further records that can be inserted are Operator/OEM dependent Loading src/java/com/android/internal/telephony/uicc/SIMRecords.java +2 −0 Original line number Diff line number Diff line Loading @@ -1659,6 +1659,8 @@ public class SIMRecords extends IccRecords { mRecordsToLoad++; loadEfLiAndEfPl(); mFh.getEFLinearRecordSize(EF_SMS, obtainMessage(EVENT_GET_SMS_RECORD_SIZE_DONE)); mRecordsToLoad++; // XXX should seek instead of examining them all if (false) { // XXX Loading Loading
src/java/com/android/internal/telephony/IccSmsInterfaceManager.java +24 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,8 @@ import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; import com.android.internal.telephony.uicc.IccConstants; import com.android.internal.telephony.uicc.IccFileHandler; import com.android.internal.telephony.uicc.IccUtils; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.uicc.UiccProfile; import com.android.internal.util.HexDump; import java.io.FileDescriptor; Loading Loading @@ -1336,6 +1338,28 @@ public class IccSmsInterfaceManager { SMS_MESSAGE_PERIOD_NOT_SPECIFIED); } public int getSmsCapacityOnIcc() { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, "getSmsCapacityOnIcc"); int numberOnIcc = 0; if (mPhone.getIccRecordsLoaded()) { final UiccProfile uiccProfile = UiccController.getInstance() .getUiccProfileForPhone(mPhone.getPhoneId()); if(uiccProfile != null) { numberOnIcc = uiccProfile.getIccRecords().getSmsCapacityOnIcc(); } else { loge("uiccProfile is null"); } } else { loge("getSmsCapacityOnIcc - aborting, no icc card present."); } log("getSmsCapacityOnIcc().numberOnIcc = " + numberOnIcc); return numberOnIcc; } private boolean isFailedOrDraft(ContentResolver resolver, Uri messageUri) { // Clear the calling identity and query the database using the phone user id // Otherwise the AppOps check in TelephonyProvider would complain about mismatch Loading
src/java/com/android/internal/telephony/SmsController.java +15 −0 Original line number Diff line number Diff line Loading @@ -625,4 +625,19 @@ public class SmsController extends ISmsImplBase { .getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE); return manager.getActiveSubscriptionInfo(subId); } /** * Get the capacity count of sms on Icc card. */ @Override public int getSmsCapacityOnIccForSubscriber(int subId) { IccSmsInterfaceManager iccSmsIntMgr = getIccSmsInterfaceManager(subId); if (iccSmsIntMgr != null ) { return iccSmsIntMgr.getSmsCapacityOnIcc(); } else { Rlog.e(LOG_TAG, "iccSmsIntMgr is null for " + " subId: " + subId); return 0; } } }
src/java/com/android/internal/telephony/uicc/IccRecords.java +38 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,8 @@ public abstract class IccRecords extends Handler implements IccConstants { protected int mMncLength = UNINITIALIZED; protected int mMailboxIndex = 0; // 0 is no mailbox dailing number associated protected int mSmsCountOnIcc = 0; @UnsupportedAppUsage private String mSpn; Loading Loading @@ -215,6 +217,7 @@ public abstract class IccRecords extends Handler implements IccConstants { public static final int EVENT_GET_ICC_RECORD_DONE = 100; public static final int EVENT_REFRESH = 31; // ICC refresh occurred private static final int EVENT_AKA_AUTHENTICATE_DONE = 90; protected static final int EVENT_GET_SMS_RECORD_SIZE_DONE = 28; protected static final int SYSTEM_EVENT_BASE = 0x100; protected static final int EVENT_APP_READY = 1 + SYSTEM_EVENT_BASE; Loading Loading @@ -905,6 +908,33 @@ public abstract class IccRecords extends Handler implements IccConstants { break; case EVENT_GET_SMS_RECORD_SIZE_DONE: ar = (AsyncResult) msg.obj; if (ar.exception != null) { onRecordLoaded(); loge("Exception in EVENT_GET_SMS_RECORD_SIZE_DONE " + ar.exception); break; } int[] recordSize = (int[])ar.result; try { // recordSize[0] is the record length // recordSize[1] is the total length of the EF file // recordSize[2] is the number of records in the EF file mSmsCountOnIcc = recordSize[2]; log("EVENT_GET_SMS_RECORD_SIZE_DONE Size " + recordSize[0] + " total " + recordSize[1] + " record " + recordSize[2]); } catch (ArrayIndexOutOfBoundsException exc) { mSmsCountOnIcc = -1; loge("ArrayIndexOutOfBoundsException in EVENT_GET_SMS_RECORD_SIZE_DONE: " + exc.toString()); } finally { onRecordLoaded(); } break; default: super.handleMessage(msg); } Loading Loading @@ -1246,6 +1276,14 @@ public abstract class IccRecords extends Handler implements IccConstants { return carrierNameDisplayCondition; } /** * Get SMS capacity count on ICC card. */ public int getSmsCapacityOnIcc() { if (DBG) log("getSmsCapacityOnIcc: " + mSmsCountOnIcc); return mSmsCountOnIcc; } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("IccRecords: " + this); pw.println(" mDestroyed=" + mDestroyed); Loading
src/java/com/android/internal/telephony/uicc/RuimRecords.java +2 −0 Original line number Diff line number Diff line Loading @@ -891,6 +891,8 @@ public class RuimRecords extends IccRecords { mFh.loadEFTransparent(EF_CSIM_MIPUPP, obtainMessage(EVENT_GET_ICC_RECORD_DONE, new EfCsimMipUppLoaded())); mRecordsToLoad++; mFh.getEFLinearRecordSize(EF_SMS, obtainMessage(EVENT_GET_SMS_RECORD_SIZE_DONE)); mRecordsToLoad++; if (DBG) log("fetchRuimRecords " + mRecordsToLoad + " requested: " + mRecordsRequested); // Further records that can be inserted are Operator/OEM dependent Loading
src/java/com/android/internal/telephony/uicc/SIMRecords.java +2 −0 Original line number Diff line number Diff line Loading @@ -1659,6 +1659,8 @@ public class SIMRecords extends IccRecords { mRecordsToLoad++; loadEfLiAndEfPl(); mFh.getEFLinearRecordSize(EF_SMS, obtainMessage(EVENT_GET_SMS_RECORD_SIZE_DONE)); mRecordsToLoad++; // XXX should seek instead of examining them all if (false) { // XXX Loading