Loading src/java/com/android/internal/telephony/IccSmsInterfaceManager.java +30 −23 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public class IccSmsInterfaceManager { markMessagesAsRead((ArrayList<byte[]>) ar.result); } else { if (Rlog.isLoggable("SMS", Log.DEBUG)) { log("Cannot load Sms records"); loge("Cannot load Sms records"); } mSms = null; } Loading @@ -147,7 +147,7 @@ public class IccSmsInterfaceManager { if (ar.exception == null) { mSmsc = (String) ar.result; } else { log("Cannot read SMSC"); loge("Cannot read SMSC"); mSmsc = null; } mLock.notifyAll(); Loading Loading @@ -194,7 +194,7 @@ public class IccSmsInterfaceManager { //shouldn't really happen, as messages are marked as read, only //after importing it from icc. if (Rlog.isLoggable("SMS", Log.DEBUG)) { log("markMessagesAsRead - aborting, no icc card present."); loge("markMessagesAsRead - aborting, no icc card present."); } return; } Loading Loading @@ -276,7 +276,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to update by index"); loge("interrupted while trying to update by index"); } } return mSuccess; Loading Loading @@ -317,7 +317,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to update by index"); loge("interrupted while trying to update by index"); } } return mSuccess; Loading @@ -344,7 +344,7 @@ public class IccSmsInterfaceManager { IccFileHandler fh = mPhone.getIccFileHandler(); if (fh == null) { Rlog.e(LOG_TAG, "Cannot load Sms records. No icc card?"); loge("Cannot load Sms records. No icc card?"); mSms = null; return mSms; } Loading @@ -355,7 +355,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to load from the Icc"); loge("interrupted while trying to load from the Icc"); } } return mSms; Loading Loading @@ -610,7 +610,7 @@ public class IccSmsInterfaceManager { try { receivedIntent.send(result); } catch (PendingIntent.CanceledException e) { Rlog.d(LOG_TAG, "receivedIntent cancelled."); loge("receivedIntent cancelled."); } } } Loading Loading @@ -839,7 +839,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to read SMSC"); loge("interrupted while trying to read SMSC"); } } return mSmsc; Loading @@ -863,7 +863,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to write SMSC"); loge("interrupted while trying to write SMSC"); } } return mSuccess; Loading Loading @@ -1119,7 +1119,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to set cell broadcast config"); loge("interrupted while trying to set cell broadcast config"); } } Loading @@ -1139,7 +1139,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to set cell broadcast activation"); loge("interrupted while trying to set cell broadcast activation"); } } Loading @@ -1160,7 +1160,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to set cdma broadcast config"); loge("interrupted while trying to set cdma broadcast config"); } } Loading @@ -1180,7 +1180,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to set cdma broadcast activation"); loge("interrupted while trying to set cdma broadcast activation"); } } Loading @@ -1189,7 +1189,15 @@ public class IccSmsInterfaceManager { @UnsupportedAppUsage protected void log(String msg) { Log.d(LOG_TAG, "[IccSmsInterfaceManager] " + msg); Rlog.d(LOG_TAG, msg); } protected void loge(String msg) { Rlog.e(LOG_TAG, msg); } protected void loge(String msg, Throwable e) { Rlog.e(LOG_TAG, msg, e); } @UnsupportedAppUsage Loading @@ -1215,13 +1223,13 @@ public class IccSmsInterfaceManager { } final ContentResolver resolver = mContext.getContentResolver(); if (!isFailedOrDraft(resolver, messageUri)) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]sendStoredText: not FAILED or DRAFT message"); loge("sendStoredText: not FAILED or DRAFT message"); returnUnspecifiedFailure(sentIntent); return; } final String[] textAndAddress = loadTextAndAddress(resolver, messageUri); if (textAndAddress == null) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]sendStoredText: can not load text"); loge("sendStoredText: can not load text"); returnUnspecifiedFailure(sentIntent); return; } Loading @@ -1242,20 +1250,19 @@ public class IccSmsInterfaceManager { } final ContentResolver resolver = mContext.getContentResolver(); if (!isFailedOrDraft(resolver, messageUri)) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]sendStoredMultipartText: " + "not FAILED or DRAFT message"); loge("sendStoredMultipartText: not FAILED or DRAFT message"); returnUnspecifiedFailure(sentIntents); return; } final String[] textAndAddress = loadTextAndAddress(resolver, messageUri); if (textAndAddress == null) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]sendStoredMultipartText: can not load text"); loge("sendStoredMultipartText: can not load text"); returnUnspecifiedFailure(sentIntents); return; } final ArrayList<String> parts = SmsManager.getDefault().divideMessage(textAndAddress[0]); if (parts == null || parts.size() < 1) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]sendStoredMultipartText: can not divide text"); loge("sendStoredMultipartText: can not divide text"); returnUnspecifiedFailure(sentIntents); return; } Loading Loading @@ -1327,7 +1334,7 @@ public class IccSmsInterfaceManager { || type == Telephony.Sms.MESSAGE_TYPE_FAILED; } } catch (SQLiteException e) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]isFailedOrDraft: query message type failed", e); loge("isFailedOrDraft: query message type failed", e); } finally { if (cursor != null) { cursor.close(); Loading Loading @@ -1358,7 +1365,7 @@ public class IccSmsInterfaceManager { return new String[]{ cursor.getString(0), cursor.getString(1) }; } } catch (SQLiteException e) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]loadText: query message text failed", e); loge("loadText: query message text failed", e); } finally { if (cursor != null) { cursor.close(); Loading src/java/com/android/internal/telephony/SmsPermissions.java +12 −4 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ public class SmsPermissions { } } catch (PackageManager.NameNotFoundException e) { if (Rlog.isLoggable("SMS", Log.DEBUG)) { log("Cannot find configured carrier ims package"); loge("Cannot find configured carrier ims package"); } } Loading Loading @@ -143,7 +143,7 @@ public class SmsPermissions { .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege( mContext, mPhone.getSubId(), message); } catch (SecurityException e) { // To avoid crashing applications Log.e(LOG_TAG, message + ": Neither " + callingPackage + " is the default SMS app" loge(message + ": Neither " + callingPackage + " is the default SMS app" + " nor the caller has " + android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE + ", or carrier privileges", e); Loading Loading @@ -171,7 +171,7 @@ public class SmsPermissions { TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege( mContext, mPhone.getSubId(), message); } catch (SecurityException e) { // To avoid crashing applications Log.e(LOG_TAG, message + ": Neither " + callingPackage + " is the default SMS app" loge(message + ": Neither " + callingPackage + " is the default SMS app" + " nor the caller has " + android.Manifest.permission.MODIFY_PHONE_STATE + ", or carrier privileges", e); return false; Loading @@ -188,6 +188,14 @@ public class SmsPermissions { @UnsupportedAppUsage protected void log(String msg) { Log.d(LOG_TAG, "[IccSmsInterfaceManager] " + msg); Rlog.d(LOG_TAG, msg); } protected void loge(String msg) { Rlog.e(LOG_TAG, msg); } protected void loge(String msg, Throwable e) { Rlog.e(LOG_TAG, msg, e); } } Loading
src/java/com/android/internal/telephony/IccSmsInterfaceManager.java +30 −23 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public class IccSmsInterfaceManager { markMessagesAsRead((ArrayList<byte[]>) ar.result); } else { if (Rlog.isLoggable("SMS", Log.DEBUG)) { log("Cannot load Sms records"); loge("Cannot load Sms records"); } mSms = null; } Loading @@ -147,7 +147,7 @@ public class IccSmsInterfaceManager { if (ar.exception == null) { mSmsc = (String) ar.result; } else { log("Cannot read SMSC"); loge("Cannot read SMSC"); mSmsc = null; } mLock.notifyAll(); Loading Loading @@ -194,7 +194,7 @@ public class IccSmsInterfaceManager { //shouldn't really happen, as messages are marked as read, only //after importing it from icc. if (Rlog.isLoggable("SMS", Log.DEBUG)) { log("markMessagesAsRead - aborting, no icc card present."); loge("markMessagesAsRead - aborting, no icc card present."); } return; } Loading Loading @@ -276,7 +276,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to update by index"); loge("interrupted while trying to update by index"); } } return mSuccess; Loading Loading @@ -317,7 +317,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to update by index"); loge("interrupted while trying to update by index"); } } return mSuccess; Loading @@ -344,7 +344,7 @@ public class IccSmsInterfaceManager { IccFileHandler fh = mPhone.getIccFileHandler(); if (fh == null) { Rlog.e(LOG_TAG, "Cannot load Sms records. No icc card?"); loge("Cannot load Sms records. No icc card?"); mSms = null; return mSms; } Loading @@ -355,7 +355,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to load from the Icc"); loge("interrupted while trying to load from the Icc"); } } return mSms; Loading Loading @@ -610,7 +610,7 @@ public class IccSmsInterfaceManager { try { receivedIntent.send(result); } catch (PendingIntent.CanceledException e) { Rlog.d(LOG_TAG, "receivedIntent cancelled."); loge("receivedIntent cancelled."); } } } Loading Loading @@ -839,7 +839,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to read SMSC"); loge("interrupted while trying to read SMSC"); } } return mSmsc; Loading @@ -863,7 +863,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to write SMSC"); loge("interrupted while trying to write SMSC"); } } return mSuccess; Loading Loading @@ -1119,7 +1119,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to set cell broadcast config"); loge("interrupted while trying to set cell broadcast config"); } } Loading @@ -1139,7 +1139,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to set cell broadcast activation"); loge("interrupted while trying to set cell broadcast activation"); } } Loading @@ -1160,7 +1160,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to set cdma broadcast config"); loge("interrupted while trying to set cdma broadcast config"); } } Loading @@ -1180,7 +1180,7 @@ public class IccSmsInterfaceManager { try { mLock.wait(); } catch (InterruptedException e) { log("interrupted while trying to set cdma broadcast activation"); loge("interrupted while trying to set cdma broadcast activation"); } } Loading @@ -1189,7 +1189,15 @@ public class IccSmsInterfaceManager { @UnsupportedAppUsage protected void log(String msg) { Log.d(LOG_TAG, "[IccSmsInterfaceManager] " + msg); Rlog.d(LOG_TAG, msg); } protected void loge(String msg) { Rlog.e(LOG_TAG, msg); } protected void loge(String msg, Throwable e) { Rlog.e(LOG_TAG, msg, e); } @UnsupportedAppUsage Loading @@ -1215,13 +1223,13 @@ public class IccSmsInterfaceManager { } final ContentResolver resolver = mContext.getContentResolver(); if (!isFailedOrDraft(resolver, messageUri)) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]sendStoredText: not FAILED or DRAFT message"); loge("sendStoredText: not FAILED or DRAFT message"); returnUnspecifiedFailure(sentIntent); return; } final String[] textAndAddress = loadTextAndAddress(resolver, messageUri); if (textAndAddress == null) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]sendStoredText: can not load text"); loge("sendStoredText: can not load text"); returnUnspecifiedFailure(sentIntent); return; } Loading @@ -1242,20 +1250,19 @@ public class IccSmsInterfaceManager { } final ContentResolver resolver = mContext.getContentResolver(); if (!isFailedOrDraft(resolver, messageUri)) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]sendStoredMultipartText: " + "not FAILED or DRAFT message"); loge("sendStoredMultipartText: not FAILED or DRAFT message"); returnUnspecifiedFailure(sentIntents); return; } final String[] textAndAddress = loadTextAndAddress(resolver, messageUri); if (textAndAddress == null) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]sendStoredMultipartText: can not load text"); loge("sendStoredMultipartText: can not load text"); returnUnspecifiedFailure(sentIntents); return; } final ArrayList<String> parts = SmsManager.getDefault().divideMessage(textAndAddress[0]); if (parts == null || parts.size() < 1) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]sendStoredMultipartText: can not divide text"); loge("sendStoredMultipartText: can not divide text"); returnUnspecifiedFailure(sentIntents); return; } Loading Loading @@ -1327,7 +1334,7 @@ public class IccSmsInterfaceManager { || type == Telephony.Sms.MESSAGE_TYPE_FAILED; } } catch (SQLiteException e) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]isFailedOrDraft: query message type failed", e); loge("isFailedOrDraft: query message type failed", e); } finally { if (cursor != null) { cursor.close(); Loading Loading @@ -1358,7 +1365,7 @@ public class IccSmsInterfaceManager { return new String[]{ cursor.getString(0), cursor.getString(1) }; } } catch (SQLiteException e) { Log.e(LOG_TAG, "[IccSmsInterfaceManager]loadText: query message text failed", e); loge("loadText: query message text failed", e); } finally { if (cursor != null) { cursor.close(); Loading
src/java/com/android/internal/telephony/SmsPermissions.java +12 −4 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ public class SmsPermissions { } } catch (PackageManager.NameNotFoundException e) { if (Rlog.isLoggable("SMS", Log.DEBUG)) { log("Cannot find configured carrier ims package"); loge("Cannot find configured carrier ims package"); } } Loading Loading @@ -143,7 +143,7 @@ public class SmsPermissions { .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege( mContext, mPhone.getSubId(), message); } catch (SecurityException e) { // To avoid crashing applications Log.e(LOG_TAG, message + ": Neither " + callingPackage + " is the default SMS app" loge(message + ": Neither " + callingPackage + " is the default SMS app" + " nor the caller has " + android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE + ", or carrier privileges", e); Loading Loading @@ -171,7 +171,7 @@ public class SmsPermissions { TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege( mContext, mPhone.getSubId(), message); } catch (SecurityException e) { // To avoid crashing applications Log.e(LOG_TAG, message + ": Neither " + callingPackage + " is the default SMS app" loge(message + ": Neither " + callingPackage + " is the default SMS app" + " nor the caller has " + android.Manifest.permission.MODIFY_PHONE_STATE + ", or carrier privileges", e); return false; Loading @@ -188,6 +188,14 @@ public class SmsPermissions { @UnsupportedAppUsage protected void log(String msg) { Log.d(LOG_TAG, "[IccSmsInterfaceManager] " + msg); Rlog.d(LOG_TAG, msg); } protected void loge(String msg) { Rlog.e(LOG_TAG, msg); } protected void loge(String msg, Throwable e) { Rlog.e(LOG_TAG, msg, e); } }