diff options
3 files changed, 24 insertions, 9 deletions
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 9d92421..1bd837b 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -89,7 +89,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { @Override public String toString() { - return "{pkgForDebug=" + pkgForDebug + " callerUid=" + callerUid + + return "{pkgForDebug=" + pkgForDebug + " callerUid=" + callerUid + " subId=" + subId + " events=" + Integer.toHexString(events) + "}"; } } @@ -208,11 +208,13 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { String action = intent.getAction(); Slog.d(TAG, "mBroadcastReceiver: action=" + action); if (Intent.ACTION_USER_SWITCHED.equals(action)) { - mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHED, - intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0), 0)); + int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0); + if (DBG) Slog.d(TAG, "onReceive: userHandle=" + userHandle); + mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHED, userHandle, 0)); } else if (action.equals(TelephonyIntents.ACTION_DEFAULT_SUBSCRIPTION_CHANGED)) { mDefaultSubId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.getDefaultSubId()); + if (DBG) Slog.d(TAG, "onReceive: mDefaultSubId=" + mDefaultSubId); mHandler.sendMessage(mHandler.obtainMessage(MSG_UPDATE_DEFAULT_SUB, 0, 0)); } } @@ -340,18 +342,19 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { // the received subId value update the isLegacyApp field if ((r.subId <= 0) || (r.subId == SubscriptionManager.INVALID_SUB_ID)) { r.subId = mDefaultSubId; - r.isLegacyApp = true; // FIXME: is this needed ?? + r.isLegacyApp = true; // r.subId is to be update when default changes. } if (r.subId == SubscriptionManager.DEFAULT_SUB_ID) { r.subId = mDefaultSubId; + r.isLegacyApp = true; // r.subId is to be update when default changes. if (DBG) Slog.i(TAG, "listen: DEFAULT_SUB_ID"); } mRecords.add(r); - if (DBG) Slog.i(TAG, "listen: add new record=" + r); + if (DBG) Slog.i(TAG, "listen: add new record"); } int phoneId = SubscriptionManager.getPhoneId(subId); - int send = events & (events ^ r.events); r.events = events; + if (DBG) Slog.i(TAG, "listen: set events record=" + r); if (notifyNow && validatePhoneId(phoneId)) { if ((events & PhoneStateListener.LISTEN_SERVICE_STATE) != 0) { try { @@ -1063,6 +1066,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println(" mDataConnectionLinkProperties=" + mDataConnectionLinkProperties); pw.println(" mDataConnectionNetworkCapabilities=" + mDataConnectionNetworkCapabilities); + pw.println(" mDefaultSubId=" + mDefaultSubId); pw.println(" mCellLocation=" + mCellLocation); pw.println(" mCellInfo=" + mCellInfo); pw.println(" mDcRtInfo=" + mDcRtInfo); diff --git a/telephony/java/android/telephony/SubInfoRecord.java b/telephony/java/android/telephony/SubInfoRecord.java index 670def7..ced8e2f 100644 --- a/telephony/java/android/telephony/SubInfoRecord.java +++ b/telephony/java/android/telephony/SubInfoRecord.java @@ -105,4 +105,11 @@ public class SubInfoRecord implements Parcelable { return 0; } + public String toString() { + return "{mSubId=" + mSubId + ", mIccId=" + mIccId + " mSlotId=" + mSlotId + + " mDisplayName=" + mDisplayName + " mNameSource=" + mNameSource + + " mColor=" + mColor + " mNumber=" + mNumber + + " mDispalyNumberFormat=" + mDispalyNumberFormat + " mDataRoaming=" + mDataRoaming + + " mSimIconRes=" + mSimIconRes + "}"; + } } diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 859a890..79e9fd5 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -697,12 +697,16 @@ public class SubscriptionManager implements BaseColumns { public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId) { long [] subId = SubscriptionManager.getSubId(phoneId); if ((subId != null) && (subId.length >= 1)) { - if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); - intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); //FIXME: RENAME TO PHONE_ID_KEY ?? - intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId[0]); + putPhoneIdAndSubIdExtra(intent, phoneId, subId[0]); } else { logd("putPhoneIdAndSubIdExtra: no valid subs"); } } + + public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId, long subId) { + if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); + intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); //FIXME: RENAME TO PHONE_ID_KEY ?? + intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); + } } |